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]
Other format: [Raw text]

Re: insert an attribute value through xsl


> 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


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