net.sf.saxon.query
Class QueryResult
java.lang.Object
net.sf.saxon.query.QueryResult
public class QueryResult
extends java.lang.Object
This utility class takes the result sequence produced by a query, and wraps it as
an XML document. The class is never instantiated.
static void | sendWrappedSequence(SequenceIterator iterator, Receiver destination) - Take a sequence supplied in the form of an iterator and generate a wrapped represention of the
items in the sequence, the wrapped representation being a sequence of events sent to a supplied
Receiver, in which each item is wrapped in a containing element that identifies its type
|
static String | serialize(NodeInfo nodeInfo) - Convenience method to serialize a node using default serialization options, placing
the result in a string.
|
static void | serialize(NodeInfo node, Result destination, Properties outputProperties) - Serialize a document containing wrapped query results (or any other document, in fact)
as XML.
|
static void | serialize(NodeInfo node, Result destination, Properties outputProperties, Configuration config) - since 8.9; use
serialize(NodeInfo,Result,Properties) instead.
|
static void | serializeSequence(SequenceIterator iterator, Configuration config, OutputStream destination, Properties outputProps) - Serialize an arbitrary sequence, without any special wrapping.
|
static void | serializeSequence(SequenceIterator iterator, Configuration config, Result result, Properties outputProperties) - Serialize a sequence to a given result
|
static void | serializeSequence(SequenceIterator iterator, Configuration config, Writer writer, Properties outputProps) - Serialize an arbitrary sequence, without any special wrapping.
|
static DocumentInfo | wrap(SequenceIterator iterator, Configuration config) - Take the results of a query (or any other SequenceIterator) and create
an XML document containing copies of all items in the sequence, each item wrapped in a containing
element that identifies its type
|
RESULT_NS
public static String RESULT_NS
sendWrappedSequence
public static void sendWrappedSequence(SequenceIterator iterator,
Receiver destination)
throws XPathException
Take a sequence supplied in the form of an iterator and generate a wrapped represention of the
items in the sequence, the wrapped representation being a sequence of events sent to a supplied
Receiver, in which each item is wrapped in a containing element that identifies its type
iterator
- the input sequencedestination
- the Receiver to accept the wrapped output
serialize
public static String serialize(NodeInfo nodeInfo)
throws XPathException
Convenience method to serialize a node using default serialization options, placing
the result in a string.
nodeInfo
- the node to be serialized. This must not be an attribute or namespace node.
- the serialization of the node
serialize
public static void serialize(NodeInfo node,
Result destination,
Properties outputProperties)
throws XPathException
Serialize a document containing wrapped query results (or any other document, in fact)
as XML.
node
- The document or element to be serializeddestination
- The Result object to contain the serialized formoutputProperties
- Serialization options as defined in JAXP. The requested properties are
not validated.
serialize
public static void serialize(NodeInfo node,
Result destination,
Properties outputProperties,
Configuration config)
throws XPathException
since 8.9; use serialize(NodeInfo,Result,Properties)
instead.
Serialize a document containing wrapped query results (or any other document, in fact)
as XML.
node
- The document or element to be serializeddestination
- The Result object to contain the serialized formoutputProperties
- Serialization options, as defined in JAXP. The requested properties are
not validated.config
- The Configuration. This argument is ignored
serializeSequence
public static void serializeSequence(SequenceIterator iterator,
Configuration config,
OutputStream destination,
Properties outputProps)
throws XPathException
Serialize an arbitrary sequence, without any special wrapping.
iterator
- the sequence to be serializedconfig
- the configuration (gives access to information such as the NamePool)destination
- the output stream to which the output is to be writtenoutputProps
- a set of serialization properties as defined in JAXP. The requested properties are
not validated.
serializeSequence
public static void serializeSequence(SequenceIterator iterator,
Configuration config,
Result result,
Properties outputProperties)
throws XPathException
Serialize a sequence to a given result
iterator
- the sequence to be serializedconfig
- the Saxon Configurationresult
- the destination to receive the outputoutputProperties
- the serialization properties to be used. The requested properties are
not validated.
serializeSequence
public static void serializeSequence(SequenceIterator iterator,
Configuration config,
Writer writer,
Properties outputProps)
throws XPathException
Serialize an arbitrary sequence, without any special wrapping.
iterator
- the sequence to be serializedconfig
- the configuration (gives access to information such as the NamePool)writer
- the writer to which the output is to be writtenoutputProps
- a set of serialization properties as defined in JAXP. The requested properties are
not validated.
wrap
public static DocumentInfo wrap(SequenceIterator iterator,
Configuration config)
throws XPathException
Take the results of a query (or any other SequenceIterator) and create
an XML document containing copies of all items in the sequence, each item wrapped in a containing
element that identifies its type
iterator
- The values to be wrappedconfig
- The Saxon configuration used to evaluate the query
- the document containing the wrapped results