[xml/sgml-pkgs] Bug#411650: xsltproc: Failed to compile predicate XPath error : Undefined variable

Monroux Philippe monroux-listes at wanadoo.fr
Tue Feb 20 10:51:18 UTC 2007


Package: xsltproc
Version: 1.1.19-1
Severity: normal

hello,

On etch release (everything was ok on sarge...)

xsltproc -stringparam lang fr  main.xsl index.xml > index.fr.html

give me the error

XPath error : Undefined variable
not(lang($lang))
              ^
compilation error: file main.xsl line 20 element template
Failed to compile predicate
XPath error : Undefined variable
lang($lang)
          ^
compilation error: file main.xsl line 22 element template
Failed to compile predicate

index.xml
,----
| <?xml version="1.0" encoding="utf-8" ?>
| <!-- <?xml-stylesheet type="text/xsl" href="main.xsl"?> -->
| <!--
| <!DOCTYPE html PUBLIC ".//W3C//DTD XHTML 1.1 //EN"
| "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
| -->
| <body>
|   <h1>
|     <span xml:lang="en">Ready ?</span>
|     <span xml:lang="fr">Prêt ?</span>
|   </h1>
| </body>
`----

main.xsl
,----
| <?xml version="1.0" encoding="utf-8"?>
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|   <xsl:output method="html"
| 	    encoding="utf-8"
| 	    doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"
| 	    doctype-system="http://www.w3.org/TR/REC-html40/loose.dtd"
| 	    indent="yes"
| 	    />
|   <xsl:param name="lang">fr</xsl:param>
| 
|   <xsl:template match="/body">
|     <html>
|       <head>
|       </head>
|       <body>
| 	  <xsl:apply-templates select="@*|*"/>
|       </body>
|     </html>
|   </xsl:template>
|   <xsl:template match="span[not(lang($lang))]">
|   </xsl:template>
|   <xsl:template match="span[lang($lang)]">
|       <xsl:copy-of select='attribute[name()!="lang"]|node()'/>
|   </xsl:template>
|   <xsl:template match="@*|node()">
|     <xsl:copy>
|       <xsl:apply-templates select="@*|node()"/>
|     </xsl:copy>
|   </xsl:template>
| </xsl:stylesheet>
`----


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-2-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

Versions of packages xsltproc depends on:
ii  libc6                      2.3.6.ds1-11  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.27.dfsg-1 GNOME XML library
ii  libxslt1.1                 1.1.19-1      XSLT processing library - runtime 

xsltproc recommends no packages.

-- no debconf information





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