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

how getting a list of occurences

Subject: how getting a list of occurences
From: Elena Pierazzo <pierazzo@xxxxxxxxxxxxx>
Date: Fri, 19 Sep 2003 09:35:47 +0200
xsl number divide
Hi all,
I firstly apologize for my beginner's question.

I've an XML document like this
<root>
   ....
      ...
         <p>
            <persName>pippo</persName>
            ...
            <persName>pluto</persName>
            ...
           <persName>pippo</persName>
            ...
            <persName>ciccio</persName>
            ....
          </p>
      ....
   ....
</root>

I would like to get as an output a list of all the occurences of the <persName> element and the number of time that the form occours, like that:

pippo 2
pluto 1
ciccio 1

I've tryed to do this using <xsl:number> as follow:

<xsl:template match="p">
<xsl:for-each select="persName">
<br />
<xsl:value-of select="." />:
<xsl:number count="*" value="???">
</xsl:number>
</xsl:for-each>
</xsl:template>

but I'm unable to complete the expression required by the value attribute.
Thank you in advance

Elena Pierazzo



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.