Subject: RE: [xsl] Number of nodes in a document. From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Tue, 23 Jul 2002 08:39:44 +0100 |
I had some difficulty working out how you calculate 3 as the number of nodes in this document: I counted 41. I assume you want the number of <vector> elements, or the number of grandchildren of the root node, which you can obtain as count(/*/*). Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Satyanarayana Kakarlamudi > Sent: 22 July 2002 21:46 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Number of nodes in a document. > > > I am trying to translate am XML document into a specific > format(.vec format). Is there any way that we can count the > total number of nodes in a XML document. For example if I > have a XML document like this: <vectorslist> <vector count = > "1"> <condition> > <parameter mode="in"> input_voltage </parameter> > <value> 0.0 </value> > </condition> > <condition> > <parameter mode="out"> output_value </parameter> > <value> 0 </value> > </condition> > </vector> > <vector count = "2"> > <condition> > <parameter mode="in"> input_voltage </parameter> > <value> 0.5 </value> > </condition> > <condition> > <parameter mode="out"> output_value </parameter> > <value> 0 </value> > </condition> > </vector> > <vector count = "3"> > <condition> > <parameter mode="in"> input_voltage </parameter> > <value> 1.0 </value> > </condition> > <condition> > <parameter mode="out"> output_value </parameter> > <value> 0 </value> > </condition> > </vector> > </vectorslist> > > Here the total nodes are 3.Can i calculate this number from > XSLT. hope i didn't confuse you guys. Thanks in advance. --Murthy. > > -- > ************************************************************** > *************** > Murthy Kakarlamudi ph: 785-864-7756(off) > Student System Administrator. > 785-550-1914(cell) > > To this day, many C programmers believe that 'strong typing' > just means pounding extra hard on the keyboard........... > ************************************************************** > **************** > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Number of nodes in a document, Satyanarayana Kakarl | Thread | Re: [xsl] Number of nodes in a docu, KUMAR NINGASHETTY |
[xsl] content of matched node ?, Jochen Metzger | Date | [xsl] content of matched node ?, Jochen Metzger |
Month |