View Single Post
  #1 (permalink)  
Old August 12th, 2004, 01:53 AM
nimesh nimesh is offline
Registered User
Join Date: Aug 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to count total number of nodes in an xml file?


Just wondering if anyone can help me.

I need to to write a simple XSLT script which returns the total number of nodes within a sample XML file.
I tried running the following code, but it returns 30 nodes, instead of 20 for the following sample file.
Any ideas how to amend the code so it returns the correct node count?


<xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:template match="/">
        <xsl:value-of select="count(//node())"/>

<?xml version="1.0" encoding="UTF-8"?>

<FiML version="0-7">
<fiSourcePartyReference href="SOURCE"/>

Reply With Quote