Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] xsl:value-of select after evaluating the variable

From: "Sinha, Shashi" <Shashi.Sinha@------>
To:
Date: 5/3/2004 2:01:00 PM
Thanx a lot !
That works like a charm!

-----Original Message-----
From: Jarno.Elovirta@xxxxxxxxx [mailto:Jarno.Elovirta@xxxxxxxxx]
Sent: Monday, May 03, 2004 11:57 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] xsl:value-of select after evaluating the variable


Hi,

> I have xml document like following...  
> ==========
> 
> <de>German Text</de>
> <en>English Text</en>
> 
> ==========
> I have an variable "$lang" which can be "de" or "en".
> 
> Now I want to extract /de or /en
> depending on variable $lang.
> 
> I am trying something like
>  <xsl:value-of select="node($lang)"/>
> 
> But I cant get the result!!
> Any pointer?

<http://www.w3.org/TR/xpath.html#node-tests>, as you can see, node() doesn't take arguments and the description is "A node test node() is true for any node of any type whatsoever".

Use

  *[name() = $lang]

or 

  *[local-name() = $lang]

if you use namespaces.

Cheers,

Jarno - Seabound: Poisonous Friend (Remix)


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent