## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.7

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XercesParserLiaison Class Reference

`#include <XercesParserLiaison.hpp>`

Inheritance diagram for XercesParserLiaison

Collaboration diagram for XercesParserLiaison:

List of all members.

## Public Types

- typedef XERCES_CPP_NAMESPACE_QUALIFIER
  SAXParser SAXParserType
- typedef std::map<const XalanDocument*,
  DocumentEntry> DocumentMapType
- typedef XERCES_CPP_NAMESPACE_QUALIFIER
  DOMParser DOMParserType

## Public Methods

- XercesParserLiaison (XercesDOMSupport& theSupport)
    Construct a XercesParserLiaison instance. More...
- XercesParserLiaison ()
    Construct a XercesParserLiaison instance.
- virtual ~XercesParserLiaison ()
- virtual void reset ()
- virtual ExecutionContext* getExecutionContext () const
- virtual void setExecutionContext (ExecutionContext& theContext)
- virtual XalanDocument* parseXMLStream ( const InputSourceType& reader, const XalanDOMString& identifier = XalanDOMString())
    Parse the text pointed at by the reader as XML, and return a DOM Document interface. More...
- virtual void parseXMLStream ( const InputSourceType& urlInputSource, DocumentHandlerType& handler, const XalanDOMString& identifier = XalanDOMString())
    Parse the text pointed at by the reader as XML. More...
- virtual XalanDocument* createDocument ()
    Create an empty DOM Document. More...
- virtual XalanDocument* createDOMFactory ()
    Get a factory object required to create nodes in the result tree. More...
- virtual void destroyDocument (XalanDocument* theDocument)
    Destroy the supplied XalanDocument instance. More...
- virtual int getIndent () const
    Get the amount to indent when indent-result="yes". More...
- virtual void setIndent (int i)
    Set the amount to indent when indent-result="yes". More...
- virtual bool getUseValidation () const
    Get whether or not validation will be performed. More...
- virtual void setUseValidation (bool b)
    If set to true, validation will be performed. More...
- virtual const XalanDOMString getParserDescription () const
    Return a string suitable for telling the user what parser is being used. More...
- virtual EntityResolverType* getEntityResolver () const
    This method returns the installed entity resolver. More...
- virtual void setEntityResolver (EntityResolverType* resolver)
    This method installs the user specified entity resolver on the parser. More...
- virtual bool getIncludeIgnorableWhitespace () const
    Get the 'include ignorable whitespace' flag. More...
- virtual void setIncludeIgnorableWhitespace (bool include)
    Set the 'include ignorable whitespace' flag. More...
- virtual ErrorHandlerType* getErrorHandler () const
    This method returns the installed error handler. More...
- virtual void setErrorHandler (ErrorHandlerType* handler)
    This method installs the user specified error handler on the parser. More...
- virtual bool getDoNamespaces () const
    This method returns the state of the parser's namespace handling capability. More...
- virtual void setDoNamespaces (bool newState)
    This method allows users to enable or disable the parser's namespace processing. More...
- virtual bool getExitOnFirstFatalError () const
    This method returns the state of the parser's exit-on-First-Fatal-Error flag. More...
- virtual void setExitOnFirstFatalError (bool newState)
    This method allows users to set the parser's behaviour when it encounters the first fatal error. More...
- virtual const XalanDOMChar* getExternalSchemaLocation () const
    This method returns the location for an external schema document for parsing. More...
- virtual void setExternalSchemaLocation (const XalanDOMChar* location)
    This method sets the location for an external schema document for parsing. More...
- virtual const XalanDOMChar* getExternalNoNamespaceSchemaLocation () const
    This method returns the location for an external schema document for parsing. More...
- virtual void setExternalNoNamespaceSchemaLocation (const XalanDOMChar* location)
    This method sets the location for an external schema document for parsing. More...
- XalanDocument* createDocument (const DOM_Document_Type& theXercesDocument)
    This API is deprecated. More...
- XalanDocument* createDocument ( const DOM_Document_Type& theXercesDocument, bool threadSafe, bool buildBridge)
    This API is deprecated. More...
- XalanDocument* createDocument (const DOMDocument_Type* theXercesDocument)
    Create a XalanDocument proxy for an existing Xerces document. More...
