Added support for Saxon 9.7 to Calabash

Hi,

I have a project depending on both Saxon and Calabash.  I have upgraded it to
Saxon 9.7, but I am blocked by the lack of support of Calabash for Saxon 9.7.
So I created a new branch and adapted Calabash codebase to Saxon 9.7.  You can
find the changes at https://github.com/fgeorges/xmlcalabash1/commits/saxon97.

The test suite reports: "717 tests completed, 9 failed"  Out of these 9, 5 are
because I use HE and they require EE (because it is about Schematron validation,
I doubt upgrading Saxon would break them, but I can't test them):

- Optional.testValidsch001
- Optional.testValidsch002
- Optional.testValidsch003
- Optional.testValidsch004
- Optional.testValidsch005

2 tests are failing because the default collection is not set:

- Optional.testXquery006
- Optional.testXslt2003

And finally, 2 tests are failing because the base URI is not set correctly on a
secondary document created by xsl:result-document in a pipeline:

- Required.testXslt006
- Optional.testXslt2002

This last error is due to Saxon setting the wrong system ID in that case.  Given
what's in ElementCreator.java at line 350, it looks like it sets the document
node system ID to the one of its root element (inheriting it from the stylesheet
source in the pipeline file), instead of using the one from the `href` attribute
on xsl:result-document.  Not sure this is because of Saxon or of a
change in 9.7.
The following is the stack trace from the point where the wrong system
ID is set:

at net.sf.saxon.event.ComplexContentOutputter.setSystemId(ComplexContentOutputter.java:134)
at net.sf.saxon.event.ProxyReceiver.setSystemId(ProxyReceiver.java:40)
at net.sf.saxon.event.ComplexContentOutputter.setSystemId(ComplexContentOutputter.java:134)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:350)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:311)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)
at net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:470)
at net.sf.saxon.Configuration.processResultDocument(Configuration.java:2132)
at net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:382)

So it is definitely not 100% complete, but except for these 2 corner cases (WRT
the default collection and secondary outputs in XSLT), it seems to be working
fine.  It is maybe time to add beta support for 9.7, released 1 year ago and to
which most projects relying on Saxon seem to have been moved to, even if only
99% of the test suite pass.  Having this support in beta status for one or a few
versions of Calabash would help gather feedback as well.

Not sure whether it is possible to create a pull request for a new branch, but
happy to investigate if you want me to.

Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

Received on Saturday, 29 October 2016 18:00:47 UTC