|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: OT: XSL Question
Hi Rajesh,
Rajesh Kommineni wrote:
> Hello every one,
> I have this xml file
> <Condition>
> <input>TargetType</input>
> <TargetType>Device</TargetType>
> <TargetType>Interface</TargetType>
> <Operator>hello</Operator>
> </Condition>
>
> am trying to write an xsl trasnformation that outputs
> the nodes based on what is present inside input node.
> so here the output should be device and interface.
>
> Is this possible at all? How can I match based on text
> nodes? I tried using variables but didnt work. Can any
> one help me out?
I haven't tested this but something like this should work:
First save the value of <input> in a variable:
<xsl:variable name="input" select="input"/>
Then iterate through all the nodes with this name:
<xsl:for-each select="node()[name() = $input]">
<xsl:value-of select="."/>
</xsl:for-each>
Cheers,
/Eddie
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








