xmldom::DomLSInput Class Reference

#include <DomLSInput.h>

List of all members.


Detailed Description

This interface represents an input source for data.

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 DomLSParser will use the DomLSInput object to determine how to read data. The DomLSParser will look at the different inputs specified in the DomLSInput 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:

  1. DomLSInput::getCharacterStream()

  1. DomLSInput::getByteStream()

  1. DomLSInput::getStringData()

  1. DomLSInput::getSystemId()

  1. DomLSInput::getPublicId()

If all inputs are null, the DomLSParser will report a DomError with its DomError::getType() set to "no-input-specified" and its DomError::getSeverity() set to DomError::SeverityFatalError.

DomLSInput objects belong to the application. The DOM implementation will never modify them (though it may make copies and modify the copies, if necessary).


Public Member Functions

 DomLSInput (const DomString &str)
 Create a input source from the given string.
DOM LS Level 3
DomString getSystemId () const
 The system identifier, a URI reference [IETF RFC 2396], for this input source.
void setSystemId (const DomString &systemId)
 Set the system id of this input source.
DomString getPublicId () const
 The public identifier for this input source.
void setPublicId (const DomString &publicId)
 Set the public identifier for this input source.
DomString getBaseURI () const
 The base URI to be used (see section 5.1.4 in [IETF RFC 2396]) for resolving a relative systemId to an absolute URI.
void setBaseURI (const DomString &baseURI)
 Set the base URI of this input source.
DomString getEncoding () const
 The character encoding, if known.
void setEncoding (const DomString &encoding)
 Set the character encoding.


Constructor & Destructor Documentation

xmldom::DomLSInput::DomLSInput ( const DomString str  ) 

Create a input source from the given string.


Member Function Documentation

DomString xmldom::DomLSInput::getSystemId (  )  const

The system identifier, a URI reference [IETF RFC 2396], for this input source.

The system identifier is optional if there is a byte stream, a character stream, or string data. It is still useful to provide one, since the application will use it to resolve any relative URIs and can include it in error messages and warnings. (The DomLSParser will only attempt to fetch the resource identified by the URI reference if there is no other input available in the input source.)

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.

void xmldom::DomLSInput::setSystemId ( const DomString systemId  ) 

Set the system id of this input source.

See also:
getSystemId()

DomString xmldom::DomLSInput::getPublicId (  )  const

The public identifier for this input source.

This may be mapped to an input source using an implementation dependent mechanism (such as catalogues or other mappings). The public identifier, if specified, may also be reported as part of the location information when errors are reported.

void xmldom::DomLSInput::setPublicId ( const DomString publicId  ) 

Set the public identifier for this input source.

See also:
getPublicId()

DomString xmldom::DomLSInput::getBaseURI (  )  const

The base URI to be used (see section 5.1.4 in [IETF RFC 2396]) for resolving a relative 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.

void xmldom::DomLSInput::setBaseURI ( const DomString baseURI  ) 

Set the base URI of this input source.

See also:
getBaseURI()

DomString xmldom::DomLSInput::getEncoding (  )  const

The character encoding, if known.

The encoding must be a string acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3 "Character Encoding in Entities").

If a DomLSInput is created from a DomString, the encoding is fixed to the encoding of the string and can not be changed. A call of setEncoding() is ignored.

void xmldom::DomLSInput::setEncoding ( const DomString encoding  ) 

Set the character encoding.

See also:
getEncoding()


The documentation for this class was generated from the following files:
Generated on Fri May 30 11:15:12 2008 for XMLDOM by  doxygen 1.5.2