xsl-list
[Top] [All Lists]

Can not store value into xsl:variable

2005-10-11 03:44:57
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.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



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