- XalanDocument* createDocument ( const DOMDocument_Type* theXercesDocument, bool threadSafe, bool buildWrapper, bool buildMaps = false)
    Create a XalanDocument proxy for an existing Xerces document. More...
- XercesDocumentBridge* mapDocument (const XalanDocument* theDocument) const
    This API is deprecated. More...
- XercesDocumentWrapper* mapDocumentToWrapper (const XalanDocument* theDocument) const
    Map a pointer to a XalanDocument instance to its implementation class pointer. More...
- DOM_Document_Type mapXercesDocument (const XalanDocument* theDocument) const
    This API is deprecated. More...
- const DOMDocument_Type* mapToXercesDocument (const XalanDocument* theDocument) const
    Map a pointer to a XalanDocument instance to its corresponding class pointer. More...
- virtual void warning (const SAXParseExceptionType& exception)
- virtual void error (const SAXParseExceptionType& exception)
- virtual void fatalError (const SAXParseExceptionType& exception)
- virtual void resetErrors ()
- bool getBuildBridgeNodes () const
    This API is deprecated. More...
- void setBuildBridgeNodes (bool newState)
    This API is deprecated. More...
- bool getBuildWrapperNodes () const
    This functions returns the state of the liaison's build-wrapper-nodes flag. More...
- void setBuildWrapperNodes (bool newState)
    This functions sets the state of the liaison's build-wrapper-nodes flag. More...
- bool getThreadSafe () const
    This functions returns the state of the liaison's thread-safe flag. More...
- void setThreadSafe (bool newState)
    This functions sets the state of the liaison's thread-safe flag. More...
- bool getBuildMaps () const
    This functions returns the state of the liaison's buildMaps flag. More...
- void setBuildMaps (bool newState)
    This functions sets the state of the liaison's buildMaps flag. More...

## Protected Methods

- DOMParserType* CreateDOMParser ()
- virtual SAXParserType* CreateSAXParser ()
- XercesDocumentBridge* doCreateDocument ( const DOM_Document_Type& theXercesDocument, bool threadSafe, bool buildBridge)
    Create a XalanDocument proxy for an existing Xerces document. More...
- XercesDocumentWrapper* doCreateDocument ( const DOMDocument_Type* theXercesDocument, bool threadSafe, bool buildWrapper, bool buildMaps, bool isOwned)
    Create a XalanDocument proxy for an existing Xerces document. More...

## Static Protected Methods

- void formatErrorMessage ( const SAXParseExceptionType& e, XalanDOMString& theMessage)

## Member Typedef Documentation

typedef XERCES_CPP_NAMESPACE_QUALIFIER DOMParser XercesParserLiaison::DOMParserType

typedef std::map<const XalanDocument*, DocumentEntry> XercesParserLiaison::DocumentMapType

typedef XERCES_CPP_NAMESPACE_QUALIFIER SAXParser XercesParserLiaison::SAXParserType

## Constructor & Destructor Documentation

XercesParserLiaison::XercesParserLiaison ( | XercesDOMSupport & theSupport )

Construct a XercesParserLiaison instance.

Parameters:

  theSupport | instance of DOMSupport object

Deprecated:
  This constructor is deprecated. Use the next constructor instead.

XercesParserLiaison::XercesParserLiaison ( | )

Construct a XercesParserLiaison instance.

virtual XercesParserLiaison::~XercesParserLiaison ( | )`[virtual]`

## Member Function Documentation

DOMParserType* XercesParserLiaison::CreateDOMParser ( | )`[protected]`

virtual SAXParserType* XercesParserLiaison::CreateSAXParser ( | )`[protected, virtual]`

virtual XalanDocument* XercesParserLiaison::createDOMFactory ( | )`[virtual]`

Get a factory object required to create nodes in the result tree.

The liaison owns the XalanDocument instance, and will delete it when when asked (see destroyDocument()), or when the liaison is reset, or goes out of scope.

Returns:
  A XalanDocument instance.

Reimplemented from XMLParserLiaison.

XalanDocument * XercesParserLiaison::createDocument ( | const DOMDocument_Type * theXercesDocument,
| bool threadSafe,
| bool buildWrapper,
| bool buildMaps = false )

