xmltooling  3.0.3
xmltooling::ParserPool Class Reference

A thread-safe pool of DOMBuilders that share characteristics. More...

#include <xmltooling/util/ParserPool.h>

Inheritance diagram for xmltooling::ParserPool:

Public Member Functions

 ParserPool (bool namespaceAware=true, bool schemaAware=false)
 Constructs a new pool. More...
 
xercesc::DOMDocument * newDocument ()
 Creates a new document using a parser from this pool. More...
 
xercesc::DOMDocument * parse (xercesc::DOMLSInput &domsrc)
 Parses a document using a pooled parser with the proper settings. More...
 
xercesc::DOMDocument * parse (std::istream &is)
 Parses a document using a pooled parser with the proper settings. More...
 
bool loadCatalogs (const char *pathnames)
 Load OASIS catalog files to map schema namespace URIs to filenames. More...
 
bool loadCatalog (const char *pathname)
 Load an OASIS catalog file to map schema namespace URIs to filenames. More...
 
bool loadCatalog (const XMLCh *pathname)
 Load an OASIS catalog file to map schema namespace URIs to filenames. More...
 
bool loadSchema (const XMLCh *nsURI, const XMLCh *pathname)
 Load a schema explicitly from a local file. More...
 
xercesc::DOMLSInput * resolveResource (const XMLCh *const resourceType, const XMLCh *const namespaceUri, const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const baseURI)
 Supplies all external entities (primarily schemas) to the parser.
 

Detailed Description

A thread-safe pool of DOMBuilders that share characteristics.

Constructor & Destructor Documentation

xmltooling::ParserPool::ParserPool ( bool  namespaceAware = true,
bool  schemaAware = false 
)

Constructs a new pool.

Parameters
namespaceAwareindicates whether parsers should be namespace-aware or not
schemaAwareindicates whether parsers should be schema-validating or not

Member Function Documentation

bool xmltooling::ParserPool::loadCatalog ( const char *  pathname)

Load an OASIS catalog file to map schema namespace URIs to filenames.

This does not provide real catalog support; only the <uri> element is supported to map from a namespace URI to a relative path or file:// URI.

Parameters
pathnamepath to a catalog file
Returns
true iff the catalog was successfully processed
bool xmltooling::ParserPool::loadCatalog ( const XMLCh *  pathname)

Load an OASIS catalog file to map schema namespace URIs to filenames.

This does not provide real catalog support; only the <uri> element is supported to map from a namespace URI to a relative path or file:// URI.

Parameters
pathnamepath to a catalog file
Returns
true iff the catalog was successfully processed
bool xmltooling::ParserPool::loadCatalogs ( const char *  pathnames)

Load OASIS catalog files to map schema namespace URIs to filenames.

This does not provide real catalog support; only the <uri> element is supported to map from a namespace URI to a relative path or file:// URI.

Multiple files can be specified using a platform-specific path delimiter.

Parameters
pathnamepath to one or more catalog files
Returns
true iff the catalogs were successfully processed
bool xmltooling::ParserPool::loadSchema ( const XMLCh *  nsURI,
const XMLCh *  pathname 
)

Load a schema explicitly from a local file.

Note that "successful processing" does not imply that the schema is valid, only that a reference to it was successfully registered with the pool.

Parameters
nsURIXML namespace to load
pathnamepath to schema file
Returns
true iff the schema was successfully processed
xercesc::DOMDocument* xmltooling::ParserPool::newDocument ( )

Creates a new document using a parser from this pool.

Returns
new XML document
xercesc::DOMDocument* xmltooling::ParserPool::parse ( xercesc::DOMLSInput &  domsrc)

Parses a document using a pooled parser with the proper settings.

Parameters
domsrcAn input source containing the content to be parsed
Returns
The DOM document resulting from the parse
Exceptions
XMLParserExceptionthrown if there was a problem reading, parsing, or validating the XML
xercesc::DOMDocument* xmltooling::ParserPool::parse ( std::istream &  is)

Parses a document using a pooled parser with the proper settings.

Parameters
isAn input stream containing the content to be parsed
Returns
The DOM document resulting from the parse
Exceptions
XMLParserExceptionthrown if there was a problem reading, parsing, or validating the XML

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