Re: [xsl] insert an attribute value through xsl

Subject: Re: [xsl] insert an attribute value through xsl
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 31 Jan 2002 15:05:25 +0100
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@xxxxxxxxx
www.virbus.de


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



Current Thread