Project

Profile

Help

Is the put function supported in HE or is there some other way for XQuery in HE to create separate result documents?

Added by Martin Honnen over 4 years ago

The documentation on the put function http://saxonica.com/html/documentation/functions/fn/put.html is saying "Available in all Saxon editions" but when I try to use it with Saxon 9.9 HE I either get the function is not found when not explicitly requesting XQuery Update or I get an exception "java.lang.UnsupportedOperationException: XQuery Update is not supported in this Saxon Configuration" when I try to enable it.

Should put be usable with Saxon HE? How would one enable it?

If it is not available, is there some other way to write an XQuery creating a sequence of document nodes and having them serialized separately to different files?


Replies (2)

RE: Is the put function supported in HE or is there some other way for XQuery in HE to create separate result documents? - Added by Michael Kay over 4 years ago

I think the documentation is wrong: fn:put() is part of XQuery Update, and therefore not available in HE.

Since the EXPath file:write function also requires PE, I think the only possible approaches are (a) writing an integrated extension function, or (b) returning the document nodes to the calling application (either before or after serialization using fn:serialize) to be written to filestore using host language capabilities.

RE: Is the put function supported in HE or is there some other way for XQuery in HE to create separate result documents? - Added by Martin Honnen over 4 years ago

Is using the XQueryEvaluator as an iterator http://saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/XQueryEvaluator.html#iterator-- the right approach to process the document nodes returned by such a query?

On the XSLT side of the Saxon 9.9 API there are various newSerializer overloads like http://saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Xslt30Transformer.html#newSerializer-- on Xslt30Transformer to create a Serializer with the serialization/output properties from the XSLT, is there some similar way on the XQuery API to create a Serializer using/knowing any query defined (e.g. declare option output:...) options to use them when serializing a document or node returned by the XQueryEvaluator?

    (1-2/2)

    Please register to reply