RE: [xsl] Count line number

Subject: RE: [xsl] Count line number
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 22 Oct 2005 10:02:37 +0100
string-length(/) - string-length(translate(/,'&#xa',''))

Note however this only counts the newlines appearing in text nodes. It won't
count any that appear, for example, between the attributes in a start tag,
because those aren't visible to XSLT. It also doesn't count newlines within
comments or processing instructions, which you could include if you were
minded to.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Rajesh Kumar [mailto:rajesh-kumar@xxxxxxxxx] 
> Sent: 22 October 2005 02:22
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Count line number
> 
> Hi group, 
> 
> I want to count total number of line of xml file through xsl. 
> Could to send me code
> 
> -------
> Thanks & Regards,
> Rajesh Kumar
> 
> 
> -- 
> India.com free e-mail - www.india.com. 
> Check out our value-added Premium features, such as an extra 
> 20MB for mail storage, POP3, e-mail forwarding, and ads-free 
> mailboxes!

Current Thread