From 40cf80bcbceb77c38681d19d783695fd4928a7c5 Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Fri, 17 Nov 2006 01:54:15 +0000 Subject: 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 --- ChangeLog | 7 +++++++ libxslt/transform.c | 6 +++++- tests/docs/Makefile.am | 1 + tests/docs/bug-164.xml | 4 ++++ tests/general/Makefile.am | 1 + tests/general/bug-164.out | 4 ++++ tests/general/bug-164.xsl | 13 +++++++++++++ 7 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/docs/bug-164.xml create mode 100644 tests/general/bug-164.out create mode 100644 tests/general/bug-164.xsl 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 + + * 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 * 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 @@ + + + + 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 @@ + + + + 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 @@ + + + + + + + + + + -- cgit v1.2.3