This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]