Error messages from saxon

Here should go questions about transforming XML with XSLT and FOP.
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Error messages from saxon

Post 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
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Error messages from saxon

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Re: Error messages from saxon

Post 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
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Error messages from saxon

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply