Project

Profile

Help

XdmValue or XdmNode (or Node) as InputStream

Added by Anonymous about 15 years ago

Legacy ID: #6311678 Legacy Poster: David Lee (daldei)

Is there any way to treat an XdmValue, XdmNode, or Node, as a "InputStream". That is, cause text serialization of an XdmNode without having to write it all out first to a temporary buffer or file. Something like XdmValue value = ( some S9API operation ...) InputStream *is = value.asInputStream( ... ) ; I'm looking at the internal PULL classes and they look almost like they could do that but not quite. Any suggestions ? Thanks -David


Replies (1)

RE: XdmValue or XdmNode (or Node) as InputStream - Added by Anonymous about 15 years ago

Legacy ID: #6315892 Legacy Poster: Michael Kay (mhkay)

Saxon's serializer works entirely in push mode, so the only way to read its output in "input stream" mode is either (a) by writing to a temporary buffer or file, or (b) by using two threads. As you say, Saxon will turn a node into a sequence of StAX pull events, so if you can find a Stax pull-mode serializer then you could plug that in. I don't know of one; you could try writing your own.

    (1-1/1)

    Please register to reply