Altova Mailing List Archives


Re: Locate node based on xsl variable

From: Martin Honnen <Martin.Honnen@--------.-->
To: NULL
Date: 9/7/2003 1:07:00 PM

Fredrik Nordbakke wrote:

> With the following xml file:
> 
>   <image1>
>     <filename>C:\Image1.jpg</filename>
>   </image1>
>   <image2>
>     <filename>C:\Image2.jpg</filename>
>   </image2>
>   <image3>
>     <filename>C:\Image3.jpg</filename>
>   </image3>  
> 
> How can I use a parameter to specify which image node to select?
> 
> The xsl template has a "imagenode" parameter that is set to
> either "image1", "image2", or "image 3" (defaults to "image1"):
> 
>   <xsl:param name="imagenode">image1</xsl:param>
> 
> I want to do something like:
> 
>   <xsl:value-of select="$imagenode/filename"/>

Something alike
   //*[local-name() = $imagenode]/filename

-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/

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.