[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] How do I count the number of elements in a key ?


Subject: [xsl] How do I count the number of elements in a key ?
From: Michael Fourneau <Michael.Fourneau@xxxxxxx>
Date: Thu, 05 Oct 2006 22:12:46 +0200

Hi,

I have an XML document with the following structure:

<inventory>
 <row>
   <hostmame>AA</hostname>
   <serial>A</serial>
 </row>
 <row>
   <hostmame>BB</hostname>
   <serial>B</serial>
 </row>
 <row>
    ...
 </row>
</inventory>

I defined a key such as:
<xsl:key name="systems" match="/inventory/row/serial" use="."/>

How do I count the number of elements in the key "systems" seeing that several row could have the same "serial" value ? The purpose being to compute the number of unique serial values found in the XML document...

Thanks beforehand,
Michael


Current Thread
Keywords
xml