This interface allows an 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 base URI, and/or a character stream.
The exact definitions of a byte stream and a character stream are binding dependent.
The application is expected to provide objects that implement this
interface whenever such objects are needed. The application can either
provide its own objects that implement this interface, or it can use the
generic factory method DOMImplementationLS.createLSInput()
to create objects that implement this interface.
The LSParser
will use the LSInput
object to
determine how to read data. The LSParser
will look at the
different inputs specified in the LSInput
in the following
order to know which one to read from, the first one that is not null and
not an empty string will be used:
LSInput.characterStream
LSInput.byteStream
LSInput.stringData
LSInput.systemId
LSInput.publicId
If all inputs are null, the LSParser
will report a
DOMError
with its DOMError.type
set to
"no-input-specified"
and its DOMError.severity
set to DOMError.SEVERITY_FATAL_ERROR
.
LSInput
objects belong to the application. The DOM
implementation will never modify them (though it may make copies and
modify the copies, if necessary).
See also the Document Object Model (DOM) Level 3 Load and Save Specification.
Method from org.w3c.dom.ls.LSInput Summary: |
---|
getBaseURI, getByteStream, getCertifiedText, getCharacterStream, getEncoding, getPublicId, getStringData, getSystemId, setBaseURI, setByteStream, setCertifiedText, setCharacterStream, setEncoding, setPublicId, setStringData, setSystemId |
Method from org.w3c.dom.ls.LSInput Detail: |
---|
systemId to an absolute URI.
If, when used, the base URI is itself a relative URI, an empty string, or null, the behavior is implementation dependent. |
If the application knows the character encoding of the byte stream, it should set the encoding attribute. Setting the encoding in this way will override any encoding specified in an XML declaration in the data. |
|
|
This attribute has no effect when the application provides a character stream or string data. For other sources of input, an encoding specified by means of this attribute will override any encoding specified in the XML declaration or the Text declaration, or an encoding obtained from a higher level protocol, such as HTTP [IETF RFC 2616]. |
|
stringData . If an XML declaration is present, the value
of the encoding attribute will be ignored. |
If the application knows the character encoding of the object pointed to by the system identifier, it can set the encoding using the encoding attribute.
If the specified system ID is a relative URI reference (see section 5 in [IETF RFC 2396]), the DOM implementation will attempt to resolve the relative URI with the baseURI as the base, if that fails, the behavior is
implementation dependent. |
systemId to an absolute URI.
If, when used, the base URI is itself a relative URI, an empty string, or null, the behavior is implementation dependent. |
If the application knows the character encoding of the byte stream, it should set the encoding attribute. Setting the encoding in this way will override any encoding specified in an XML declaration in the data. |
|
|
This attribute has no effect when the application provides a character stream or string data. For other sources of input, an encoding specified by means of this attribute will override any encoding specified in the XML declaration or the Text declaration, or an encoding obtained from a higher level protocol, such as HTTP [IETF RFC 2616]. |
|
stringData . If an XML declaration is present, the value
of the encoding attribute will be ignored. |
If the application knows the character encoding of the object pointed to by the system identifier, it can set the encoding using the encoding attribute.
If the specified system ID is a relative URI reference (see section 5 in [IETF RFC 2396]), the DOM implementation will attempt to resolve the relative URI with the baseURI as the base, if that fails, the behavior is
implementation dependent. |