26 #include <xercesc/util/PlatformUtils.hpp> 27 #include <xercesc/sax2/SAX2XMLReader.hpp> 28 #include <xercesc/sax2/Attributes.hpp> 35 namespace XERCES = XERCES_CPP_NAMESPACE;
40 IsisXMLGroups::IsisXMLGroups(
char *PencodingName,
41 bool &PexpandNamespaces,
42 XERCES::SAX2XMLReader* &Pparser,
43 std::vector<IsisGroupData> *Pgroups) {
45 encodingName = PencodingName;
46 expandNamespaces = PexpandNamespaces;
50 prevDocHandler = parser->getContentHandler();
51 prevErrorHandler = parser->getErrorHandler();
53 parser->setContentHandler(
this);
54 parser->setErrorHandler(
this);
60 IsisXMLGroups::~IsisXMLGroups() {
61 if(groupHandler != NULL)
delete groupHandler;
62 if(ignoreHandler != NULL)
delete ignoreHandler;
67 void IsisXMLGroups::characters(
const XMLCh *
const chars,
68 const XMLSize_t length) {}
71 void IsisXMLGroups::endElement(
const XMLCh *
const uri,
72 const XMLCh *
const localname,
73 const XMLCh *
const qname) {
74 parser->setContentHandler(prevDocHandler);
75 parser->setErrorHandler(prevErrorHandler);
79 void IsisXMLGroups::startElement(
const XMLCh *
const uri,
80 const XMLCh *
const localname,
81 const XMLCh *
const qname,
82 const XERCES::Attributes &attributes) {
84 if((
string)XERCES::XMLString::transcode(localname) == (
string)
"group") {
85 if(groupHandler != NULL) {
89 unsigned int index = groups->size();
90 groups->resize(index + 1);
91 (*groups)[index].name = XERCES::XMLString::transcode(attributes.getValue((XMLSize_t)0));
92 groupHandler =
new IsisXMLGroup(encodingName, expandNamespaces, parser,
96 if(ignoreHandler != NULL) {
100 ignoreHandler =
new IsisXMLIgnore(encodingName, expandNamespaces, parser,
101 (
string)XERCES::XMLString::transcode(localname));
Namespace for the standard library.