xsl-list
[Top] [All Lists]

Re: Setting some variables

2003-01-09 09:35:49
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[(_at_)name],
   'abcdefghijklmnopqrstuvwxyz',
   'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>

descendant::file[(_at_)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



<Prev in Thread] Current Thread [Next in Thread>