xsl-list
[Top] [All Lists]

Re: Accessing Variable within a Variable

2003-04-07 04:59:50

  <xsl:variable name="merger">
        <xsl:value-of select="$X1"/>
        <xsl:value-of select="$X2"/>
  </xsl:variable>

  <xsl:for-each select="$merger/item">

This is a syntax error, you can not query into a result tree fragment
variable in XSLT 1.
This should be


<xsl:for-each select="xx:node-set($merger)/item">

where xx:node-set is your systems node-set extension. If your system is
not reporting an error here it has a bug.

However even if you use node-set then 

<xsl:variable name="merger">
        <xsl:value-of select="$X1"/>
        <xsl:value-of select="$X2"/>
</xsl:variable>

value-of gives the string value of its argument so $merger
will be a result tree fragment corresponding to a root node with just
text child, no elements, and in particular no elements called item, so

I do not know what you intend by

<xsl:for-each select="$merger/item">

perhaps you want copy-of not value-of when you build merger, but it's
hard to guess.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>