Class InputSource
A single input source for an XML entity.
Inheritance
Assembly: Lucene.Net.Benchmark.dll
Syntax
public class InputSource : object
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. Seehttp://www.saxproject.org for further information.
This class allows a SAX 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), and/or a character stream.
There are two places that the application can deliver an input source to the parser: as the argument to the IParser.Parse(InputSource) method, or as the return value of the ResolveEntity(String, String) method.
The SAX parser will use the InputSource object to determine how to read XML input. If there is a character stream available, the parser will read that stream directly, disregarding any text encoding declaration found in that stream. If there is no character stream, but there is a byte stream, the parser will use that byte stream, using the encoding specified in the InputSource or else (if no encoding is specified) autodetecting the character encoding using an algorithm such as the one in the XML specification. If neither a character stream nor a byte stream is available, the parser will attempt to open a URL connection to the resource identified by the system identifier.
An InputSource object belongs to the application: the SAX parser shall never modify it in any way (it may modify a copy if necessary). However, standard processing of both byte and character streams is to close them on as part of end-of-parse cleanup, so applications should not attempt to re-use such streams after they have been handed to a parser.
Constructors
Name | Description |
---|---|
InputSource() | Zero-argument default constructor. |
InputSource(Stream) | Create a new input source with a byte stream. |
InputSource(String) | Create a new input source with a system identifier. |
InputSource(TextReader) | Create a new input source with a character stream. |
Properties
Name | Description |
---|---|
Encoding | Gets or Sets the character encoding. |
PublicId | Gets or Sets the public identifier for this input source. |
Stream | Gets or Sets the byte stream for this input source. |
SystemId | Gets or Sets the system identifier for this input source. |
TextReader | Gets or Sets the character stream for this input source. |