[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] finding position() of an element in a different context


Subject: Re: [xsl] finding position() of an element in a different context
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 3 May 2001 12:52:41 +0100

Hi Kevin,

> This sounds promising, so I tried it. At first it again did not work.
> While testing I noticed that I was setting variables as follows:
>
>    <xsl:variable name="formtypeID"><xsl:value-of select="@id"/></xsl:variable>
>
> When I change this to:
>
>    <xsl:variable name="formtypeID" select="@id"/>
>
> Everything started working fine. Is the first returning the text
> value of @id, while the second is actually returning the attribute
> node itself or something??

Yes, that's basically right.  Actually the first returns a result tree
fragment, made up of a root node with a single child text node that
has a string value that is the value of id attribute.  If you're only
ever using the string value of $formtypeID then it shouldn't matter
which you use.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



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



Current Thread