Re: [xslt] problem with variables that are nodesets
- From: Bernhard Zwischenbrugger <bz datenkueche com>
- To: xslt gnome org
- Subject: Re: [xslt] problem with variables that are nodesets
- Date: Thu, 4 Oct 2001 04:27:53 +0200
Try this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:libxslt="http://xmlsoft.org/XSLT/namespace">
> <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="libxslt:node-set($foo)/node/@id"/><xsl:text>
</xsl:text>
<!--- *************** -->
> </xsl:template>
I think in new versions of xsltproc this should work.
Bernhard
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]