title: How can I identify line numbers in XSLT input or from XPath?
body: <p>I am processing XML files using an XSLT stylsheet and wish to report the input line number when a given template is triggered. I can use a DOM (e.g. XOM in Java)  which supports a SAX parser so maybe can use a Locator. </p>
  
  <p>Alternatively the XSLT generates an Xpath which could be applied to the original document and so, at least for a human, can lead to the particular line.</p>
  
  <p>(The actual application is to detect error conditions in the XML, which are searched for using XSLT)</p>