Package net.sf.saxon.lib
Class StandardUnparsedTextResolver
java.lang.Object
net.sf.saxon.lib.StandardUnparsedTextResolver
- All Implemented Interfaces:
UnparsedTextURIResolver
Default implementation of the UnparsedTextURIResolver, used if no other implementation
is nominated to the Configuration. This implementation
handles anything that the java URL class will handle, plus the
classpath
URI scheme defined in the Spring framework, and the data URI scheme defined in
RFC 2397.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReaderdetectEncoding(InputStream inputStream, String encoding, Configuration config, boolean debug) static ReadergetReaderFromSAXSource(SAXSource source, String encoding, Configuration config, boolean debug) static ReadergetReaderFromStreamSource(StreamSource source, String encoding, Configuration config, boolean debug, boolean fallback) resolve(URI absoluteURI, String encoding, Configuration config, boolean fallback) Resolve the URI passed to the XSLT unparsed-text() function, after resolving against the base URI.voidsetDebugging(boolean debug) Set debugging on or off.
-
Constructor Details
-
StandardUnparsedTextResolver
public StandardUnparsedTextResolver()
-
-
Method Details
-
setDebugging
public void setDebugging(boolean debug) Set debugging on or off. In debugging mode, information is written to System.err to trace the process of deducing an encoding.- Parameters:
debug- set to true to enable debugging
-
resolve
public Reader resolve(URI absoluteURI, String encoding, Configuration config, boolean fallback) throws XPathException Resolve the URI passed to the XSLT unparsed-text() function, after resolving against the base URI.- Specified by:
resolvein interfaceUnparsedTextURIResolver- Parameters:
absoluteURI- the absolute URI obtained by resolving the supplied URI against the base URIencoding- the encoding requested in the call of unparsed-text(), if any. Otherwise null.config- The configuration. Provided in case the URI resolver needs it.fallback- If true, replace non-permitted characters with U+FFFD.- Returns:
- a Reader, which Saxon will use to read the unparsed text. After the text has been read, the close() method of the Reader will be called.
- Throws:
XPathException- if any failure occurs- Since:
- 8.9
-
getReaderFromSAXSource
public static Reader getReaderFromSAXSource(SAXSource source, String encoding, Configuration config, boolean debug) throws XPathException - Throws:
XPathException
-
detectEncoding
public static Reader detectEncoding(InputStream inputStream, String encoding, Configuration config, boolean debug) throws XPathException - Throws:
XPathException
-
getReaderFromStreamSource
public static Reader getReaderFromStreamSource(StreamSource source, String encoding, Configuration config, boolean debug, boolean fallback) throws XPathException - Throws:
XPathException
-