A single input source for an XML entity
A single input source for an XML entity.This class allows a SAX application to encapsulate information about an input source in a single object, which may include a public identifier or a system identifier
There are two places that the application will deliver this input source to the parser: as the argument to the Parser.parse method, or as the return value of the EntityResolver.resolveEntity 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; if not, the parser will use a byte stream, if available; if neither a character stream nor a byte stream is available, the parser will attempt to open a URI 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).
Applications may use setPublicId to include a public identifier as well
If the system identifier is a URL, it must be full resolved.
If the system identifier is a URL, it must be full resolved. InputSource( const char* const systemId, const char* const publicId )
setSystemId
setByteStream
setCharacterStream
The SAX parser will ignore this if there is also a character stream specified, but it will use a byte stream in preference to opening a URI connection itself.
If the system ID is a URL, it will be fully resolved. const XMLCh* getPublicId() const
const XMLCh* getSystemId() const
This is usually not set, allowing the encoding to be sensed in the usual XML way. However, in some cases, the encoding in the file is known to be incorrect because of intermediate transcoding, for instance encapsulation within a MIME document.
The public identifier is always optional: if the application
writer includes one, it will be provided as part of the
location information.
The system identifier is optional if there is a byte stream
or a character stream, but it is still useful to provide one,
since the application can use it to resolve relative URIs
and can include it in error messages and warnings (the parser
will attempt to open a connection to the URI only if
there is no byte stream or character stream specified). If the system ID is a URL, it must be fully resolved. void setPublicId(const XMLCh* const publicId)
getPublicId
getPublicId void setSystemId(const XMLCh* const systemId)
getSystemId
getSystemId
alphabetic index hierarchy of classes
XML Parser for C++ 2.0 Copyright © IBM Corp, 1999 Center for Java Technology 10275 N. De Anza Blvd. Cupertino CA 95014 USA Email: xml4c@us.ibm.com |
|