Page 1 of 1

Debug transform errors from XSLT dynamically created in XQuery

Posted: Mon Dec 10, 2018 2:31 pm
by bernardusgui
I am using Oxygen connected to eXist-db. Within eXist I have a module which does a large dynamically-constructed XSLT transformation of an XML document, using

Code: Select all

transform:transform()
. I am now trying to debug errors that are coming through from the transformer, but I am only getting superficial details like this:
exerr:ERROR Unable to set up transformer: Stylesheet compilation failed: 9 errors reported [at line 612, column 12]
In function: document-view:doc-view-xslt(xs:string) [25:11:/db/apps/deheresi/modules/document-view.xql]
The 'more details' link in Oxygen gives no indication of useful errors for debugging
Caused by: org.exist.xquery.XPathException: exerr:ERROR exerr:ERROR Unable to set up transformer: Stylesheet compilation failed: 9 errors reported [at line 612, column 12]
In function:
document-view:doc-view-xslt(xs:string) [25:11:/db/apps/deheresi/modules/document-view.xql] [at line 612, column 12]
at org.exist.xmldb.RemoteXPathQueryService.throwException(RemoteXPathQueryService.java:169)
... 14 more
Is there another place I can find the actual transformation error details? Is there a methodology in Oxygen for debugging XSLT written inside XQuery?

Thanks very much

Re: Debug transform errors from XSLT dynamically created in XQuery

Posted: Mon Dec 10, 2018 6:16 pm
by adrian
Hi,

Note that Oxygen provides separate debugging for XQuery and XSLT with Saxon, but not for eXist-db. Debugging an XSLT transformation run from within an XQuery transformation is a situation that Oxygen does not account for, not even for Saxon. You cannot start debugging an XQuery transformation and step into an XSLT transformation and switch to debugging XSLT.

What you see right now is the result of the XQuery transformation with eXist-db, so transform:transform(). If eXist-db doesn't provide any finer details for the inner XSLT transformation, there's very little that can be done. The "More details" hyperlink in Oxygen provides a detailed Java stack trace for the error, but won't help with detailed XQuery/XSLT errors.
Not sure if it exists, but I would look into enabling verbose logging for the XSLT transformation (transform:transform()) within eXist-db.

If you want to debug the XSLT transformation with Oxygen, dump/save the dynamically-constructed XSLT transformation into a static one and try to debug that (as XSLT) with Saxon 9.

Regards,
Adrian