changed the way the root element of value tree are handled to fix bug
authorDaniel Veillard <veillard@src.gnome.org>
Tue, 4 Feb 2003 17:40:54 +0000 (17:40 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Tue, 4 Feb 2003 17:40:54 +0000 (17:40 +0000)
* libxslt/pattern.c libxslt/transform.c: changed the way the
  root element of value tree are handled to fix bug #104123
Daniel

ChangeLog
libxslt/pattern.c
libxslt/transform.c

index 7a3b48c..7294cff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb  4 18:39:35 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+       * 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 <daniel@veillard.com>
 
        * README: change of policy w.r.t. mails
index 9da3f19..a80a224 100644 (file)
@@ -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;
index 2263f8a..851bb77 100644 (file)
@@ -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.