[xslt] Selecting on nodeset in variable from stylesheet



Using these files "empty" and "xsltbug":

= empty ================================================
<empty/>
=====================================================

= xsltbug ===============================================
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">

<xsl:variable name="foo"><name>bar</name></xsl:variable>
<xsl:value-of select="$foo/name"/>

</xsl:template>
</xsl:stylesheet>
=====================================================

I get the following error when running this through xsltproc:

$ xsltproc xsltbug empty
XPath error : Invalid type
runtime error: file xsltbug line 5 element value-of
xsltValueOf: text copy failed
no result for empty

I would expect to see "bar" as the result.

Am I doing here that I shouldn't be doing?


BTW, this is with the latest and greatest, but also happens in 
earlier versions:

$ xsltproc --version
Using libxml 20603, libxslt 10101 and libexslt 801
xsltproc was compiled against libxml 20603, libxslt 10101 and libexslt 801
libxslt 10101 was compiled against libxml 20603
libexslt 801 was compiled against libxml 20603



Liz



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]