26 #include <xercesc/util/PlatformUtils.hpp> 27 #include <xercesc/sax2/SAX2XMLReader.hpp> 28 #include <xercesc/sax2/Attributes.hpp> 37 namespace XERCES = XERCES_CPP_NAMESPACE;
40 IsisXMLGroup::IsisXMLGroup(
char *PencodingName,
41 bool &PexpandNamespaces,
42 XERCES::SAX2XMLReader* &Pparser,
45 encodingName = PencodingName;
46 expandNamespaces = PexpandNamespaces;
50 prevDocHandler = parser->getContentHandler();
51 prevErrorHandler = parser->getErrorHandler();
53 parser->setContentHandler(
this);
54 parser->setErrorHandler(
this);
56 parameterHandler = NULL;
61 IsisXMLGroup::~IsisXMLGroup() {
63 if(parameterHandler != NULL)
delete parameterHandler;
64 if(ignoreHandler != NULL)
delete ignoreHandler;
69 void IsisXMLGroup::characters(
const XMLCh *
const chars,
70 const XMLSize_t length) {
74 void IsisXMLGroup::endElement(
const XMLCh *
const uri,
75 const XMLCh *
const localname,
76 const XMLCh *
const qname) {
77 parser->setContentHandler(prevDocHandler);
78 parser->setErrorHandler(prevErrorHandler);
81 void IsisXMLGroup::startElement(
const XMLCh *
const uri,
82 const XMLCh *
const localname,
83 const XMLCh *
const qname,
84 const XERCES::Attributes &attributes) {
86 if((
string)XERCES::XMLString::transcode(localname) == (
string)
"parameter") {
87 if(parameterHandler != NULL) {
88 delete parameterHandler;
89 parameterHandler = NULL;
91 unsigned int index = group->parameters.size();
92 group->parameters.resize(index + 1);
93 QString name = XERCES::XMLString::transcode(attributes.getValue((XMLSize_t)0));
95 group->parameters[index].name = name;
97 parser, &group->parameters[index]);
100 if(ignoreHandler != NULL) {
101 delete ignoreHandler;
102 ignoreHandler = NULL;
104 ignoreHandler =
new IsisXMLIgnore(encodingName, expandNamespaces, parser,
105 (
string)XERCES::XMLString::transcode(localname));
Namespace for the standard library.