[xml/sgml-pkgs] Bug#273226: libxslt - broken handling of default namespace

Bastian Blank Bastian Blank <waldi@debian.org>, 273226@bugs.debian.org
Fri, 24 Sep 2004 19:38:01 +0200


--ew6BAiZeqk4r7MaW
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Package: libxslt1.1
Version: 1.1.8-4
Severity: normal

libxslt sometimes missuses the default namespace. The testcase is
attached.

| <xsl:stylesheet version=3D'1.0'
|   xmlns:xsl=3D'http://www.w3.org/1999/XSL/Transform'
|   xmlns:test=3D"urn::test">
|   <xsl:template match=3D"test:*">
|     <xsl:copy>
|       <xsl:apply-templates select=3D"@test:*"/>
|     </xsl:copy>
|   </xsl:template>
|   <xsl:template match=3D"@test:test">
|     <xsl:copy-of select=3D"."/>
|   </xsl:template>
| </xsl:stylesheet>

testcase with explicit namespace:
| <test:item xmlns:test=3D"urn::test" test:test=3D"test"/>

result:
| <?xml version=3D"1.0"?>
| <test:item xmlns:test=3D"urn::test" test:test=3D"test"/>

xsltproc output:
[...]
| xsltProcessOneNode: applying template 'test:*' for item
| xsltCopy: node item
| xsltApplyTemplates: node: item
| xsltApplyTemplates: select @test:*
| xsltApplyTemplates: list of 1 nodes
| xsltProcessOneNode: applying template '@test:test' for attribute test
| xsltCopyOf: select .
| xsltCopyOf: result is a node set

testcase with default namespace:
| <item xmlns=3D"urn::test" test=3D"test"/>

result:
| <?xml version=3D"1.0"?>
| <item xmlns=3D"urn::test">test</item>

xsltproc output:
[...]
| xsltProcessOneNode: applying template 'test:*' for item
| xsltCopy: node item
| xsltApplyTemplates: node: item
| xsltApplyTemplates: select @test:*
| xsltApplyTemplates: list of 1 nodes
| xsltProcessOneNode: no template found for attribute test
| xsltDefaultProcessOneNode: copy text test

This bug is restricted to the default/empty namespace. It does not occur if=
 I
define any identifier for the namespace.

Bastian

--=20
In the strict scientific sense we all feed on death -- even vegetarians.
		-- Spock, "Wolf in the Fold", stardate 3615.4

--ew6BAiZeqk4r7MaW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iEYEARECAAYFAkFUW3kACgkQnw66O/MvCNEkIQCfXOUjDpkp0psOsd1P0ZZ5JfP8
TKgAn331LscUfGDkBN90iwa799ymh0m2
=ns9m
-----END PGP SIGNATURE-----

--ew6BAiZeqk4r7MaW--