#include <XercesParser.h>
Definition at line 18 of file XercesParser.h.
◆ XercesParser() [1/2]
◆ XercesParser() [2/2]
◆ ~XercesParser()
XercesParser::~XercesParser |
( |
| ) |
|
|
virtual |
◆ elementLoop() [1/2]
void XercesParser::elementLoop |
( |
| ) |
|
|
overridevirtual |
◆ elementLoop() [2/2]
virtual void XercesParser::elementLoop |
( |
AGDDController & |
c, |
|
|
xercesc::DOMNode * |
|
|
) |
| |
|
overridevirtual |
◆ Finalize()
bool XercesParser::Finalize |
( |
| ) |
|
◆ Initialize()
bool XercesParser::Initialize |
( |
| ) |
|
Definition at line 227 of file XercesParser.cxx.
233 catch(
const XMLException &toCatch) {
234 XERCES_STD_QUALIFIER cerr <<
"Error during Xerces-c Initialization.\n"
235 <<
" Exception message:"
236 << XERCES_STD_QUALIFIER endl;
◆ navigateTree()
Implements IAGDDParser.
Definition at line 180 of file XercesParser.cxx.
184 log<<MSG::WARNING<<
"navigateTree() - something is wrong! no document set! doing nothing!"<<
endmsg;
188 node =
dynamic_cast<DOMNode*
>(
m_doc->getDocumentElement());
189 if( !
node ) std::abort();
◆ ParseFile()
bool XercesParser::ParseFile |
( |
const std::string & |
s_in | ) |
|
|
overridevirtual |
Implements IAGDDParser.
Definition at line 45 of file XercesParser.cxx.
47 bool errorsOccured =
false;
52 log<<MSG::WARNING<<
"ParseFile() - something wrong, could not find XML file "<<
s<<
endmsg;
63 catch (
const OutOfMemoryException&)
65 XERCES_STD_QUALIFIER cerr <<
"OutOfMemoryException" << XERCES_STD_QUALIFIER endl;
68 catch (
const XMLException&
e)
70 XERCES_STD_QUALIFIER cerr <<
"An error occurred during parsing\n Message: "
71 << XMLString::transcode(
e.getMessage()) << XERCES_STD_QUALIFIER endl;
74 catch (
const DOMException&
e)
76 const unsigned int maxChars = 2047;
77 XMLCh errText[maxChars + 1];
79 XERCES_STD_QUALIFIER cerr <<
"\nDOM Error during parsing: '" <<
s <<
"'\n"
80 <<
"DOMException code is: " <<
e.code << XERCES_STD_QUALIFIER endl;
82 if (DOMImplementation::loadDOMExceptionMsg(
e.code, errText, maxChars))
83 XERCES_STD_QUALIFIER cerr <<
"Message is: " << XMLString::transcode(errText) << XERCES_STD_QUALIFIER endl;
89 XERCES_STD_QUALIFIER cerr <<
"An error occurred during parsing\n " << XERCES_STD_QUALIFIER endl;
◆ ParseFileAndNavigate()
◆ ParseString()
bool XercesParser::ParseString |
( |
const std::string & |
s | ) |
|
|
overridevirtual |
Implements IAGDDParser.
Definition at line 105 of file XercesParser.cxx.
107 const char*
str=
s.c_str();
108 MemBufInputSource memBuf ((
const XMLByte*)
str,strlen(
str),
"prodInfo",
false);
110 bool errorsOccured =
false;
116 catch (
const OutOfMemoryException&)
118 XERCES_STD_QUALIFIER cerr <<
"OutOfMemoryException" << XERCES_STD_QUALIFIER endl;
119 errorsOccured =
true;
121 catch (
const XMLException&
e)
123 XERCES_STD_QUALIFIER cerr <<
"An error occurred during parsing\n Message: "
124 << XMLString::transcode(
e.getMessage()) << XERCES_STD_QUALIFIER endl;
125 errorsOccured =
true;
127 catch (
const DOMException&
e)
129 const unsigned int maxChars = 2047;
130 XMLCh errText[maxChars + 1];
132 XERCES_STD_QUALIFIER cerr <<
"\nDOM Error during parsing: '" <<
s <<
"'\n"
133 <<
"DOMException code is: " <<
e.code << XERCES_STD_QUALIFIER endl;
135 if (DOMImplementation::loadDOMExceptionMsg(
e.code, errText, maxChars))
136 XERCES_STD_QUALIFIER cerr <<
"Message is: " << XMLString::transcode(errText) << XERCES_STD_QUALIFIER endl;
138 errorsOccured =
true;
142 XERCES_STD_QUALIFIER cerr <<
"An error occurred during parsing\n " << XERCES_STD_QUALIFIER endl;
143 errorsOccured =
true;
146 return errorsOccured;
◆ ParseStringAndNavigate()
◆ WriteToFile()
bool XercesParser::WriteToFile |
( |
const std::string & |
s | ) |
|
|
overridevirtual |
Implements IAGDDParser.
Definition at line 156 of file XercesParser.cxx.
159 XMLString::transcode(
"LS 3.0 Core 2.0", tempStr, 99);
160 DOMImplementation*
implementation = DOMImplementationRegistry::getDOMImplementation(tempStr);
161 DOMLSSerializer* serializer = ((DOMImplementationLS*)
implementation)->createLSSerializer();
165 XMLFormatTarget*
target =
new LocalFileFormatTarget(
s.c_str());
166 DOMLSOutput* domoutput = ((DOMImplementationLS*)
implementation)->createLSOutput();
168 if(
m_doc->getDOMConfig()->canSetParameter(XMLUni::fgDOMComments,
true) )
m_doc->getDOMConfig()->setParameter(XMLUni::fgDOMComments,
false);
169 m_doc->normalizeDocument();
171 domoutput->setByteStream(
target);
172 serializer->write(
m_doc, domoutput);
173 domoutput->release();
174 serializer->release();
◆ m_doc
xercesc::DOMDocument* XercesParser::m_doc |
|
private |
◆ m_fileName
std::string IAGDDParser::m_fileName |
|
protectedinherited |
◆ m_initialized
bool XercesParser::m_initialized |
|
private |
◆ m_parser
xercesc::XercesDOMParser* XercesParser::m_parser |
|
private |
◆ m_xs
The documentation for this class was generated from the following files: