[Home] [By Thread] [By Date] [Recent Entries]

  • From: Eddie Robertsson <eddie@a...>
  • To: Rajesh Kommineni <r_kommineni@y...>
  • Date: Fri, 23 Mar 2001 10:44:30 +1100

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


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member