diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-03-24 13:57:34 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-03-24 13:57:34 +0000 |
commit | ef0b45016373d65700ef6f7d494a200758b2e4c5 (patch) | |
tree | b84d25b1069db331e8858ccd29f2ac78c2267fb3 /xpath.c | |
parent | 9231ff9250af7e22104cc5e9406f0dd43e86aec0 (diff) | |
download | android_external_libxml2-ef0b45016373d65700ef6f7d494a200758b2e4c5.tar.gz android_external_libxml2-ef0b45016373d65700ef6f7d494a200758b2e4c5.tar.bz2 android_external_libxml2-ef0b45016373d65700ef6f7d494a200758b2e4c5.zip |
fixed some problems related to #75813 about handling of Result Value Trees
* xpath.c: fixed some problems related to #75813 about handling
of Result Value Trees
Daniel
Diffstat (limited to 'xpath.c')
-rw-r--r-- | xpath.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -1694,8 +1694,10 @@ xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) { if (val == NULL) return; +#if 0 if ((val->type == XML_ELEMENT_NODE) && (val->name[0] == ' ')) return; /* an XSLT fake node */ +#endif /* @@ with_ns to check wether namespace nodes should be looked at @@ */ /* @@ -1752,8 +1754,10 @@ void xmlXPathNodeSetAddUnique(xmlNodeSetPtr cur, xmlNodePtr val) { if (val == NULL) return; +#if 0 if ((val->type == XML_ELEMENT_NODE) && (val->name[0] == ' ')) return; /* an XSLT fake node */ +#endif /* @@ with_ns to check wether namespace nodes should be looked at @@ */ /* @@ -3130,11 +3134,21 @@ xmlXPathObjectCopy(xmlXPathObjectPtr val) { case XPATH_XSLT_TREE: if ((val->nodesetval != NULL) && (val->nodesetval->nodeTab != NULL)) { + xmlNodePtr cur, top, tmp; + ret->boolval = 1; - ret->user = xmlDocCopyNode(val->nodesetval->nodeTab[0], - val->nodesetval->nodeTab[0]->doc, 1); - ret->nodesetval = xmlXPathNodeSetCreate( - (xmlNodePtr) ret->user); + top = xmlCopyNode(val->nodesetval->nodeTab[0], 0); + ret->user = top; + if (top != NULL) { + top->doc = (xmlDocPtr) top; + cur = val->nodesetval->nodeTab[0]->children; + while (cur != NULL) { + tmp = xmlDocCopyNode(cur, (xmlDocPtr) top, 1); + xmlAddChild(top, tmp); + cur = cur->next; + } + } + ret->nodesetval = xmlXPathNodeSetCreate(top); } else ret->nodesetval = xmlXPathNodeSetCreate(NULL); /* Deallocate the copied tree value */ |