Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get line number in XSLT?

Tags:

xml

xslt

xslt-2.0

Is it possible to get the line number when we apply XSLT to an XML? I need to know the line number when there is a particular template match found in the XML.

Is it possible to retrieve the line number?

like image 778
senthil kumar Avatar asked Oct 03 '11 13:10

senthil kumar


1 Answers

If you mean the line number of the node in the source document, Saxon provides this using an extension function saxon:line-number(), provided the source document is supplied via an interface (e.g. a SAX parser) that reports line numbers. There's no standard XSLT mechanism for this.

like image 74
Michael Kay Avatar answered Nov 06 '22 11:11

Michael Kay