net.sf.saxon.query
public class QueryReader extends Object
Method Summary | |
---|---|
static String | readEncoding(InputStream is)
Read an input stream non-destructively to determine the encoding from the Query Prolog |
static String | readInputStream(InputStream is, String encoding, NameChecker nameChecker)
Read a query from an InputStream. |
static String | readSourceQuery(StreamSource ss, NameChecker nameChecker)
Read a query module given a StreamSource |
Parameters: is the input stream: this must satisfy the precondition is.markSupported() = true.
Returns: the encoding to be used: defaults to UTF-8 if no encoding was specified explicitly in the query prolog
Throws: XPathException if the input stream cannot be read
Parameters: is the input stream encoding the encoding, or null if the encoding is unknown nameChecker the nameChecker to be used for checking characters
Returns: the content of the InputStream as a string
Parameters: ss the supplied StreamSource. This must contain a non-null systemID which defines the base
URI of the query module, and either an InputStream or a Reader containing the query text. In the
case of an InputStream the method attempts to infer the encoding; in the case of a Reader, this has
already been done, and the encoding specified within the query itself is ignored.
The method reads from the InputStream or Reader contained in the StreamSource up to the end
of file unless a fatal error occurs. It does not close the InputStream or Reader; this is the caller's
responsibility.
Returns: the text of the query