From 937ba2a3eb42d288f53c8adc211bd1122869f0bf Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 8 Aug 2012 15:31:05 +0800 Subject: Fix default template processing on namespace nodes --- libxslt/transform.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libxslt/transform.c b/libxslt/transform.c index 53eefcc3..c6df19ef 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -4895,7 +4895,10 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node, list = xmlXPathNodeSetCreate(NULL); if (list == NULL) goto error; - cur = node->children; + if (node->type != XML_NAMESPACE_DECL) + cur = node->children; + else + cur = NULL; while (cur != NULL) { switch (cur->type) { case XML_TEXT_NODE: @@ -4944,6 +4947,8 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node, if (cur->prev != NULL) cur->prev->next = cur->next; break; + case XML_NAMESPACE_DECL: + break; default: #ifdef WITH_XSLT_DEBUG_PROCESS XSLT_TRACE(ctxt,XSLT_TRACE_APPLY_TEMPLATES,xsltGenericDebug(xsltGenericDebugContext, -- cgit v1.2.3