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 IsisXMLHelpers::IsisXMLHelpers(
char *PencodingName,
41 bool &PexpandNamespaces,
42 XERCES::SAX2XMLReader* &Pparser,
43 std::vector<IsisHelperData> *Phelpers) {
45 encodingName = PencodingName;
46 expandNamespaces = PexpandNamespaces;
50 prevDocHandler = parser->getContentHandler();
51 prevErrorHandler = parser->getErrorHandler();
53 parser->setContentHandler(
this);
54 parser->setErrorHandler(
this);
60 IsisXMLHelpers::~IsisXMLHelpers() {
61 if(helperHandler != NULL)
delete helperHandler;
62 if(ignoreHandler != NULL)
delete ignoreHandler;
67 void IsisXMLHelpers::characters(
const XMLCh *
const chars,
68 const XMLSize_t length) {}
71 void IsisXMLHelpers::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 IsisXMLHelpers::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)
"helper") {
85 if(helperHandler != NULL) {
89 unsigned int index = helpers->size();
90 helpers->resize(index + 1);
91 (*helpers)[index].name = XERCES::XMLString::transcode(attributes.getValue((XMLSize_t)0));
92 helperHandler =
new IsisXMLHelper(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.