nidas  v1.2-1520
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
nidas::core::XMLParser Class Reference

Wrapper class around xerces-c DOMBuilder to parse XML. More...

#include <XMLParser.h>

Inheritance diagram for nidas::core::XMLParser:
Inheritance graph
[legend]

Public Member Functions

 XMLParser () throw (nidas::core::XMLException)
 Constructor. More...
 
virtual ~XMLParser ()
 Nuke the parser. More...
 
void setDOMValidation (bool val)
 DOMBuilder::setFilter is not yet implemented in xerces c++ 2.6.0 void setFilter(xercesc::DOMBuilderFilter* filter) More...
 
void setDOMValidateIfSchema (bool val)
 Enable/disable schema validation. More...
 
void setDOMNamespaces (bool val)
 Enable/disable namespace processing. More...
 
void setXercesSchema (bool val)
 Enable/disable schema support. More...
 
void setXercesSchemaFullChecking (bool val)
 Enable/disable full schema constraint checking, including checking which may be time-consuming or memory intensive. More...
 
void setDOMDatatypeNormalization (bool val)
 Enable/disable datatype normalization. More...
 
void setXercesUserAdoptsDOMDocument (bool val)
 Control who owns DOMDocument pointer. More...
 
void setXercesHandleMultipleImports (bool val)
 
void setXercesDoXInclude (bool val)
 
xercesc::DOMDocument * parse (const std::string &xmlFile, bool verbose=true) throw (nidas::core::XMLException)
 
xercesc::DOMDocument * parse (xercesc::InputSource &source) throw (nidas::core::XMLException)
 

Protected Attributes

xercesc::DOMImplementation * _impl
 
xercesc::DOMBuilder * _parser
 
XMLErrorHandler _errorHandler
 

Private Member Functions

 XMLParser (const XMLParser &)
 No copying. More...
 
XMLParseroperator= (const XMLParser &)
 No assignment. More...
 

Detailed Description

Wrapper class around xerces-c DOMBuilder to parse XML.

Constructor & Destructor Documentation

XMLParser::XMLParser ( )
throw (nidas::core::XMLException
)

Constructor.

The default setting for setXercesUserAdoptsDOMDocument(true) is true.

XMLParser::~XMLParser ( )
virtual

Nuke the parser.

This does a release() (delete) of the associated DOMBuilder.

nidas::core::XMLParser::XMLParser ( const XMLParser )
private

No copying.

Member Function Documentation

XMLParser& nidas::core::XMLParser::operator= ( const XMLParser )
private

No assignment.

xercesc::DOMDocument * XMLParser::parse ( const std::string &  xmlFile,
bool  verbose = true 
)
throw (nidas::core::XMLException
)
xercesc::DOMDocument * XMLParser::parse ( xercesc::InputSource &  source)
throw (nidas::core::XMLException
)
void XMLParser::setDOMDatatypeNormalization ( bool  val)

Enable/disable datatype normalization.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMBuilderFeatures

Parameters
valIf true let the validation process do its datatype normalization that is defined in the used schema language. If false disable datatype normalization. The XML 1.0 attribute value normalization always occurs though. Default: false.

Referenced by PConfig::loadFile(), main(), and nidas::core::DSMServerApp::parseXMLConfigFile().

void XMLParser::setDOMNamespaces ( bool  val)

Enable/disable namespace processing.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMBuilderFeatures

Parameters
valIf true perform namespace processing. Default: false.

Referenced by PConfig::loadFile(), main(), and nidas::core::DSMServerApp::parseXMLConfigFile().

void XMLParser::setDOMValidateIfSchema ( bool  val)

Enable/disable schema validation.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMBuilderFeatures

Parameters
valIf true the parser will validate the document only if a grammar is specified. If false validation is determined by the state of the validation feature, see setDOMValidation(). Default: false.

Referenced by PConfig::loadFile(), main(), and nidas::core::DSMServerApp::parseXMLConfigFile().

void XMLParser::setDOMValidation ( bool  val)

DOMBuilder::setFilter is not yet implemented in xerces c++ 2.6.0 void setFilter(xercesc::DOMBuilderFilter* filter)

Enable/disable validation. See /link http://xml.apache.org/xerces-c/program-dom.html#DOMBuilderFeatures

Parameters
valBoolean value specifying whether to report all validation errors. Default: false.

Referenced by PConfig::loadFile(), main(), and nidas::core::DSMServerApp::parseXMLConfigFile().

void XMLParser::setXercesDoXInclude ( bool  val)
void XMLParser::setXercesHandleMultipleImports ( bool  val)
void XMLParser::setXercesSchema ( bool  val)

Enable/disable schema support.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMBuilderFeatures

Parameters
valIf true enable the parser's schema support. Default: false.

Referenced by PConfig::loadFile(), main(), and nidas::core::DSMServerApp::parseXMLConfigFile().

void XMLParser::setXercesSchemaFullChecking ( bool  val)

Enable/disable full schema constraint checking, including checking which may be time-consuming or memory intensive.

Currently, particle unique attribution constraint checking and particle derivation restriction checking are controlled by this option. See /link http://xml.apache.org/xerces-c/program-dom.html#DOMBuilderFeatures

Parameters
valIf true enable schema constraint checking. Default: false.

Referenced by PConfig::loadFile(), main(), and nidas::core::DSMServerApp::parseXMLConfigFile().

void XMLParser::setXercesUserAdoptsDOMDocument ( bool  val)

Control who owns DOMDocument pointer.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMBuilderFeatures

Parameters
valIf true the caller will adopt the DOMDocument that is returned from the parse method and thus is responsible to call DOMDocument::release() to release the associated memory. The parser will not release it. The ownership is transferred from the parser to the caller. If false the returned DOMDocument from the parse method is owned by the parser and thus will be deleted when the parser is released.

Member Data Documentation

XMLErrorHandler nidas::core::XMLParser::_errorHandler
protected
xercesc::DOMImplementation* nidas::core::XMLParser::_impl
protected
xercesc::DOMBuilder* nidas::core::XMLParser::_parser
protected

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