aboutsummaryrefslogtreecommitdiffstats
path: root/xpath.c
diff options
context:
space:
mode:
authorAleksey Sanin <aleksey@src.gnome.org>2002-05-31 04:24:13 +0000
committerAleksey Sanin <aleksey@src.gnome.org>2002-05-31 04:24:13 +0000
commitdffd5c8dbc7b9052db7ae69dce419a96e22acc68 (patch)
tree8ee2fba00912ef9b58b3b19bfe15e862758154e1 /xpath.c
parent12171c4db1493e7b341a719a3705011c54f5e819 (diff)
downloadandroid_external_libxml2-dffd5c8dbc7b9052db7ae69dce419a96e22acc68.tar.gz
android_external_libxml2-dffd5c8dbc7b9052db7ae69dce419a96e22acc68.tar.bz2
android_external_libxml2-dffd5c8dbc7b9052db7ae69dce419a96e22acc68.zip
propagating xpath ancesstors node fix to c14n plus small performance
* c14n.c: propagating xpath ancesstors node fix to c14n plus small performance improvement to reduce number of mallocs * xpath.c: fixed ancestors axis processing for namespace nodes
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/xpath.c b/xpath.c
index adc33109..d56c70f0 100644
--- a/xpath.c
+++ b/xpath.c
@@ -5200,6 +5200,15 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
return(att->parent);
}
+ case XML_NAMESPACE_DECL: {
+ xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
+
+ if ((ns->next != NULL) &&
+ (ns->next->type != XML_NAMESPACE_DECL))
+ return((xmlNodePtr) ns->next);
+ /* Bad, how did that namespace ended-up there ? */
+ return(NULL);
+ }
case XML_DOCUMENT_NODE:
case XML_DOCUMENT_TYPE_NODE:
case XML_DOCUMENT_FRAG_NODE:
@@ -5208,12 +5217,6 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
case XML_DOCB_DOCUMENT_NODE:
#endif
return(NULL);
- case XML_NAMESPACE_DECL:
- /*
- * this should not hapen a namespace can't be
- * the ancestor of another node
- */
- return(NULL);
}
return(NULL);
}