diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-01-10 17:06:09 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-01-10 17:06:09 +0000 |
commit | 8e7e1c00ce5cc3ce959833b888c50ed9fd9d5aae (patch) | |
tree | 620d5bfc5f47dbe0458f88d03f9e016caf02e022 /xpath.c | |
parent | cacbe5d110d469463edb0dd8e11e493daaf3dbc4 (diff) | |
download | libxml2-8e7e1c00ce5cc3ce959833b888c50ed9fd9d5aae.tar.gz |
fix to the XPath implementation for parent and ancestors axis when
* xpath.c: fix to the XPath implementation for parent and
ancestors axis when operating on a Result Value Tree.
Fixes bug #100271
Daniel
Diffstat (limited to 'xpath.c')
-rw-r--r-- | xpath.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -5268,6 +5268,10 @@ xmlXPathNextParent(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { case XML_ENTITY_DECL: if (ctxt->context->node->parent == NULL) return((xmlNodePtr) ctxt->context->doc); + if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) && + (xmlStrEqual(ctxt->context->node->parent->name, + BAD_CAST "fake node libxslt"))) + return(NULL); return(ctxt->context->node->parent); case XML_ATTRIBUTE_NODE: { xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node; @@ -5335,6 +5339,10 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { case XML_XINCLUDE_END: if (ctxt->context->node->parent == NULL) return((xmlNodePtr) ctxt->context->doc); + if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) && + (xmlStrEqual(ctxt->context->node->parent->name, + BAD_CAST "fake node libxslt"))) + return(NULL); return(ctxt->context->node->parent); case XML_ATTRIBUTE_NODE: { xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node; @@ -5380,6 +5388,11 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { case XML_ENTITY_DECL: case XML_XINCLUDE_START: case XML_XINCLUDE_END: + if (cur->parent == NULL) + return(NULL); + if ((cur->parent->type == XML_ELEMENT_NODE) && + (xmlStrEqual(cur->parent->name, BAD_CAST "fake node libxslt"))) + return(NULL); return(cur->parent); case XML_ATTRIBUTE_NODE: { xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node; |