[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Can not store value into xsl:variable


Subject: RE: [xsl] Can not store value into xsl:variable
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Tue, 11 Oct 2005 13:53:32 +0300

Hi,

> 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'

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

If there is more than one PARAMETER with NAME "ROLE", the $roleVar will be
bound to VALUE/text() all of them.

Cheers,

Jarno

--
UnterART: Kill Your Heart


Current Thread
Keywords