This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: insert an attribute value through xsl
- From: Joerg Heinicke <joerg dot heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 31 Jan 2002 15:05:25 +0100
- Subject: Re: [xsl] insert an attribute value through xsl
- References: <F214NY30kkZIhTrBoe200007acb@hotmail.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> Secondly, is there a way that it allows me to insert the position()
> within the HTML element such as: -
> <xsl:template match="Family">
> <a name="<xsl:value-of select="position()"/>>Smith</a>
> ...
>
> that gives something like that at the end: - <a name="2">Smith</a>
>
> i know such approach is not permitted but is there are another way to
> produce such result?
>
> thanks for your time
>
> Regards
> Kit
Of course there is:
Either
<a>
<xsl:attribute name="name">
<xsl:value-of select="position()"/>
</xsl:attribute>
Smith
</a>
or shorter with attribute value template
<a name="{position()}">Smith</a>
Is only a number a valid value? Isn't it better to use for example fam2:
<a name="fam{position()}">Smith</a>
Regards,
Joerg
--
System Development
VIRBUS AG
Fon +49(0)341-979-7411
Fax +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list