This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: finding position() of an element in a different context
- To: Kevin Burges <xmldude at burieddreams dot com>
- Subject: Re: [xsl] finding position() of an element in a different context
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Thu, 3 May 2001 12:52:41 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <200104251501.RAA15160@mail.informatik.hu-berlin.de><11233017115.20010425205554@burieddreams.com><59694203361.20010426095849@jenitennison.com><6511545790.20010503113518@burieddreams.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
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