[xslt] problem with variables that are nodesets



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>&#010;</xsl:text>
    <xsl:value-of
select="$foo"/><xsl:text>&#010;</xsl:text>
    <xsl:value-of
select="$foo/node/@id"/><xsl:text>&#010;</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]