From aac5d52c7d2aef88f96c39b06bb0d9ac3baebd3f Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 4 Feb 2003 17:40:54 +0000 Subject: [PATCH] changed the way the root element of value tree are handled to fix bug * libxslt/pattern.c libxslt/transform.c: changed the way the root element of value tree are handled to fix bug #104123 Daniel --- ChangeLog | 5 +++++ libxslt/pattern.c | 9 ++++++++- libxslt/transform.c | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7a3b48c..7294cff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 4 18:39:35 CET 2003 Daniel Veillard + + * libxslt/pattern.c libxslt/transform.c: changed the way the + root element of value tree are handled to fix bug #104123 + Tue Feb 4 18:15:01 CET 2003 Daniel Veillard * README: change of policy w.r.t. mails diff --git a/libxslt/pattern.c b/libxslt/pattern.c index 9da3f19..a80a224 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -400,6 +400,8 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, #endif (node->type == XML_HTML_DOCUMENT_NODE)) continue; + if ((node->type == XML_ELEMENT_NODE) && (node->name[0] == ' ')) + continue; return(0); case XSLT_OP_ELEM: if (node->type != XML_ELEMENT_NODE) @@ -2041,6 +2043,8 @@ xsltGetTemplate(xsltTransformContextPtr ctxt, xmlNodePtr node, */ switch (node->type) { case XML_ELEMENT_NODE: + if (node->name[0] == ' ') + break; case XML_ATTRIBUTE_NODE: case XML_PI_NODE: name = node->name; @@ -2092,7 +2096,10 @@ xsltGetTemplate(xsltTransformContextPtr ctxt, xmlNodePtr node, */ switch (node->type) { case XML_ELEMENT_NODE: - list = curstyle->elemMatch; + if (node->name[0] == ' ') + list = curstyle->rootMatch; + else + list = curstyle->elemMatch; break; case XML_ATTRIBUTE_NODE: list = curstyle->attrMatch; diff --git a/libxslt/transform.c b/libxslt/transform.c index 2263f8a..851bb77 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -1170,6 +1170,7 @@ xsltProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node, xsltTemplatePtr template; xmlNodePtr oldNode; +#if 0 if (xmlStrEqual(node->name, BAD_CAST " fake node libxslt")) { xmlNodePtr children; @@ -1180,6 +1181,7 @@ xsltProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node, } return; } +#endif template = xsltGetTemplate(ctxt, node, NULL); /* * If no template is found, apply the default rule. -- 2.7.4