10#include <xercesc/sax2/SAX2XMLReader.hpp>
11#include <xercesc/sax2/Attributes.hpp>
12#include <xercesc/util/PlatformUtils.hpp>
14#include "IsisXMLApplication.h"
15#include "IsisXMLChTrans.h"
22IsisXMLApplication::IsisXMLApplication(
char *PencodingName,
23 bool &PexpandNamespaces,
24 XERCES::SAX2XMLReader* &Pparser,
27 encodingName = PencodingName;
28 expandNamespaces = PexpandNamespaces;
32 parser->setContentHandler(
this);
33 parser->setErrorHandler(
this);
36 descriptionHandler = NULL;
38 multipleValuesHandler = NULL;
40 historyHandler = NULL;
44IsisXMLApplication::~IsisXMLApplication() {
46 if(briefHandler != NULL)
delete briefHandler;
47 if(descriptionHandler != NULL)
delete descriptionHandler;
48 if(groupsHandler != NULL)
delete groupsHandler;
49 if(multipleValuesHandler != NULL)
delete multipleValuesHandler;
50 if(ignoreHandler != NULL)
delete ignoreHandler;
51 if(historyHandler != NULL)
delete historyHandler;
58void IsisXMLApplication::characters(
const XMLCh *
const chars,
59 const XMLSize_t length) {}
63void IsisXMLApplication::endDocument() {}
66void IsisXMLApplication::endElement(
const XMLCh *
const uri,
67 const XMLCh *
const localname,
68 const XMLCh *
const qname) {
72void IsisXMLApplication::processingInstruction(
const XMLCh *
const target,
73 const XMLCh *
const data) {}
76void IsisXMLApplication::startDocument() {}
79void IsisXMLApplication::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)
"application") {
85 QString name = XERCES::XMLString::transcode(attributes.getValue((XMLSize_t)0));
86 appData->name = name.toLower();
88 else if((
string)XERCES::XMLString::transcode(localname) == (
string)
"brief") {
89 if(briefHandler != NULL) {
94 parser, &appData->brief);
96 else if((
string)XERCES::XMLString::transcode(localname) == (
string)
"description") {
97 if(descriptionHandler != NULL) {
98 delete descriptionHandler;
99 descriptionHandler = NULL;
101 descriptionHandler =
new IsisXMLHandler(encodingName, expandNamespaces,
102 parser, &appData->description);
104 else if((
string)XERCES::XMLString::transcode(localname) == (
string)
"groups") {
105 if(groupsHandler != NULL) {
106 delete groupsHandler;
107 groupsHandler = NULL;
109 groupsHandler =
new IsisXMLGroups(encodingName, expandNamespaces, parser,
112 else if((
string)XERCES::XMLString::transcode(localname) == (
string)
"category") {
113 if(multipleValuesHandler != NULL) {
114 delete multipleValuesHandler;
115 multipleValuesHandler = NULL;
118 parser, &appData->categorys);
120 else if((
string)XERCES::XMLString::transcode(localname) == (
string)
"history") {
121 if(historyHandler != NULL) {
122 delete historyHandler;
123 historyHandler = NULL;
125 historyHandler =
new IsisXMLHistory(encodingName, expandNamespaces,
126 parser, &appData->changes);
129 if(ignoreHandler != NULL) {
130 delete ignoreHandler;
131 ignoreHandler = NULL;
133 ignoreHandler =
new IsisXMLIgnore(encodingName, expandNamespaces, parser,
134 (
string)XERCES::XMLString::transcode(localname));
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
Namespace for the standard library.