I have the following code:

File template = new file("fully qualified file path");
Document templateDoc = parser.parse(template);
templateDoc.setDocumentURI(template.toURI().toString());
source =

new DOMSource( templateDoc );
tranFactory = new net.sf.saxon.TransformerFactoryImpl();
tranFactory.setErrorListener(listener);
tranFactory.setURIResolver(new
EditionURIResolver(this.getServletContext()));
aTransformer = tranFactory.newTransformer( source );
aTransformer.setErrorListener(listener);
((net.sf.saxon.Controller)aTransformer).addTraceListener(new
net.sf.saxon.trace.XSLTTraceListener());

which produces the following output in System.err:

 <trace saxon-version="9.1.0.6" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <source node="/" line="0" file="">
  <source node="/parameters/@lastUpdateDt" line="-1" file="">
  </source><!-- /parameters/@lastUpdateDt -->
  <source node="/parameters" line="-1" file="">
  </source><!-- /parameters -->
  <source node="/parameters" line="-1" file="">
  </source><!-- /parameters -->
  <source node="/parameters" line="-1" file="">
  </source><!-- /parameters -->
  <source node="/parameters/doc[1]" line="-1" file="">
   <source node="/parameters/doc[1]/text()[1]" line="-1" file="">
   </source><!-- /parameters/doc[1]/text()[1] -->
  </source><!-- /parameters/doc[1] -->
...
   </trace

 Question: what is missing in the configuration which will allow the trace to contain line number and file information?  There are imports embedded within where the URIResolver has calculated it's location.  The error listener will report the correct file and line numbers when syntax errors occur in the nested stylesheets so I don't think the URIResolver is is the problem yet I don't know what else to look at.

Todd Gochenour