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

Re: finding postion from value of attribute

Subject: Re: finding postion from value of attribute
From: Mukul Gandhi <mukulgw3@xxxxxxxxx>
Date: Tue, 21 Oct 2003 05:30:08 -0700 (PDT)
postion xsl
Please try the following Template definition --

<xsl:template match="/question">
  <xsl:for-each select="answer">
    <xsl:if test="@eval">
      Position of node (having eval attribute) --
<xsl:value-of select="position()" />
    </xsl:if>  
  </xsl:for-each>
</xsl:template>

I hope the answer is useful..

Regards,
Mukul

--- David Elsmore <delsmore@xxxxxxxxxxxxx> wrote:
> Hi,
> 
> I have the following xml input and would like to
> identify the position 
> of the <answer/> element with the 'correct'
> attribute within the 
> <question/> context and output it as as an integer (
> in this case 3).
> 
> <question>
>     <answer/>
>     <answer/>
>     <answer eval="correct">
>     <answer/>
> </question>
> 
> Any suggestions much appreciated
> 
> David Elsmore
> 
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

 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.