|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE:
> Dear friends, > > I want to count the number of elements and nodes in a xml > with an xsl. can u say a way6 to do it. > > <A> > <A1> > <A12> > <A12> > <A12> > </A1> > <A2> > <A12> > <A12> > </A2> > .... > </A> > > i should get a sum in this case of 8 ie sum of nodes and > childs .. how to get this done . <xsl:template match="/"> <xsl:value-of select="count(//*)"/> </xsl:template> ...will count all of the elements (not text or whitespace nodes) Ps. your xml isn't well formed. If there should be 8 elements, then <A12> should be <A12/>. cheers andrew XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








