Re: [xsl] Setting some variables

Subject: Re: [xsl] Setting some variables
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Thu, 09 Jan 2003 18:35:49 +0200
David Totten wrote:
I have the following xml snippet

<object type="figure" position="fixed" id="fu1">
<objectsource>
<file name="ejb1821.fu1.gif" type="gif"/></objectsource>
</object>


I am trying to do something like this..



<xsl:template match="object"> <xsl:variable name="filename" select="translate(descendant::file[@name], 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>

descendant::file[@name] selects 'file' elements descendant of the context node, which have 'name' attribute. If you want to select attribute itself, it should be descendant::file/@name.


<xsl:variable name="filename" select="translate(descendant::file/@name,
    'abcdefghijklmnopqrstuvwxyz',
    'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>

--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread