Thanks Michael.

I have found several bugs related to XMLEventWriter support in various projects (Spring, JDK, ...) that sometimes I wonder if I'm the only person on the Internet using this API. So Saxon is in good company :)

-Archie


On Mon, Dec 23, 2013 at 6:39 AM, Michael Kay <mike@saxonica.com> wrote:

I have committed a patch.

As a workaround, StaxResult appears to work correctly when using the s9api interface rather than JAXP.

Michael Kay
Saxonica


On 22 Dec 2013, at 20:38, Archie Cobbs <archie@dellroad.org> wrote:

Hello,

I'm trying to run a Saxon 9.5.1.3 XSL transform into a StAXResult (with an XMLStreamWriter) and getting this exception:

net.sf.saxon.trans.XPathException: Failed to load net.sf.saxon.lib.StAXHandler
        at net.sf.saxon.trans.Dynam
icLoader.getClass(DynamicLoader.java:123)
        at net.sf.saxon.trans.DynamicLoader.getInstance(DynamicLoader.java:149)
        at net.sf.saxon.lib.SerializerFactory.getReceiver(SerializerFactory.java:241)
        at net.sf.saxon.lib.SerializerFactory.getReceiver(SerializerFactory.java:104)
        at net.sf.saxon.Controller.openResult(Controller.java:2306)
        at net.sf.saxon.Controller.transformDocument(Controller.java:2043)
        at net.sf.saxon.Controller.transform(Controller.java:1903)
        at com.patientexp.pcom.gui.support.XSLStreamResource.transformTo(XSLStreamResource.java:65)
        at com.patientexp.pcom.gui.support.XSLStreamResource.writeInContext(XSLStreamResource.java:42)
        at com.patientexp.pcom.gui.support.WriterResource.writeTo(WriterResource.java:52)
        at org.dellroad.stuff.io.NullModemInputStream$WriterThread.run(NullModemInputStream.java:101)
Caused by: java.lang.ClassNotFoundException: net.sf.saxon.lib.StAXHandler
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:188)
        at net.sf.saxon.trans.DynamicLoader.getClass(DynamicLoader.java:111)
        ... 10 more

According to the 9.4 release notes here's why:

Saxon now recognizes the class StAXResult in interfaces where a Result is expected, specifically in the JAXP interfaces for transformation and validation. The StAXResult object must contain an XMLStreamWriter (Saxon does not yet support XMLEventWriter). Because StAXResult and other StAX classes are dependent on JDK 1.6, this code has been packaged in a separate JAR file, which must be on the classpath if the functionality is required (emphasis mine)

But where can I find this mysterious "separate JAR file"... ?

Thanks,
-Archie

--
Archie L. Cobbs
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help



--
Archie L. Cobbs