applied patch from Mark Vakoc fixing bug with namespace URI on template
authorWilliam M. Brack <wbrack@src.gnome.org>
Wed, 1 Dec 2004 06:52:22 +0000 (06:52 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Wed, 1 Dec 2004 06:52:22 +0000 (06:52 +0000)
* libxslt/xslt.c: applied patch from Mark Vakoc fixing bug with
  namespace URI on template names.
* tests/namespaces/tst9*, tests/namespaces/Makefile.am: added
  test case for this

ChangeLog
libxslt/xslt.c
tests/namespaces/Makefile.am
tests/namespaces/tst9.out [new file with mode: 0644]
tests/namespaces/tst9.xml [new file with mode: 0644]
tests/namespaces/tst9.xsl [new file with mode: 0644]

index 3a07c6c..25b039e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Dec  1 14:30:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/xslt.c: applied patch from Mark Vakoc fixing bug with
+         namespace URI on template names.
+       * tests/namespaces/tst9*, tests/namespaces/Makefile.am: added
+         test case for this
+
 Tue Nov 30 10:53:18 HKT 2004 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/pattern.c: more on RVT's in XPath predicates, this
index e483da3..733afb7 100644 (file)
@@ -1768,7 +1768,10 @@ xsltParseStylesheetTemplate(xsltStylesheetPtr style, xmlNodePtr template) {
                ret->nameURI = NULL;
            cur = ret->next;
            while (cur != NULL) {
-               if (xmlStrEqual(cur->name, prop)) {
+               if ((URI != NULL && xmlStrEqual(cur->name, prop) &&
+                               xmlStrEqual(cur->nameURI, URI) ) ||
+                   (URI == NULL && cur->nameURI == NULL &&
+                               xmlStrEqual(cur->name, prop))) {
                    xsltTransformError(NULL, style, template,
                        "xsl:template: error duplicate name '%s'\n", prop);
                    style->errors++;
index 4c58bd7..edc9b2f 100644 (file)
@@ -13,7 +13,8 @@ EXTRA_DIST = \
     tst5.xml tst5.xsl tst5.out \
     tst6.xml tst6.xsl tst6.out \
     tst7.xml tst7.xsl tst7.out \
-    tst8.xml tst8.xsl tst8.out
+    tst8.xml tst8.xsl tst8.out \
+    tst9.xml tst9.xsl tst9.out
 
 all:
 
diff --git a/tests/namespaces/tst9.out b/tests/namespaces/tst9.out
new file mode 100644 (file)
index 0000000..0d7d44b
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+
+
+
+
+
+
+
diff --git a/tests/namespaces/tst9.xml b/tests/namespaces/tst9.xml
new file mode 100644 (file)
index 0000000..69c8a85
--- /dev/null
@@ -0,0 +1,11 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:ns="namespace"
+>
+
+<xsl:template name="test"/>
+
+<xsl:template name="ns:test"/>
+
+</xsl:stylesheet>
+
+
diff --git a/tests/namespaces/tst9.xsl b/tests/namespaces/tst9.xsl
new file mode 100644 (file)
index 0000000..69c8a85
--- /dev/null
@@ -0,0 +1,11 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:ns="namespace"
+>
+
+<xsl:template name="test"/>
+
+<xsl:template name="ns:test"/>
+
+</xsl:stylesheet>
+
+