XSLT processing error: global variables not seen in predicates
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libxslt (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: libxslt1.1
It seems that xslt processing engine could not see global variables inside xsl predicates' conditions.
(See attached file xsltprocbug1.xsl)
Running
$xsltproc xsltprocbug1.xsl xsltprocbug1.xsl
gives the following output:
-----cut-----
XPath error : Undefined variable
compilation error: file xsltprocbug1.xsl line 4 element template
Failed to compile predicate
-----cut-----
Line 4 just references a global variable, defined earlier inside a predicate
4: <xsl:template match="
Similar behavior occurs when I am using libxslt from my own application.
NB: When using global variable outside the predicate, like in <xsl:value-of select="$hello" />, the processor gives no complaints.
Other XSLT processors,e.g. xalan do process this example template without reporting any errors.
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: libxslt1.1 1.1.24-2ubuntu2
ProcEnviron:
LANGUAGE=en_US:en
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: libxslt
Uname: Linux 2.6.28-11-generic i686
According to http:// bugzilla. gnome.org/ show_bug. cgi?id= 303289 the behaviour you see is correct, because the standard doesn't allow for variables in the match attribute.
(Note that I'm an xml/xslt newbie, and I may very well be wrong. The description of the bug is awfully similar though.)