fixed problem with entity handling within xsltCopyAttrListNoOverwrite
authorWilliam M. Brack <wbrack@src.gnome.org>
Fri, 17 Nov 2006 01:54:15 +0000 (01:54 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Fri, 17 Nov 2006 01:54:15 +0000 (01:54 +0000)
* libxslt/transform.c: fixed problem with entity handling
  within xsltCopyAttrListNoOverwrite (#352907)
* tests/general/bug-164.xsl, tests/general/bug-164.out,
  tests/docs/bug-164.oxml: added a regression test for this

ChangeLog
libxslt/transform.c
tests/docs/Makefile.am
tests/docs/bug-164.xml [new file with mode: 0644]
tests/general/Makefile.am
tests/general/bug-164.out [new file with mode: 0644]
tests/general/bug-164.xsl [new file with mode: 0644]

index a57c0dc..e587ff5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Nov 17 09:53:08 HKT 2006 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/transform.c: fixed problem with entity handling
+         within xsltCopyAttrListNoOverwrite (#352907)
+       * tests/general/bug-164.xsl, tests/general/bug-164.out,
+         tests/docs/bug-164.oxml: added a regression test for this
+
 Thu Oct 26 15:31:01 CEST 2006 Daniel Veillard <daniel@veillard.com>
 
        * NEWS configure.in doc//*: preparing release of libxslt-1.1.18,
index cde84e1..7c0461d 100644 (file)
@@ -1074,8 +1074,12 @@ xsltCopyAttrListNoOverwrite(xsltTransformContextPtr ctxt,
            } else
                copyNs = NULL;
        }
+       /*
+        * If attribute has a value, we need to copy it (watching out
+        * for possible entities)
+        */
        if (attr->children)
-           value = xmlNodeListGetString(attr->doc, attr->children, 1);
+           value = xmlNodeListGetString(attr->doc, attr->children, 0);
        /*
        * REVISIT: I think xmlNewDocProp() is the only attr function
        * which does not eval if the attr is of type ID. This is good,
index 938b216..a801453 100644 (file)
@@ -162,6 +162,7 @@ EXTRA_DIST =        \
        bug-160.xml \
        bug-161.xml \
        bug-163.xml \
+       bug-164.xml \
        character.xml \
        array.xml \
        items.xml
diff --git a/tests/docs/bug-164.xml b/tests/docs/bug-164.xml
new file mode 100644 (file)
index 0000000..920546d
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<doc>
+  <stuff name="A &amp; B"/>
+</doc>
index 55b3e39..618b23a 100644 (file)
@@ -171,6 +171,7 @@ EXTRA_DIST = \
     bug-160.out bug-160.xsl \
     bug-161.out bug-161.xsl \
     bug-163.out bug-163.xsl \
+    bug-164.out bug-164.xsl \
     character.out character.xsl \
     character2.out character2.xsl \
     itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-164.out b/tests/general/bug-164.out
new file mode 100644 (file)
index 0000000..7bf839a
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="us-ascii"?>
+
+  <stuff name="A &amp; B"/>
+
diff --git a/tests/general/bug-164.xsl b/tests/general/bug-164.xsl
new file mode 100644 (file)
index 0000000..ef4ae18
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<xsl:stylesheet 
+  version="1.1"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ >
+
+<xsl:output encoding="us-ascii"/>
+
+<xsl:template match="stuff">
+    <xsl:copy-of select="."/>
+</xsl:template>
+
+</xsl:stylesheet>