Create a XalanDocument proxy for an existing Xerces document.

The parser liaison owns the instance, and you must not delete it. The liaison will delete it when reset() is called, or the liaison is destroyed.

Parameters:

  theXercesDocument | The Xerces document.
  threadSafe | If true, read access to the tree will be thread-safe (implies buildBridge == true).
  buildWrapper | If true, the entire wrapper structure is built.
  buildMaps | If true, the map of Xerces to Xalan nodes is always built.

Returns:
  a pointer to a new XalanDocument-derived instance.

XalanDocument * XercesParserLiaison::createDocument ( | const DOMDocument_Type * theXercesDocument )`[]`

Create a XalanDocument proxy for an existing Xerces document.

The parser liaison owns the instance, and you must not delete it. The liaison will delete it when reset() is called, or the liaison is destroyed.

Parameters:

  theXercesDocument | The Xerces document.

Returns:
  a pointer to a new XalanDocument-derived instance.

XalanDocument * XercesParserLiaison::createDocument ( | const DOM_Document_Type & theXercesDocument,
| bool threadSafe,
| bool buildBridge )

This API is deprecated.

Create a XalanDocument proxy for an existing Xerces document. The parser liaison owns the instance, and you must not delete it. The liaison will delete it when reset() is called, or the liaison is destroyed.

Deprecated:
  The Xerces DOM bridge is deprecated.

Parameters:

  theXercesDocument | The Xerces document.
  threadSafe | If true, read access to the tree will be thread-safe (implies buildBridge == true).
  buildBridge | If true, the entire bridge structure is built.

Returns:
  a pointer to a new XalanDocument-derived instance.

XalanDocument * XercesParserLiaison::createDocument ( | const DOM_Document_Type & theXercesDocument )`[]`

This API is deprecated.

Create a XalanDocument proxy for an existing Xerces document. The parser liaison owns the instance, and you must not delete it. The liaison will delete it when reset() is called, or the liaison is destroyed.

Deprecated:
  The Xerces DOM bridge is deprecated.

Parameters:

  theXercesDocument | The Xerces document.

Returns:
  a pointer to a new XalanDocument-derived instance.

virtual XalanDocument* XercesParserLiaison::createDocument ( | )`[virtual]`

Create an empty DOM Document.

Mainly used for creating an output document.

The liaison owns the XalanDocument instance, and will delete it when when asked (see DestroyDocument()), or when the liaison is reset, or goes out of scope.

Returns:
  DOM document created

Reimplemented from XMLParserLiaison.

virtual void XercesParserLiaison::destroyDocument ( | XalanDocument * theDocument )`[virtual]`

Destroy the supplied XalanDocument instance.

It must be an instance that was created by a previous call to createDocument() or getDOMFactory().

Parameters:

  theDocument | The XalanDocument instance to destroy.

Reimplemented from XMLParserLiaison.

XercesDocumentWrapper * XercesParserLiaison::doCreateDocument ( | const DOMDocument_Type * theXercesDocument,
| bool threadSafe,
| bool buildWrapper,
| bool buildMaps,
| bool isOwned )`[protected]`

Create a XalanDocument proxy for an existing Xerces document.

Parameters:

  theXercesDocument | The Xerces document.
  threadSafe | If true, read access to the tree will be thread-safe (implies buildBridge == true).
  buildWrapper | If true, the entire bridge structure is built.
  buildMaps | If true, the map of Xerces to Xalan nodes is always built.

Returns:
  a pointer to a new XercesDocumentWrapper instance.

XercesDocumentBridge * XercesParserLiaison::doCreateDocument ( | const DOM_Document_Type & theXercesDocument,
| bool threadSafe,
| bool buildBridge )`[protected]`

Create a XalanDocument proxy for an existing Xerces document.

This API is deprecated.

Parameters:

  theXercesDocument | The Xerces document.
  threadSafe | If true, read access to the tree will be thread-safe (implies buildBridge == true).
  buildBridge | If true, the entire bridge structure is built.

Returns:
  a pointer to a new XercesDocumentBridge instance.

virtual void XercesParserLiaison::error ( | const SAXParseExceptionType & exception )`[virtual]`

