diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2009-09-16 18:51:29 +0200 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2009-09-16 18:51:29 +0200 |
commit | a1fff8aaf099c294b6d3a757dbb4b06bfd42674a (patch) | |
tree | 3be1ee5209b920c46895af960de7640227736b9f | |
parent | a4c03651594b619277f74142ef1d9e1d58d19d71 (diff) | |
download | libxslt-a1fff8aaf099c294b6d3a757dbb4b06bfd42674a.tar.gz libxslt-a1fff8aaf099c294b6d3a757dbb4b06bfd42674a.tar.bz2 libxslt-a1fff8aaf099c294b6d3a757dbb4b06bfd42674a.zip |
Fix xsl:strip-space with namespace and wildcard
* libxslt/imports.c: xsl:strip-space didn't work if there is a NameTest
with a namespace and a wildcard
* tests/REC/Makefile.am tests/REC/test-3.4-*: add some test to the
regression suite
-rw-r--r-- | libxslt/imports.c | 7 | ||||
-rw-r--r-- | tests/REC/Makefile.am | 3 | ||||
-rw-r--r-- | tests/REC/test-3.4-1.out | 2 | ||||
-rw-r--r-- | tests/REC/test-3.4-1.xml | 14 | ||||
-rw-r--r-- | tests/REC/test-3.4-1.xsl | 11 | ||||
-rw-r--r-- | tests/REC/test-3.4-2.out | 2 | ||||
-rw-r--r-- | tests/REC/test-3.4-2.xml | 14 | ||||
-rw-r--r-- | tests/REC/test-3.4-2.xsl | 11 | ||||
-rw-r--r-- | tests/REC/test-3.4-3.out | 2 | ||||
-rw-r--r-- | tests/REC/test-3.4-3.xml | 14 | ||||
-rw-r--r-- | tests/REC/test-3.4-3.xsl | 11 |
11 files changed, 90 insertions, 1 deletions
diff --git a/libxslt/imports.c b/libxslt/imports.c index 8ff9f3d8..23538abf 100644 --- a/libxslt/imports.c +++ b/libxslt/imports.c @@ -348,6 +348,11 @@ xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt, xmlNodePtr node) { if (node->ns != NULL) { val = (const xmlChar *) xmlHashLookup2(style->stripSpaces, node->name, node->ns->href); + if (val == NULL) { + val = (const xmlChar *) + xmlHashLookup2(style->stripSpaces, BAD_CAST "*", + node->ns->href); + } } else { val = (const xmlChar *) xmlHashLookup2(style->stripSpaces, node->name, NULL); @@ -357,7 +362,7 @@ xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt, xmlNodePtr node) { return(1); if (xmlStrEqual(val, (xmlChar *) "preserve")) return(0); - } + } if (style->stripAll == 1) return(1); if (style->stripAll == -1) diff --git a/tests/REC/Makefile.am b/tests/REC/Makefile.am index 1b42cbd8..2c372db8 100644 --- a/tests/REC/Makefile.am +++ b/tests/REC/Makefile.am @@ -19,6 +19,9 @@ EXTRA_DIST = \ test-16.1-2.out test-16.1-2.xml test-16.1-2.xsl \ test-2.3-1.out test-2.3-1.xml test-2.3-1.xsl \ test-2.3-2.out test-2.3-2.xml test-2.3-2.xsl \ + test-3.4-1.out test-3.4-1.xml test-3.4-1.xsl \ + test-3.4-2.out test-3.4-2.xml test-3.4-2.xsl \ + test-3.4-3.out test-3.4-3.xml test-3.4-3.xsl \ test-2.5-1.out test-2.5-1.xml test-2.5-1.xsl test-2.5-1.err \ test-2.6.2-1.out test-2.6.2-1.xml test-2.6.2-1.xsl \ test-5.2-1.out test-5.2-1.xml test-5.2-1.xsl \ diff --git a/tests/REC/test-3.4-1.out b/tests/REC/test-3.4-1.out new file mode 100644 index 00000000..9787c951 --- /dev/null +++ b/tests/REC/test-3.4-1.out @@ -0,0 +1,2 @@ +<?xml version="1.0"?> + test01 test02 test11 test12 test11 test12 diff --git a/tests/REC/test-3.4-1.xml b/tests/REC/test-3.4-1.xml new file mode 100644 index 00000000..83e94bd2 --- /dev/null +++ b/tests/REC/test-3.4-1.xml @@ -0,0 +1,14 @@ +<doc> + <container> + <element1> <child>test01</child> </element1> + <element2> <child>test02</child> </element2> + </container> + <foo1:container xmlns:foo1="urn:foo1"> + <foo1:element1> <foo1:child>test11</foo1:child> </foo1:element1> + <foo1:element2> <foo1:child>test12</foo1:child> </foo1:element2> + </foo1:container> + <foo2:container xmlns:foo2="urn:foo2"> + <foo2:element1> <foo2:child>test11</foo2:child> </foo2:element1> + <foo2:element2> <foo2:child>test12</foo2:child> </foo2:element2> + </foo2:container> +</doc> diff --git a/tests/REC/test-3.4-1.xsl b/tests/REC/test-3.4-1.xsl new file mode 100644 index 00000000..78b47593 --- /dev/null +++ b/tests/REC/test-3.4-1.xsl @@ -0,0 +1,11 @@ +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:foo1="urn:foo1" + xmlns:foo2="urn:foo2" +> + <xsl:strip-space elements="foo1:element1"/> + <xsl:template match="doc"> + <xsl:apply-templates select="*/*"/> + </xsl:template> +</xsl:stylesheet> diff --git a/tests/REC/test-3.4-2.out b/tests/REC/test-3.4-2.out new file mode 100644 index 00000000..5864dba7 --- /dev/null +++ b/tests/REC/test-3.4-2.out @@ -0,0 +1,2 @@ +<?xml version="1.0"?> + test01 test02 test11test12 test11 test12 diff --git a/tests/REC/test-3.4-2.xml b/tests/REC/test-3.4-2.xml new file mode 100644 index 00000000..83e94bd2 --- /dev/null +++ b/tests/REC/test-3.4-2.xml @@ -0,0 +1,14 @@ +<doc> + <container> + <element1> <child>test01</child> </element1> + <element2> <child>test02</child> </element2> + </container> + <foo1:container xmlns:foo1="urn:foo1"> + <foo1:element1> <foo1:child>test11</foo1:child> </foo1:element1> + <foo1:element2> <foo1:child>test12</foo1:child> </foo1:element2> + </foo1:container> + <foo2:container xmlns:foo2="urn:foo2"> + <foo2:element1> <foo2:child>test11</foo2:child> </foo2:element1> + <foo2:element2> <foo2:child>test12</foo2:child> </foo2:element2> + </foo2:container> +</doc> diff --git a/tests/REC/test-3.4-2.xsl b/tests/REC/test-3.4-2.xsl new file mode 100644 index 00000000..0f46d6cc --- /dev/null +++ b/tests/REC/test-3.4-2.xsl @@ -0,0 +1,11 @@ +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:foo1="urn:foo1" + xmlns:foo2="urn:foo2" +> + <xsl:strip-space elements="foo1:*"/> + <xsl:template match="doc"> + <xsl:apply-templates select="*/*"/> + </xsl:template> +</xsl:stylesheet> diff --git a/tests/REC/test-3.4-3.out b/tests/REC/test-3.4-3.out new file mode 100644 index 00000000..9b9cdf39 --- /dev/null +++ b/tests/REC/test-3.4-3.out @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +test01test02test11test12test11test12 diff --git a/tests/REC/test-3.4-3.xml b/tests/REC/test-3.4-3.xml new file mode 100644 index 00000000..83e94bd2 --- /dev/null +++ b/tests/REC/test-3.4-3.xml @@ -0,0 +1,14 @@ +<doc> + <container> + <element1> <child>test01</child> </element1> + <element2> <child>test02</child> </element2> + </container> + <foo1:container xmlns:foo1="urn:foo1"> + <foo1:element1> <foo1:child>test11</foo1:child> </foo1:element1> + <foo1:element2> <foo1:child>test12</foo1:child> </foo1:element2> + </foo1:container> + <foo2:container xmlns:foo2="urn:foo2"> + <foo2:element1> <foo2:child>test11</foo2:child> </foo2:element1> + <foo2:element2> <foo2:child>test12</foo2:child> </foo2:element2> + </foo2:container> +</doc> diff --git a/tests/REC/test-3.4-3.xsl b/tests/REC/test-3.4-3.xsl new file mode 100644 index 00000000..d5e50298 --- /dev/null +++ b/tests/REC/test-3.4-3.xsl @@ -0,0 +1,11 @@ +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:foo1="urn:foo1" + xmlns:foo2="urn:foo2" +> + <xsl:strip-space elements="*"/> + <xsl:template match="doc"> + <xsl:apply-templates select="*/*"/> + </xsl:template> +</xsl:stylesheet> |