Package com.icl.saxon
Class ExtendedInputSource
java.lang.Object
org.xml.sax.InputSource
com.icl.saxon.ExtendedInputSource
This class allows a SAXON application to encapsulate information about an input source in a single object, which may include a public identifier, a system identifier, a byte stream (possibly with a specified encoding), a character stream, or a file.
Most of the functionality is inherited directly from the SAX InputSource class; the additional functionality offered by ExtendedInputSource is to allow the input source to be specified as a File object.
- Author:
- Michael H. Kay
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorExtendedInputSource
(File file) Create a new input source from a File.ExtendedInputSource
(InputStream stream) Create a new input source from a byte streamExtendedInputSource
(Reader reader) Create a new input source from a character streamExtendedInputSource
(String systemId) Create a new input source from a System IDCreate an ExtendedInputSource from an existing InputSource -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Create a URL that refers to a given Fileint
Get the estimated length of the file (advisory only; -1 if not known)void
setEstimatedLength
(int length) Set the estimated length of the file (advisory only)void
Specify that input is to come from a given File.Methods inherited from class org.xml.sax.InputSource
getByteStream, getCharacterStream, getEncoding, getPublicId, getSystemId, isEmpty, setByteStream, setCharacterStream, setEncoding, setPublicId, setSystemId
-
Constructor Details
-
ExtendedInputSource
public ExtendedInputSource()Default constructor -
ExtendedInputSource
Create a new input source from a System ID -
ExtendedInputSource
Create a new input source from a character stream -
ExtendedInputSource
Create a new input source from a byte stream -
ExtendedInputSource
Create a new input source from a File. Note that the directory in which the file occurs will be used as the base for resolving any system identifiers encountered within the XML documentExample of use:
parser.parse(new ExtendedInputSource(new File("test.xml")))- Parameters:
file
- A File object identifying the XML input file
-
ExtendedInputSource
Create an ExtendedInputSource from an existing InputSource
-
-
Method Details
-
setFile
Specify that input is to come from a given File. -
setEstimatedLength
public void setEstimatedLength(int length) Set the estimated length of the file (advisory only) -
getEstimatedLength
public int getEstimatedLength()Get the estimated length of the file (advisory only; -1 if not known) -
createURL
Create a URL that refers to a given File
-