virtual void XercesParserLiaison::fatalError ( | const SAXParseExceptionType & exception )`[virtual]`

void XercesParserLiaison::formatErrorMessage ( | const SAXParseExceptionType & e,
| XalanDOMString & theMessage )`[static, protected]`

bool XercesParserLiaison::getBuildBridgeNodes ( | ) const`[]`

This API is deprecated.

This functions returns the state of the liaison's build-bridge-nodes flag.

Deprecated:
  The Xerces DOM bridge is deprecated.

Returns:
  true, if the bridge nodes are automatically built, false otherwise.

bool XercesParserLiaison::getBuildMaps ( | ) const`[]`

This functions returns the state of the liaison's buildMaps flag.

If true, maps will be created to allow mapping of Xalan<->Xerces mapping in both directions for XercesWrapper classes.

Returns:
  true, if the new documents will be built with Maps

bool XercesParserLiaison::getBuildWrapperNodes ( | ) const`[]`

This functions returns the state of the liaison's build-wrapper-nodes flag.

Returns:
  true, if the wrapper nodes are automatically built, false otherwise.

bool XercesParserLiaison::getDoNamespaces ( | ) const`[virtual]`

This method returns the state of the parser's namespace handling capability.

Returns:
  true, if the parser is currently configured to understand namespaces, false otherwise.

See also:
  setDoNamespaces()

virtual EntityResolverType* XercesParserLiaison::getEntityResolver ( | ) const`[virtual]`

This method returns the installed entity resolver.

Returns:
  The pointer to the installed entity resolver object.

Reimplemented from XMLParserLiaison.

ErrorHandlerType * XercesParserLiaison::getErrorHandler ( | ) const`[virtual]`

This method returns the installed error handler.

Returns:
  A pointer to the installed error handler object.

Reimplemented from XMLParserLiaison.

virtual ExecutionContext* XercesParserLiaison::getExecutionContext ( | ) const`[virtual]`

Reimplemented from XMLParserLiaison.

bool XercesParserLiaison::getExitOnFirstFatalError ( | ) const`[virtual]`

This method returns the state of the parser's exit-on-First-Fatal-Error flag.

Returns:
  true, if the parser is currently configured to exit on the first fatal error, false otherwise.

See also:
  setExitOnFirstFatalError()

const XalanDOMChar * XercesParserLiaison::getExternalNoNamespaceSchemaLocation ( | ) const`[virtual]`

This method returns the location for an external schema document for parsing.

Returns:
  A string representing the location of the external schema document

const XalanDOMChar * XercesParserLiaison::getExternalSchemaLocation ( | ) const`[virtual]`

This method returns the location for an external schema document for parsing.

Returns:
  A string representing the location of the external schema document

bool XercesParserLiaison::getIncludeIgnorableWhitespace ( | ) const`[virtual]`

Get the 'include ignorable whitespace' flag.

This method returns the state of the parser's include ignorable whitespace flag.

Returns:
  'true' if the include ignorable whitespace flag is set on the parser, 'false' otherwise.

See also:
  setIncludeIgnorableWhitespace()

virtual int XercesParserLiaison::getIndent ( | ) const`[virtual]`

Get the amount to indent when indent-result="yes".

Deprecated:

Returns:
  number of characters to indent

Reimplemented from XMLParserLiaison.

virtual const XalanDOMString XercesParserLiaison::getParserDescription ( | ) const`[virtual]`

Return a string suitable for telling the user what parser is being used.

Returns:
  string describing parser

Reimplemented from XMLParserLiaison.

bool XercesParserLiaison::getThreadSafe ( | ) const`[]`

This functions returns the state of the liaison's thread-safe flag.

If true, documents created will be safe when data is read. By default, documents are _not_ thread-safe.

Note -- modifications are _never_ synchronized.

Returns:
  true, if the new documents will be thread safe, false otherwise.

virtual bool XercesParserLiaison::getUseValidation ( | ) const`[virtual]`

Get whether or not validation will be performed.

Validation is off by default.

Returns:
  true to perform validation

Reimplemented from XMLParserLiaison.

XercesDocumentBridge * XercesParserLiaison::mapDocument ( | const XalanDocument * theDocument ) const

