How to get line number in XSLT?
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.
精彩评论