Subject: [xsl] Count all instances of a named element in a tree From: "W Charlton" <XSLList@xxxxxxxxxx> Date: Fri, 29 May 2009 16:48:39 +0100 |
Does anyone know an elegant solution to counting all elements in an XML fragment where the elements to be counted are nested in a tree? An example of the XML is below: <xmltree> <countmein>Node1</countmein> <nodes> <node> <countmein>Node2</countmein> <level>1</level> <nodes> <node> <countmein>Node3</countmein> <level>2</level> <nodes> <node> <countmein>Node4</countmein> <level>3</level> <nodes/> </node> </nodes> </node> <node> <countmein>Node5</countmein> <level>2</level> <nodes/> </node> <node> <countmein>Node6</countmein> <level>2</level> <nodes/> </node> </nodes> </node> <node> <countmein>Node7</countmein> <level>1</level> <nodes> <node> <countmein>Node8</countmein> <level>2</level> <nodes/> </node> </nodes> </node> </nodes> </xmltree> The count in this case would be 8. I am using XSLT 1.0 Thanks in advance. William Charlton The yMonda team yMonda Limited w: www.ymonda.net
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re:Re: [xsl] Footnote within , Konstanty Pilecki | Thread | Re: [xsl] Count all instances of a , G. Ken Holman |
RE: [xsl] Unicode character blocks , G. Ken Holman | Date | Re: [xsl] Count all instances of a , G. Ken Holman |
Month |