This API is deprecated.

Map a pointer to a XalanDocument instance to its implementation class pointer. Normally, you should have no reason for doing this. The liaison will return a null pointer if it did not create the instance passed.

Deprecated:
  The Xerces DOM bridge has been deprecated.

Parameters:

  theDocument | A pointer to a XalanDocument instance.

Returns:
  A pointer to the XercesDocumentBridge instance.

XercesDocumentWrapper * XercesParserLiaison::mapDocumentToWrapper ( | const XalanDocument * theDocument ) const

Map a pointer to a XalanDocument instance to its implementation class pointer.

Normally, you should have no reason for doing this. The liaison will return a null pointer if it did not create the instance passed.

Parameters:

  theDocument | A pointer to a XalanDocument instance.

Returns:
  A pointer to the XercesDocumentWrapper instance.

const DOMDocument_Type * XercesParserLiaison::mapToXercesDocument ( | const XalanDocument * theDocument ) const

Map a pointer to a XalanDocument instance to its corresponding class pointer.

Normally, you should have no reason for doing this. The liaison will return a null pointer if it did not create the instance passed.

Parameters:

  theDocument | A pointer to a XalanDocument instance.

Returns:
  A pointer to the XercesDocumentBridge instance.

DOM_Document_Type XercesParserLiaison::mapXercesDocument ( | const XalanDocument * theDocument ) const

This API is deprecated.

Map a pointer to a XalanDocument instance to its corresponding class pointer. Normally, you should have no reason for doing this. The liaison will return a null pointer if it did not create the instance passed.

Deprecated:
  The Xerces DOM bridge has been deprecated.

Parameters:

  theDocument | A pointer to a XalanDocument instance.

Returns:
  A pointer to the XercesDocumentBridge instance.

virtual void XercesParserLiaison::parseXMLStream ( | const InputSourceType & urlInputSource,
| DocumentHandlerType & handler,
| const XalanDOMString & identifier = XalanDOMString() )`[virtual]`

Parse the text pointed at by the reader as XML.

It is recommended that you pass in some sort of recognizable name, such as the filename or URI, with which the reader can be recognized if the parse fails.

Parameters:

  inputSource | input source that should hold valid XML
  handler | instance of a DocumentHandler
  identifier | used for diagnostic purposes only, some sort of identification for error reporting, default an empty string

Reimplemented from XMLParserLiaison.

virtual XalanDocument* XercesParserLiaison::parseXMLStream ( | const InputSourceType & reader,
| const XalanDOMString & identifier = XalanDOMString() )`[virtual]`

Parse the text pointed at by the reader as XML, and return a DOM Document interface.

It is recommended that you pass in some sort of recognizable name, such as the filename or URI, with which the reader can be recognized if the parse fails.

The liaison owns the XalanDocument instance, and will delete it when when asked (see DestroyDocument()), or when the liaison is reset, or goes out of scope.

Parameters:

  reader | stream that should hold valid XML
  identifier | used for diagnostic purposes only, some sort of identification for error reporting, default an empty string

Returns:
  DOM document created

Reimplemented from XMLParserLiaison.

virtual void XercesParserLiaison::reset ( | )`[virtual]`

Reimplemented from XMLParserLiaison.

virtual void XercesParserLiaison::resetErrors ( | )`[virtual]`

void XercesParserLiaison::setBuildBridgeNodes ( | bool newState )`[]`

This API is deprecated.

This functions sets the state of the liaison's build-bridge-nodes flag. This flag must be set for the document to be thread safe. It can also be set to true to increase performance. If this flag is set to false, then the thread-safe flag will also be set to false.

Deprecated:
  The Xerces DOM bridge is deprecated.

Parameters:

  newState | The new state for the flag.

void XercesParserLiaison::setBuildMaps ( | bool newState )`[]`

This functions sets the state of the liaison's buildMaps flag.

When this flag is true, maps will be built providing Xerces<->Xalan mapping in Wrapper classes.

Note:
  The maps created use a large amount of memory. If only Xalan->Xerces node mapping is required, do not set this to true.

Parameters:

  newState | The new state for the flag.

void XercesParserLiaison::setBuildWrapperNodes ( | bool newState )`[]`

