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

[no subject]

From: Sue Miller <smiller@xxxxxxxxxxxxxxx>
Date: Tue, 17 Jul 2001 14:55:04 +0100 (BST)
sue miller
Hi,
I'm trying to do a count of how many times field[@column='3'] has the same
value within my XML tree. e.g. How many times does field[@column='3']
have the value A. I need to do something that will output "1 of 2
results found" or, to start of with, something that will output "2 results
where found with this value".

XML:

<?xml version="1.0" encoding="UTF-8"?>
<search>
  <errors/>
  <results>
    <record>
      <field column="3">A</field>
    </record>
    <record>
      <field column="3">A</field>
    </record>
    <record>
      <field column="3">B</field>
    </record>
  <results>
</search>


The following won't work because you've got a boolean not a NodeList in
count but gives an idea of what i want to do.....

XSL:

<xsl:for-each select="/search/results/record">
   <xsl:value-of select="field[@column='3']" />
   <xsl:value-of select="count(//search/results/record/field[@column='3']=field[@column='3'])"/>
   &#160;results found.
</xsl:for-each select>

Any ideas?
Thanks,
Sue






 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.