DRDE/ACTK1_0/xml/XMLParser.hpp

54 lines
1.5 KiB
C++
Raw Permalink Normal View History

#ifndef __XMLPARSER_HPP
#define __XMLPARSER_HPP
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include "xml/ParsingException.hpp"
class NamespaceResolver;
class XMLDocument;
/**
* An XMLParser parses an XML document in String form and generates a DOM
* representation of the XML document. This implementation is not thread safe;
* a single instance may not be used simultaneously in separate threads. An
* attempt is made to load schemas from the location specified in the
* SessionManagerProperties specified. Documents are validated against any
* such loaded schemas unless validation is disabled.
*/
class XMLParser
{
public:
/**
* Create an XMLParser.
*/
XMLParser(void) throw (EPPException);
~XMLParser(void);
/**
* Generate a DOM representation of the given XML source document.
*/
XMLDocument* parse(const std::string& xml) throw (ParsingException);
/**
* Initialise the XMLParser which provides XML document builders to the
* toolkit, and optionally the Schema instances to be used for validating
* commands generated by the toolkit. To be called only once at application
* startup.
*/
static void init(void);
private:
// Common XPath namespace prefix resolver.
static NamespaceResolver* resolver;
xercesc::XercesDOMParser* parser;
xercesc::ErrorHandler* errHandler;
};
#endif //__XMLPARSER_HPP