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

Status
Not open for further replies.

divinyl

IS-IT--Management
Nov 2, 2001
163
GB
Hi all,

I am having problems getting any results using the count() function. With an xml file like this:

<TM Data>
<Project>
<Issues>
<Issue>Test1</Issue
<Issue>Test2</Issue
<Issues>
<Project>
.....

i want to count how many projects there are, so in my xslt file i do this:

<xsl: value-of select="count(//Project)" />

That should return as many projects listed in the xml file shouldn't it?? Yet i get nothing back..

Help!

Divinyl
 
Is your XML actually malformed as shown above, or is it just this site mangling it?
 
You must have a syntax error, or some other error, because what you have posted is correct, except:

"xsl: value-of select="count(//Project)" />

should be

<xsl:value-of select="count(//Project)" />

(no space after "xsl:")

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top