1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

fix a problem with string() on a document node. Daniel

* xpath.c: fix a problem with string() on a document node.
Daniel
This commit is contained in:
Daniel Veillard
2002-04-18 15:50:05 +00:00
parent decd64d645
commit 23b1f37bf5
2 changed files with 6 additions and 0 deletions

View File

@ -3216,6 +3216,8 @@ xmlXPathCastNumberToString (double val) {
*/
xmlChar *
xmlXPathCastNodeToString (xmlNodePtr node) {
if ((node != NULL) && (node->type == XML_DOCUMENT_NODE))
node = xmlDocGetRootElement((xmlDocPtr) node);
return(xmlNodeGetContent(node));
}