This functions sets the state of the liaison's build-wrapper-nodes flag.

This flag must be set for the document to be thread safe. It can also be set to true to increase performance. If this flag is set to false, then the thread-safe flag will also be set to false.

Parameters:

  newState | The new state for the flag.

void XercesParserLiaison::setDoNamespaces ( | bool newState )`[virtual]`

This method allows users to enable or disable the parser's namespace processing.

When set to true, parser starts enforcing all the constraints / rules specified by the NameSpace specification.

The parser's default state is: false.

This flag is ignored by the underlying scanner if the installed validator indicates that namespace constraints should be enforced.

Parameters:

  newState | The value specifying whether NameSpace rules should be enforced or not.

See also:
  getDoNamespaces()

virtual void XercesParserLiaison::setEntityResolver ( | EntityResolverType * resolver )`[virtual]`

This method installs the user specified entity resolver on the parser.

It allows applications to trap and redirect calls to external entities.

Parameters:

  handler | A pointer to the entity resolver to be called when the parser comes across references to entities in the XML file.

Reimplemented from XMLParserLiaison.

void XercesParserLiaison::setErrorHandler ( | ErrorHandlerType * handler )`[virtual]`

This method installs the user specified error handler on the parser.

Parameters:

  handler | A pointer to the error handler to be called when the parser comes across 'error' events as per the SAX specification.

Reimplemented from XMLParserLiaison.

virtual void XercesParserLiaison::setExecutionContext ( | ExecutionContext & theContext )`[virtual]`

Reimplemented from XMLParserLiaison.

void XercesParserLiaison::setExitOnFirstFatalError ( | bool newState )`[virtual]`

This method allows users to set the parser's behaviour when it encounters the first fatal error.

If set to true, the parser will exit at the first fatal error. If false, then it will report the error and continue processing.

The default value is 'true' and the parser exits on the first fatal error.

Parameters:

  newState | The value specifying whether the parser should continue or exit when it encounters the first fatal error.

See also:
  getExitOnFirstFatalError()

void XercesParserLiaison::setExternalNoNamespaceSchemaLocation ( | const XalanDOMChar * location )`[virtual]`

This method sets the location for an external schema document for parsing.

Parameters:

  location | A string representing the location of the external schema document

void XercesParserLiaison::setExternalSchemaLocation ( | const XalanDOMChar * location )`[virtual]`

This method sets the location for an external schema document for parsing.

Parameters:

  location | A string representing the location of the external schema document

void XercesParserLiaison::setIncludeIgnorableWhitespace ( | bool include )`[virtual]`

Set the 'include ignorable whitespace' flag.

This method allows the user to specify whether a validating parser should include ignorable whitespaces as text nodes. It has no effect on non-validating parsers which always include non-markup text.

When set to true (also the default), ignorable whitespaces will be added to the DOM tree as text nodes. The method `DOMText::isIgnorableWhitespace` will return true for those text nodes only.

When set to false, all ignorable whitespace will be discarded and no text node is added to the DOM tree. Note: applications intended to process the "xml:space" attribute should not set this flag to false.

Parameters:

  include | The new state of the include ignorable whitespace flag.

See also:
  getIncludeIgnorableWhitespace()

virtual void XercesParserLiaison::setIndent ( | int i )`[virtual]`

Set the amount to indent when indent-result="yes".

Deprecated:

Parameters:

  i | number of characters to indent

Reimplemented from XMLParserLiaison.

void XercesParserLiaison::setThreadSafe ( | bool newState )`[]`

This functions sets the state of the liaison's thread-safe flag.

This flag must be set for the document to be thread safe. If this flag is set to true, then the build-bridge-nodes flag will also be set to true.

Parameters:

  newState | The new state for the flag.

virtual void XercesParserLiaison::setUseValidation ( | bool b )`[virtual]`

If set to true, validation will be performed.

Validation is off by default.

Parameters:

  b | true to perform validation

Reimplemented from XMLParserLiaison.

virtual void XercesParserLiaison::warning ( | const SAXParseExceptionType & exception )`[virtual]`

The documentation for this class was generated from the following file:

- XercesParserLiaison.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.7 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.