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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With