Re: [xslt] problem with variables that are nodesets



Thanks so much, I guess I was taking it for granted. 
Well, that makes me really excited that I was just
doing it wrong, because libxslt is so fast it makes
faint!!!  I'm off to the races now...thanks for the
help!

Dan


------------------------------------------------
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>&#010;</xsl:text>
> <xsl:value-of
> select="$foo"/><xsl:text>&#010;</xsl:text>
> <xsl:value-of
<!-- ************* -->
select="libxslt:node-set($foo)/node/@id"/><xsl:text>&#010;</xsl:text>
<!--- *************** -->
> </xsl:template>

I think in new versions of xsltproc this should work.

Bernhard






__________________________________________________
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]