summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2006-11-17 01:54:15 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2006-11-17 01:54:15 +0000
commit40cf80bcbceb77c38681d19d783695fd4928a7c5 (patch)
tree94f97b05714ff581e52cef60bf5db3b001cf880f
parent951beb01d47c23b137180086456328112e672586 (diff)
downloadlibxslt-40cf80bcbceb77c38681d19d783695fd4928a7c5.tar.gz
libxslt-40cf80bcbceb77c38681d19d783695fd4928a7c5.tar.bz2
libxslt-40cf80bcbceb77c38681d19d783695fd4928a7c5.zip
fixed problem with entity handling within xsltCopyAttrListNoOverwrite
* 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
-rw-r--r--ChangeLog7
-rw-r--r--libxslt/transform.c6
-rw-r--r--tests/docs/Makefile.am1
-rw-r--r--tests/docs/bug-164.xml4
-rw-r--r--tests/general/Makefile.am1
-rw-r--r--tests/general/bug-164.out4
-rw-r--r--tests/general/bug-164.xsl13
7 files changed, 35 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a57c0dcd..e587ff57 100644
--- 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,
diff --git a/libxslt/transform.c b/libxslt/transform.c
index cde84e15..7c0461d1 100644
--- a/libxslt/transform.c
+++ b/libxslt/transform.c
@@ -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,
diff --git a/tests/docs/Makefile.am b/tests/docs/Makefile.am
index 938b2167..a801453e 100644
--- a/tests/docs/Makefile.am
+++ b/tests/docs/Makefile.am
@@ -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
index 00000000..920546dc
--- /dev/null
+++ b/tests/docs/bug-164.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<doc>
+ <stuff name="A &amp; B"/>
+</doc>
diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am
index 55b3e394..618b23a5 100644
--- a/tests/general/Makefile.am
+++ b/tests/general/Makefile.am
@@ -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
index 00000000..7bf839ab
--- /dev/null
+++ b/tests/general/bug-164.out
@@ -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
index 00000000..ef4ae188
--- /dev/null
+++ b/tests/general/bug-164.xsl
@@ -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>