#include <XMLUtils.h>
Classes | |
class | Handler |
class | XercesPlatform |
Public Member Functions | |
bool | parse () |
XMLDocument (std::auto_ptr< StorageWrap > &in, Handler &handler) | |
XMLDocument (std::auto_ptr< std::istream > &in, Handler &handler) | |
virtual | ~XMLDocument () |
Private Member Functions | |
void | init (Handler &handler) |
Private Attributes | |
bool | done |
std::auto_ptr < XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader > | parser |
std::auto_ptr< XercesPlatform > | platform |
std::auto_ptr < XERCES_CPP_NAMESPACE_QUALIFIER InputSource > | source |
XERCES_CPP_NAMESPACE_QUALIFIER XMLPScanToken | token |
Definition at line 33 of file XMLUtils.h.
XMLDocument::XMLDocument | ( | std::auto_ptr< std::istream > & | in, |
Handler & | handler | ||
) |
Definition at line 55 of file XMLUtils.cc.
References init().
XMLDocument::XMLDocument | ( | std::auto_ptr< StorageWrap > & | in, |
Handler & | handler | ||
) |
Definition at line 64 of file XMLUtils.cc.
References init().
XMLDocument::~XMLDocument | ( | ) | [virtual] |
Definition at line 99 of file XMLUtils.cc.
{ }
void XMLDocument::init | ( | Handler & | handler | ) | [private] |
Definition at line 73 of file XMLUtils.cc.
References alignCSCRings::e, Exception, parser, source, and token.
Referenced by XMLDocument().
{ try { parser->setFeature(XMLUni::fgSAX2CoreValidation, false); parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, false); parser->setFeature(XMLUni::fgXercesSchema, false); parser->setFeature(XMLUni::fgXercesSchemaFullChecking, false); parser->setContentHandler(&handler); parser->setLexicalHandler(&handler); parser->setErrorHandler(&handler); if (!parser->parseFirst(*source, token)) throw cms::Exception("XMLParseError") << "SAXParser::parseFirst failed" << std::endl; } catch(const XMLException &e) { throw cms::Exception("XMLDocument") << "XMLPlatformUtils::Initialize failed because of " << XMLSimpleStr(e.getMessage()) << std::endl; } catch(const SAXException &e) { throw cms::Exception("XMLDocument") << "XML parser reported: " << XMLSimpleStr(e.getMessage()) << "." << std::endl; } }
bool XMLDocument::parse | ( | void | ) |
Definition at line 103 of file XMLUtils.cc.
References done, alignCSCRings::e, Exception, parser, and token.
{ try { if (done || parser->getErrorCount()) return false; done = !parser->parseNext(token); } catch(const XMLException &e) { throw cms::Exception("XMLDocument") << "XMLPlatformUtils::Initialize failed because of " << XMLSimpleStr(e.getMessage()) << std::endl; } catch(const SAXException &e) { throw cms::Exception("XMLDocument") << "XML parser reported: " << XMLSimpleStr(e.getMessage()) << "." << std::endl; } return !done; }
bool lhef::XMLDocument::done [private] |
Definition at line 66 of file XMLUtils.h.
Referenced by parse().
std::auto_ptr<XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader> lhef::XMLDocument::parser [private] |
Definition at line 62 of file XMLUtils.h.
std::auto_ptr<XercesPlatform> lhef::XMLDocument::platform [private] |
Definition at line 59 of file XMLUtils.h.
std::auto_ptr<XERCES_CPP_NAMESPACE_QUALIFIER InputSource> lhef::XMLDocument::source [private] |
Definition at line 61 of file XMLUtils.h.
Referenced by init().
XERCES_CPP_NAMESPACE_QUALIFIER XMLPScanToken lhef::XMLDocument::token [private] |
Definition at line 64 of file XMLUtils.h.