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

Re: counting problem

Subject: Re: counting problem
From: Bryan Schnabel <bryan.schnabel@xxxxxxxxxxxxx>
Date: Thu, 13 Jun 2002 13:02:21 -0700 (PDT)
counting in r
> So if I have something like this:
> <S>
>   <R>
>     <A/> *
>     <A/> *
>     <S>
>       <R><A/> * </R>
>       <R><A/></R>
>     </S>
>   </R>
>   <R>
>     <A>
>   <R>
> </S>
> 
> It should count 3 A's, the ones I marked.
> 
> Is there a way to do that in xpath alone?

When you say XPath alone, do you mean without
recursion?

Are you looking for something like this:


<xsl:template match="/">
 <xsl:text>My whole document has </xsl:text>
 <xsl:value-of select="count(//S/R[1]/A)" />
 <xsl:text> A's that are the child of an S's first
R</xsl:text>
</xsl:template>

If so, just beware of the '//'


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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


Current Thread
  • counting problem
    • KRokicki - Thu, 13 Jun 2002 12:29:43 -0400 (EDT)
      • Bryan Schnabel - Thu, 13 Jun 2002 16:11:34 -0400 (EDT) <=

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.