[xml/sgml-pkgs] Bug#392364: libxslt1.1: incorrect node selection when XSLT file is read by document()

Vincent Lefevre vincent at vinc17.org
Wed Oct 11 14:16:24 UTC 2006


Package: libxslt1.1
Version: 1.1.17-5
Severity: important

[Severity set to important, as this is a regression (1.1.17-4
on another machine doesn't have this problem), so that current
stylesheets may no longer work.]

I have a stylesheet website.xsl that contains:

<xsl:variable name="webtext"
  select="document('../webtext.xml',webtext)/webtext"/>
[...]
    <span>
      <xsl:apply-templates
        select="$webtext/para[@role = $text and @lang = $lang]/node()"/>
      <xsl:text>: </xsl:text>
    </span>

For instance, this allows to generate:

  <span><acronym>XSL</acronym> stylesheets: </span>

where webtext.xml contains:

  <para role="xslfile" lang="en"><acronym>XSL</acronym> stylesheet</para>

This was working up to 1.1.17-4, but with 1.1.17-5, I get:

  <span><acronym>XSL</acronym>XSL stylesheets: </span>

I noticed that if I changed the name of the XSLT file (for testing
purpose), the effect of the bug disappeared! So, I guessed that the
problem was a consequence of a self-reference. Indeed, in another
place of website.xsl, I have:

<xsl:template name="getcxslids">
  <xsl:param name="file" select="'website.xsl'"/>
  <xsl:variable name="dir">
    <xsl:call-template name="directory">
      <xsl:with-param name="file" select="$file"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:for-each select="document($file)/xsl:stylesheet/xsl:include/@href">
    <xsl:value-of select="document(concat($dir,.))/comment()"/>
  </xsl:for-each>
</xsl:template>

If I comment out the contents of this template, the effect of the bug
also disappears, i.e., I get:

  <span><acronym>XSL</acronym> stylesheets: </span>

as expected.

I couldn't produce a simple testcase yet. I hope this is sufficient to
find the bug. Otherwise, I can try to simplify my set of stylesheets
until I get a small testcase.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-1-686-bigmem
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.ISO8859-1 (charmap=ISO-8859-1)

Versions of packages libxslt1.1 depends on:
ii  libc6                      2.3.6.ds1-6   GNU C Library: Shared libraries
ii  libgcrypt11                1.2.3-2       LGPL Crypto library - runtime libr
ii  libgpg-error0              1.4-1         library for common error values an
ii  libxml2                    2.6.26.dfsg-4 GNOME XML library

libxslt1.1 recommends no packages.

-- no debconf information




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