[xml/sgml-pkgs] Bug#486818: xsltproc: Incorrectly omits namespace declaration

Gábor Braun braung at renyi.hu
Wed Jun 18 11:29:25 UTC 2008


Package: xsltproc
Version: 1.1.19-2
Severity: normal

Example stylesheet: missing.xsl

<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xhtml="http://www.w3.org/1999/XHTML">

<xsl:template match="/">
  <xsl:element name="foo">
    <bar/>
  </xsl:element>
</xsl:template>

</xsl:stylesheet>

Let's apply it.

$xsltproc missing.xsl missing.xsl
<?xml version="1.0"?>
<foo><bar/></foo>

The output is wrong: the namespace prefix 'xhtml' should be declared on element 
bar.

Using the following, equivalent stylesheet instead of the above:

<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xhtml="http://www.w3.org/1999/XHTML">

<xsl:template match="/">
  <xsl:element name="foo">
    <xsl:call-template name="bar"/>
  </xsl:element>
</xsl:template>

<xsl:template name="bar">
  <bar/>
</xsl:template>
</xsl:stylesheet>

the output is 

<?xml version="1.0"?>
<foo><bar xmlns:xhtml="http://www.w3.org/1999/XHTML"/></foo>

which is correct.

Best wishes,

	Gábor Braun

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (990, 'stable'), (650, 'testing'), (600, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-686
Locale: LANG=hu_HU.UTF-8, LC_CTYPE=hu_HU.UTF-8 (charmap=UTF-8)

Versions of packages xsltproc depends on:
ii  libc6                      2.7-10        GNU C Library: Shared libraries
ii  libgcrypt11                1.4.1-1       LGPL Crypto library - runtime libr
ii  libgpg-error0              1.4-1         library for common error values an
ii  libxml2                    2.6.32.dfsg-2 GNOME XML library
ii  libxslt1.1                 1.1.19-2      XSLT processing library - runtime 

xsltproc recommends no packages.

-- no debconf information





More information about the debian-xml-sgml-pkgs mailing list