Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting elements

Status
Not open for further replies.

stasJohn

Programmer
May 6, 2004
155
US
XML newbie... watch out.

xml file
----------------------------
<node1>
<node2>text1</node2>
</node1>
<node1>
<node2>text1</node2>
</node1>
<node1>
<node2>text2</node2>
</node1>

in xsl, how would I create the output?

text1 (#)
text2 (#)

# - being the count that text appears.


basically, I need to figure out how to count the data and display the count.

thanks in advance.
 
Code:
count(//node2[.='text1'])
count(//node2[.='text2'])
Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top