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

XPATH to be used in a for-each loop wherein the XPATH

Subject: XPATH to be used in a for-each loop wherein the XPATH is stored in a <xsl:variable>
From: Rahul Patwardhan <patwardhanrahul@xxxxxxxxx>
Date: Fri, 25 Jul 2003 06:10:50 -0700 (PDT)
xpath loop
I want to use an XPATH in a for-each loop.The XPATH is
stored in a variable as a string. I want to traverse
the XPATH in a for-each loop but i dont want to use
the (xalan:evaluate) function. Are there any other
ways of doing this?

Here is a part of my XML File on which the XPATH is
based...

<Fields>
<Field>
	<Id>1</Id>
	<LanguageProperties Languageid="1">
		<Label>SomeLabel</Label>
	</LanguageProperties>
</Field>
</Fields>


And here is my XSL..

<xsl:variable
name="PropName">LanguageProperties/Label</xsl:variable>

<xsl:variable
name="xpathvar">/Fields/Field/<xsl:value-of
select="$PropName"/></xsl:variable>
		<xsl:for-each select="xalan:nodeset($xpathvar)">
			<xsl:value-of select="."/>
		</xsl:for-each>

The problem is that the the path stored in the
PropName variable is being generated dynamically so i
wont always be 'LanguageProperties/Label'.So the
purpose of taking it in a variable.
By using "xalan:evaluate(variable_name)" my problem
will be solved, but as far as possible i dont want to
use it and it would be great if a solution to this
problem is without using "xalan:evaluate".
Thanks a lot for ur help.
Rahul



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

 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.