Isis 3 Programmer Reference
IsisXMLIgnore.cpp
Go to the documentation of this file.
1 
24 #include <string>
25 
26 #include <xercesc/util/PlatformUtils.hpp>
27 #include <xercesc/sax2/SAX2XMLReader.hpp>
28 
29 #include "IsisXMLIgnore.h"
30 #include "IsisXMLChTrans.h"
31 
32 using namespace std;
33 
34 namespace XERCES = XERCES_CPP_NAMESPACE;
35 
36 // Constructors
37 
38 IsisXMLIgnore::IsisXMLIgnore(char *PencodingName,
39  bool &PexpandNamespaces,
40  XERCES::SAX2XMLReader* &Pparser,
41  const std::string Pignore) {
42 
43  encodingName = PencodingName;
44  expandNamespaces = PexpandNamespaces;
45  parser = Pparser;
46  ignore = Pignore;
47 
48  prevDocHandler = parser->getContentHandler();
49  prevErrorHandler = parser->getErrorHandler();
50 
51  parser->setContentHandler(this);
52  parser->setErrorHandler(this);
53 
54 }
55 
56 
57 IsisXMLIgnore::~IsisXMLIgnore() {}
58 
59 
60 void IsisXMLIgnore::characters(const XMLCh *const chars,
61  const XMLSize_t length) {
62 }
63 
64 void IsisXMLIgnore::endElement(const XMLCh *const uri,
65  const XMLCh *const localname,
66  const XMLCh *const qname) {
67 
68  if((string)XERCES::XMLString::transcode(localname) == ignore) {
69  parser->setContentHandler(prevDocHandler);
70  parser->setErrorHandler(prevErrorHandler);
71  }
72 }
Namespace for the standard library.