[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: problems with position()

Subject: Re: problems with position()
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Sat, 15 Dec 2001 04:48:27 +0100
javascript alert position
Can you give the most necessary XML and XSL-code. On which elements are you
matching?

The only thing I can advise you is to shorten your code with attribute value
templates:

<MAP NAME="flechas">
    <AREA SHAPE="rect" COORDS="0,7,9,13"
HREF="javascript:alert('{position() - 1}')"/>
    <AREA SHAPE="rect" COORDS="0,0,9,5" HREF=""/>
</MAP>

And even if you don't want to use AVT in {} you don't need to use
xsl:element and xsl:attribute for the element-name and the other attributes.

Regards,

Joerg

> Hi All!
> I have a problem using the position() function. I want to use it to
generate
> the VALUE attribute of a HTML mark.
> The problem is that the value that the function generates is always 0, but
> if I use it outside the mentioned attribute, the value returned is the
> correct. The code is shown below:
>
>
> <MAP NAME="flechas">
> <xsl:element name="AREA">
>   <xsl:attribute name="SHAPE">rect</xsl:attribute>
>   <xsl:attribute name="COORDS">0,7,9,13</xsl:attribute>
>    <xsl:attribute name="HREF">
> javascript:alert(&#39;<xsl:value-of select="position()-1"/>&#39;);
>    </xsl:attribute>
> </xsl:element>
> <AREA SHAPE="rect" COORDS="0,0,9,5" HREF=""/>
> </MAP>
>
> Thanks in advance!


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.