OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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="."/>