Page 1 of 1

Error messages from saxon

Posted: Tue Oct 01, 2013 5:19 pm
by sderrick
I know this is not a Oxygen specific question but I get better answers here than anywhere else.

After developing a script for transformation using Oxygen, it goes into production using a website interface, that executes the saxon command line java program. If there is a problem the terminal output is collected for review.

The problem is saxon's output references the place in the xslt file(script) where an error occured but doesn't say where in the xml or xhtml file, the source document, the error occured. So a non-programmer user has no hint as to what they did wrong. The problem is usually a source problem not a script problem.

Is there a command line paramater or some script method that will output to stdout where in the source document the error occured?

thanks,

Scott

Re: Error messages from saxon

Posted: Wed Oct 02, 2013 4:37 pm
by adrian
Hello,

The only idea that comes to mind is to enable Saxon tracing in the command line:
-T
-traceout:filename
The specified filename will contain the trace info in XML format. Note that this file can get huge.
You can even implement your own net.sf.saxon.trace.TraceListener in Java and specify it with -T:classname.

Saxon 9 - Running XSLT from the Command Line

Regards,
Adrian

Re: Error messages from saxon

Posted: Wed Oct 02, 2013 5:20 pm
by sderrick
Adrian,

thanks. I will look into writing my own trace class that only outputs the source line of an error.

I think the ultimate solution is to really lock down the xml with a hardened schema.

thanks

Scott

Re: Error messages from saxon

Posted: Wed Oct 02, 2013 5:41 pm
by adrian
sderrick wrote:I think the ultimate solution is to really lock down the xml with a hardened schema.
That would be the best solution and would catch any problems early on, during editing.

Regards,
Adrian