/* * Copyright (c) 2002, DecisionSoft Limited All rights reserved. * Please see LICENSE.TXT for more information. */ #ifndef __PATHANDOMBUILDERIMPL_HPP #define __PATHANDOMBUILDERIMPL_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMInputSource; class XMLGrammarPool; class MemoryManager; class XMLValidator; XERCES_CPP_NAMESPACE_END class PathanBuilderImpl : public XERCES_CPP_NAMESPACE_QUALIFIER DOMBuilderImpl { public: /** @name Constructors and Destructor */ //@{ /** Construct a DOMBuilderImpl, with an optional validator * * Constructor with an instance of validator class to use for * validation. If you don't provide a validator, a default one will * be created for you in the scanner. * * @param gramPool Pointer to the grammar pool instance from * external application. * The parser does NOT own it. * * @param valToAdopt Pointer to the validator instance to use. The * parser is responsible for freeing the memory. */ PathanBuilderImpl ( XERCES_CPP_NAMESPACE_QUALIFIER XMLValidator* const valToAdopt = 0 , XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* const manager = XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager , XERCES_CPP_NAMESPACE_QUALIFIER XMLGrammarPool* const gramPool = 0 ); /** *

"Experimental - subject to change"

* * Parse via an input source object * * This method invokes the parsing process on the XML file specified * by the DOMInputSource parameter. This API is borrowed from the * SAX Parser interface. * * @param source A const reference to the DOMInputSource object which * points to the XML file to be parsed. * @return If the DOMBuilder is a synchronous DOMBuilder the newly created * and populated Document is returned. If the DOMBuilder is * asynchronous then null is returned since the * document object is not yet parsed when this method returns. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOMException A DOM exception as per DOM spec. * * @see DOMInputSource#DOMInputSource * @see #setEntityResolver * @see #setErrorHandler */ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* parse(const XERCES_CPP_NAMESPACE_QUALIFIER DOMInputSource& source); /** *

"Experimental - subject to change"

* * Parse via a file path or URL * * This method invokes the parsing process on the XML file specified by * the Unicode string parameter 'systemId'. * * @param systemId A const XMLCh pointer to the Unicode string which * contains the path to the XML file to be parsed. * @return If the DOMBuilder is a synchronous DOMBuilder the newly created * and populated Document is returned. If the DOMBuilder is * asynchronous then null is returned since the * document object is not yet parsed when this method returns. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOM_DOMException A DOM exception as per DOM spec. * * @see #parse(DOMInputSource,...) */ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* parseURI(const XMLCh* const systemId); /** *

"Experimental - subject to change"

* * Parse via a file path or URL (in the local code page) * * This method invokes the parsing process on the XML file specified by * the native char* string parameter 'systemId'. * * @param systemId A const char pointer to a native string which * contains the path to the XML file to be parsed. * @return If the DOMBuilder is a synchronous DOMBuilder the newly created * and populated Document is returned. If the DOMBuilder is * asynchronous then null is returned since the * document object is not yet parsed when this method returns. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOM_DOMException A DOM exception as per DOM spec. * * @see #parse(DOMInputSource,...) */ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* parseURI(const char* const systemId); static const XMLCh gPathan[]; private: void initParser(); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* getDocumentAndAddGrammar(); }; //PathanBuilderImpl #endif //__PATHANDOMBUILDERIMPL_HPP