public class QueryResult
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RESULT_NS |
Modifier and Type | Method and Description |
---|---|
static void |
rewriteToDisk(NodeInfo doc,
java.util.Properties outputProperties,
boolean backup,
java.io.PrintStream log)
Write an updated document back to disk, using the original URI from which it was read
|
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 java.lang.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,
javax.xml.transform.Result destination,
java.util.Properties outputProperties)
Serialize a document containing wrapped query results (or any other document, in fact)
as XML.
|
static void |
serializeSequence(SequenceIterator iterator,
Configuration config,
java.io.OutputStream destination,
java.util.Properties outputProps)
Serialize an arbitrary sequence, without any special wrapping.
|
static void |
serializeSequence(SequenceIterator iterator,
Configuration config,
javax.xml.transform.Result result,
java.util.Properties outputProperties)
Serialize a sequence to a given result
|
static void |
serializeSequence(SequenceIterator iterator,
Configuration config,
java.io.Writer writer,
java.util.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
|
public static java.lang.String serialize(NodeInfo nodeInfo) throws XPathException
nodeInfo
- the node to be serialized. This must not be an attribute or namespace node.XPathException
- if a serialization error occurspublic static DocumentInfo wrap(SequenceIterator iterator, Configuration config) throws XPathException
iterator
- The values to be wrappedconfig
- The Saxon configuration used to evaluate the queryXPathException
- if any failure occurspublic static void sendWrappedSequence(SequenceIterator iterator, Receiver destination) throws XPathException
iterator
- the input sequencedestination
- the Receiver to accept the wrapped outputXPathException
- if a failure occurs processing the input iteratorpublic static void serialize(NodeInfo node, javax.xml.transform.Result destination, java.util.Properties outputProperties) throws XPathException
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.XPathException
- If serialization failspublic static void serializeSequence(SequenceIterator iterator, Configuration config, java.io.OutputStream destination, java.util.Properties outputProps) throws XPathException
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.XPathException
- if any failure occurspublic static void serializeSequence(SequenceIterator iterator, Configuration config, java.io.Writer writer, java.util.Properties outputProps) throws XPathException
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.XPathException
- if any failure occurspublic static void serializeSequence(SequenceIterator iterator, Configuration config, javax.xml.transform.Result result, java.util.Properties outputProperties) throws XPathException
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.XPathException
- if any failure occurspublic static void rewriteToDisk(NodeInfo doc, java.util.Properties outputProperties, boolean backup, java.io.PrintStream log) throws XPathException
doc
- an updated document. Must be a document node, or a parentless element, or an
element that has a document node as its parent. The document will be written to the URI
found in the systemId property of this node.outputProperties
- serialization propertiesbackup
- true if the old document at that location is to be copied to a backup filelog
- destination for progress messages; if null, no progress messages are writtenXPathException
- if the document has no known URI, if the URI is not a writable location,
or if a serialization error occurs.Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.