summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-01-10 17:06:09 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-01-10 17:06:09 +0000
commit8e7e1c00ce5cc3ce959833b888c50ed9fd9d5aae (patch)
tree620d5bfc5f47dbe0458f88d03f9e016caf02e022 /xpath.c
parentcacbe5d110d469463edb0dd8e11e493daaf3dbc4 (diff)
downloadlibxml2-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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/xpath.c b/xpath.c
index 305bccf3..22353bab 100644
--- a/xpath.c
+++ b/xpath.c
@@ -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;