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

Can not store value into xsl:variable

Subject: Can not store value into xsl:variable
From: "Manwani, Manish" <Manish.Manwani@xxxxxxx>
Date: Tue, 11 Oct 2005 06:44:57 -0400
xsl store variable
Hello All ,

I have following xml fragment in my xml ..
<PARAMETERS>
	<PARAMETER>
		<NAME>ROLE</NAME>
		<VALUE>SM</VALUE>
	</PARAMETER>
	<PARAMETER>
		<NAME>ACTION</NAME>
		<VALUE>BLOTTER</VALUE>
	</PARAMETER>
	<PARAMETER>
		<NAME>AMOUNT</NAME>
		<VALUE></VALUE>
	</PARAMETER>
</PARAMETERS>

I want to store the text node of VALUE tag (into a xsl variable) where
PARAMETERS/PARAMETER/NAME/text()='ROLE'

How do I go about doing this ? I tried using this global variable

<xsl:variable name="roleVar">
<xsl:for-each select="/OuterTag/InnerTag/PARAMETERS/PARAMETER">
	<xsl:if test="NAME/text() = 'ROLE'">
	<xsl:value-of select="VALUE"/>
	</xsl:if>
</xsl:for-each>
</xsl:variable>

However when I try to use the value of $roleVar using xsl:value-of tag ,
I do not get any result .

I also tried
<xsl:variable name="roleVar"
select="/OuterTag/InnerTag/PARAMETERS/PARAMETER/NAME[text() =
'ROLE']/../VALUE"/>

But this too returns empty value .I am using XALAN API for transform.
Thanks in advance for your help

Thanks
Manish








Any comments or statements made in this email are not necessarily those
of Fidelity Business
Services India Pvt. Ltd. or any of the Fidelity Investments group
companies. The information
transmitted is intended only for the person or entity to which it is
addressed and may contain
confidential and/or privileged material. If you have received this in
error, please contact the
sender and delete the material from any computer. All e-mails sent from
or to Fidelity
Business Services India Pvt. Ltd. may be subject to our monitoring
procedures.

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.