> On Nov 26, 2017, at 2:17 PM, Matthew Broadhead > <matthew.broadh...@nbmlaw.co.uk> wrote: > > So to run the tests I could reverse the changes of the commit and then update > to javax.xml.* and run tests? > > I am still struggling a bit to understand exactly what is happening wrt > VariableStack and how I can change over to XPathVariableResolver. And also > don't see a way to replace XBoolean, XNumber, XString etc... > > I will keep trying things. Can I come back to you with specific queries?
I did experiment with a pure JAXP based solution - there’s a patch <https://bz.apache.org/bugzilla/attachment.cgi?id=26445&action=diff> attached to #27717 that might be a place to start from. You may need to roll back a bit to get it to apply. From what I remember, the performance problem stemmed from the evaluation of XPath inside the loop, with both Xalan and JAXP (which used a shaded version of Xalan) reinitializing the DTM each time leading to N * N scaling. The fix was to use Xalan’s API directly to convert the document’s DOM to a DTM once and then apply the XPath against the DTM each time leading to 1 * N scaling. The downside is that there was a direct dependency on Xalan 2.7.1. I think we tried using 2.7.2 but there was some other problem with that I can’t find at the moment. Given the stability of Xalan/Xerces, what’s causing the conflict with FOP?