[xslt] problem with variables that are nodesets
- From: Daniel Allen <mojavelinux yahoo com>
- To: xslt gnome org
- Subject: [xslt] problem with variables that are nodesets
- Date: Wed, 3 Oct 2001 15:41:52 -0700 (PDT)
Hey xslt fan!
Okay, try template this in xsltproc on any xml file
<xsl:template match="/">
<xsl:variable name="foo">
<xsl:element name="node">
<xsl:attribute name="id">bar1</xsl:attribute>
<xsl:text>a test node</xsl:text>
</xsl:element>
</xsl:variable>
<xsl:copy-of
select="$foo"/><xsl:text>
</xsl:text>
<xsl:value-of
select="$foo"/><xsl:text>
</xsl:text>
<xsl:value-of
select="$foo/node/@id"/><xsl:text>
</xsl:text>
</xsl:template>
The last value-of fails because libxslt doesn't see
this variable as a nodeset (or a node) but rather as a
string...this all works in saxon and sablotron
Dan
__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]