diff options
author | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
commit | a15cf65c44d5c224169c32ef5495b68c758134b7 (patch) | |
tree | 3419f58fc8e1b315ba8171910ee044c5d467c162 /libxsd-frontend/xsd-frontend/schema-dom-parser.hxx |
Imported Upstream version 3.3.0.2upstream/3.3.0.2
Diffstat (limited to 'libxsd-frontend/xsd-frontend/schema-dom-parser.hxx')
-rw-r--r-- | libxsd-frontend/xsd-frontend/schema-dom-parser.hxx | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/libxsd-frontend/xsd-frontend/schema-dom-parser.hxx b/libxsd-frontend/xsd-frontend/schema-dom-parser.hxx new file mode 100644 index 0000000..7571677 --- /dev/null +++ b/libxsd-frontend/xsd-frontend/schema-dom-parser.hxx @@ -0,0 +1,93 @@ +// file : xsd-frontend/schema-dom-parser.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_FRONTEND_SCHEMA_DOM_PARSER_HXX +#define XSD_FRONTEND_SCHEMA_DOM_PARSER_HXX + +#include <xercesc/parsers/XercesDOMParser.hpp> + +#include <xercesc/dom/DOMElement.hpp> + +#include <xercesc/validators/schema/XSDLocator.hpp> +#include <xercesc/validators/schema/XSDErrorReporter.hpp> + +namespace XSDFrontend +{ + namespace XML + { + namespace Xerces = xercesc; + + extern const XMLCh line_key[2]; + extern const XMLCh column_key[2]; + + class SchemaDOMParser: public Xerces::XercesDOMParser + { + public : + SchemaDOMParser ( + Xerces::MemoryManager* = Xerces::XMLPlatformUtils::fgMemoryManager); + + // Callbacks. + // + virtual void + startElement (const Xerces::XMLElementDecl&, + const unsigned int url_id, + const XMLCh* const prefix, + const Xerces::RefVectorOf<Xerces::XMLAttr>& attributes, +#if _XERCES_VERSION >= 30000 + const XMLSize_t attribute_count, +#else + const unsigned int attribute_count, +#endif + const bool empty, + const bool root); + + virtual void + endElement (const Xerces::XMLElementDecl&, + const unsigned int url_id, + const bool root, + const XMLCh* const prefix); + + virtual void + docCharacters (const XMLCh* const, +#if _XERCES_VERSION >= 30000 + const XMLSize_t length, +#else + const unsigned int length, +#endif + const bool cdata); + + virtual void + docComment (const XMLCh* const); + + virtual void + startEntityReference (const Xerces::XMLEntityDecl&); + + virtual void + endEntityReference (const Xerces::XMLEntityDecl&); + + virtual void + ignorableWhitespace (const XMLCh* const, +#if _XERCES_VERSION >= 30000 + const XMLSize_t length, +#else + const unsigned int length, +#endif + const bool cdata); + private: + SchemaDOMParser (SchemaDOMParser const&); + SchemaDOMParser& + operator=(SchemaDOMParser const&); + + private: + int depth_; + int ann_depth_; + int inner_ann_depth_; + Xerces::XSDLocator locator_; + Xerces::XSDErrorReporter error_reporter_; + }; + } +} + +#endif // XSD_FRONTEND_SCHEMA_DOM_PARSER_HXX |