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

Re: Re: your mail

Subject: Re: Re: your mail
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 17 Jul 2001 18:10:45 +0100
sue miller ole miss
> Is there a  way of doing this without already knowing the string in the
> element?

> i.e.
<xsl:value of select="count(//field[@column='3' and . = field[@column='3'
/>

yes but the current node inside the [] is why the . works, so the field
would refer to a field child of a field, probably you want to know the
value of a later field something like

.=following::field[@column..

on the other hand hand you might want to use keys for this ('cause it's
simpler and faster)

<xs:key name="x" match="field[@column=3]" use="."/>

so now <xsl:value of select="count(key('x','A'))"/>
tells you how many A's there are.

<xsl:for-each select="//field[@column=3][count(.|key('x',.)[1])=1]">
There are <xsl:value of select="count(key('x',.))"/> fields in column3
  with value <xsl:value-of select="."/>
</xsl:for-each>

will loop through all the distinct examples.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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


Current Thread
  • [no subject]
    • Sue Miller - Tue, 17 Jul 2001 10:00:11 -0400 (EDT)
      • David Carlisle - Tue, 17 Jul 2001 10:09:04 -0400 (EDT)
        • Sue Miller - Tue, 17 Jul 2001 11:19:29 -0400 (EDT)
          • David Carlisle - Tue, 17 Jul 2001 13:16:01 -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.