27 #include <xercesc/util/PlatformUtils.hpp> 28 #include <xercesc/sax2/SAX2XMLReader.hpp> 29 #include <xercesc/sax2/Attributes.hpp> 38 namespace XERCES = XERCES_CPP_NAMESPACE;
41 IsisXMLHelper::IsisXMLHelper(
char *PencodingName,
42 bool &PexpandNamespaces,
43 XERCES::SAX2XMLReader* &Pparser,
46 encodingName = PencodingName;
47 expandNamespaces = PexpandNamespaces;
51 prevDocHandler = parser->getContentHandler();
52 prevErrorHandler = parser->getErrorHandler();
54 parser->setContentHandler(
this);
55 parser->setErrorHandler(
this);
58 generalHandler = NULL;
61 IsisXMLHelper::~IsisXMLHelper() {
62 if(ignoreHandler != NULL)
delete ignoreHandler;
63 if(generalHandler != NULL)
delete generalHandler;
68 void IsisXMLHelper::characters(
const XMLCh *
const chars,
69 const XMLSize_t length) {
73 void IsisXMLHelper::endElement(
const XMLCh *
const uri,
74 const XMLCh *
const localname,
75 const XMLCh *
const qname) {
76 parser->setContentHandler(prevDocHandler);
77 parser->setErrorHandler(prevErrorHandler);
80 void IsisXMLHelper::startElement(
const XMLCh *
const uri,
81 const XMLCh *
const localname,
82 const XMLCh *
const qname,
83 const XERCES::Attributes &attributes) {
85 if((
string)XERCES::XMLString::transcode(localname) == (
string)
"brief") {
86 if(generalHandler != NULL) {
87 delete generalHandler;
88 generalHandler = NULL;
90 generalHandler =
new IsisXMLHandler(encodingName, expandNamespaces,
91 parser, &helper->brief);
93 else if((
string)XERCES::XMLString::transcode(localname) == (
string)
"description") {
94 if(generalHandler != NULL) {
95 delete generalHandler;
96 generalHandler = NULL;
98 generalHandler =
new IsisXMLHandler(encodingName, expandNamespaces,
99 parser, &helper->description);
101 else if((
string)XERCES::XMLString::transcode(localname) == (
string)
"function") {
102 if(generalHandler != NULL) {
103 delete generalHandler;
104 generalHandler = NULL;
106 generalHandler =
new IsisXMLHandler(encodingName, expandNamespaces,
107 parser, &helper->function);
109 else if((
string)XERCES::XMLString::transcode(localname) == (
string)
"icon") {
110 if(generalHandler != NULL) {
111 delete generalHandler;
112 generalHandler = NULL;
114 generalHandler =
new IsisXMLHandler(encodingName, expandNamespaces,
115 parser, &helper->icon);
118 if(ignoreHandler != NULL) {
119 delete ignoreHandler;
120 ignoreHandler = NULL;
122 ignoreHandler =
new IsisXMLIgnore(encodingName, expandNamespaces, parser,
123 (
string)XERCES::XMLString::transcode(localname));
Namespace for the standard library.