I'm trying to transform a document to a Result which was created from an XMLEventWriter (StAX API), but getting this exception:

java.lang.IllegalArgumentException: Unknown type of result: class javax.xml.transform.stax.StAXResult
    at net.sf.saxon.lib.SerializerFactory.getReceiver(SerializerFactory.java:239)
    at net.sf.saxon.lib.SerializerFactory.getReceiver(SerializerFactory.java:87)
    at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:34)

Does Saxon-HE not support StAX?? Isn't that an API violation? According to the StAXResult Javadoc:

StAXResult can be used in all cases that accept a Result, e.g. Transformer, Validator which accept Result as input.


Archie L. Cobbs