26 #include <xercesc/util/PlatformUtils.hpp> 27 #include <xercesc/sax2/SAX2XMLReader.hpp> 36 IsisXMLMultipleValues::IsisXMLMultipleValues(
char *PencodingName,
37 bool &PexpandNamespaces,
38 XERCES::SAX2XMLReader* &Pparser,
39 std::vector<QString> *PmultipleValues) {
41 encodingName = PencodingName;
42 expandNamespaces = PexpandNamespaces;
44 multipleValues = PmultipleValues;
46 prevDocHandler = parser->getContentHandler();
47 prevErrorHandler = parser->getErrorHandler();
49 parser->setContentHandler(
this);
50 parser->setErrorHandler(
this);
52 generalHandler = NULL;
56 IsisXMLMultipleValues::~IsisXMLMultipleValues() {
57 if(generalHandler != NULL)
delete generalHandler;
58 if(ignoreHandler != NULL)
delete ignoreHandler;
63 void IsisXMLMultipleValues::characters(
const XMLCh *
const chars,
64 const XMLSize_t length) {}
67 void IsisXMLMultipleValues::endElement(
const XMLCh *
const uri,
68 const XMLCh *
const localname,
69 const XMLCh *
const qname) {
70 parser->setContentHandler(prevDocHandler);
71 parser->setErrorHandler(prevErrorHandler);
75 void IsisXMLMultipleValues::startElement(
const XMLCh *
const uri,
76 const XMLCh *
const localname,
77 const XMLCh *
const qname,
78 const XERCES::Attributes &attributes) {
80 if((
string)XERCES::XMLString::transcode(localname) == (
string)
"item") {
81 if(generalHandler != NULL) {
82 delete generalHandler;
83 generalHandler = NULL;
85 unsigned int index = multipleValues->size();
86 multipleValues->resize(index + 1);
87 generalHandler =
new IsisXMLHandler(encodingName, expandNamespaces,
88 parser, &(*multipleValues)[index]);
91 if(ignoreHandler != NULL) {
95 ignoreHandler =
new IsisXMLIgnore(encodingName, expandNamespaces, parser,
96 (
string)XERCES::XMLString::transcode(localname));
Namespace for the standard library.