Re: [xslt] problem with variables that are nodesets



Le 2001.10.04 00:41, Daniel Allen a écrit :
>   <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:value-of select="$foo/node/@id"/>
[...]
> The last value-of fails because libxslt doesn't see
> this variable as a nodeset (or a node)

Because it is not.

> but rather as a string...

No, a Result Tree Fragment, as described in the XSLT spec.

> this all works in saxon and sablotron

Because they extend their behaviour to the XSLT 1.1 proposal, which makes
result tree fragment compatible with and convertible to node-sets.

Tom.




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