[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Accessing Variable within a Variable

Subject: Re: Accessing Variable within a Variable
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 7 Apr 2003 12:59:50 +0100
accessing xsl variables
  <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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.