ACTION_REPLACE
:
* Replace the context node with the result of parsing the input source.
* For this action to work the context node must be an
* DOMElement
, DOMText
, DOMCDATASection
,
* DOMComment
, DOMProcessingInstruction
, or
* DOMEntityReference
node.
ACTION_APPEND
:
* Append the result of parsing the input source to the context node. For
* this action to work, the context node must be an DOMElement
.
ACTION_INSERT_AFTER
:
* Insert the result of parsing the input source after the context node.
* For this action to work the context nodes parent must be an
* DOMElement
.
ACTION_INSERT_BEFORE
:
* Insert the result of parsing the input source before the context node.
* For this action to work the context nodes parent must be an
* DOMElement
.
"Experimental - subject to change"
* * @return The pointer to the installed error handler object. * @since DOM Level 3 */ virtual DOMErrorHandler* getErrorHandler() = 0; /** * Get a const pointer to the error handler * * This method returns the installed error handler. If no handler * has been installed, then it will be a zero pointer. * *"Experimental - subject to change"
* * @return A const pointer to the installed error handler object. * @since DOM Level 3 */ virtual const DOMErrorHandler* getErrorHandler() const = 0; /** * Get a pointer to the entity resolver * * This method returns the installed entity resolver. If no resolver * has been installed, then it will be a zero pointer. * *"Experimental - subject to change"
* * @return The pointer to the installed entity resolver object. * @since DOM Level 3 */ virtual DOMEntityResolver* getEntityResolver() = 0; /** * Get a const pointer to the entity resolver * * This method returns the installed entity resolver. If no resolver * has been installed, then it will be a zero pointer. * *"Experimental - subject to change"
* * @return A const pointer to the installed entity resolver object. * @since DOM Level 3 */ virtual const DOMEntityResolver* getEntityResolver() const = 0; /** * Get a pointer to the application filter * * This method returns the installed application filter. If no filter * has been installed, then it will be a zero pointer. * *"Experimental - subject to change"
* * @return The pointer to the installed application filter. * @since DOM Level 3 */ virtual DOMBuilderFilter* getFilter() = 0; /** * Get a const pointer to the application filter * * This method returns the installed application filter. If no filter * has been installed, then it will be a zero pointer. * *"Experimental - subject to change"
* * @return A const pointer to the installed application filter * @since DOM Level 3 */ virtual const DOMBuilderFilter* getFilter() const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Set the error handler * * This method allows applications to install their own error handler * to trap error and warning messages. * * Any previously set handler is merely dropped, since the parser * does not own them. * *"Experimental - subject to change"
* * @param handler A const pointer to the user supplied error * handler. * * @see #getErrorHandler * @since DOM Level 3 */ virtual void setErrorHandler(DOMErrorHandler* const handler) = 0; /** * Set the entity resolver * * This method allows applications to install their own entity * resolver. By installing an entity resolver, the applications * can trap and potentially redirect references to external * entities. * * Any previously set resolver is merely dropped, since the parser * does not own them. * *"Experimental - subject to change"
* * @param handler A const pointer to the user supplied entity * resolver. * * @see #getEntityResolver * @since DOM Level 3 */ virtual void setEntityResolver(DOMEntityResolver* const handler) = 0; /** * Set the application filter * * When the application provides a filter, the parser will call out to * the filter at the completion of the construction of each Element node. * The filter implementation can choose to remove the element from the * document being constructed (unless the element is the document element) * or to terminate the parse early. If the document is being validated * when it's loaded the validation happens before the filter is called. * * Any previously set filter is merely dropped, since the parser * does not own them. * *"Experimental - subject to change"
* * @param filter A const pointer to the user supplied application * filter. * * @see #getFilter * @since DOM Level 3 */ virtual void setFilter(DOMBuilderFilter* const filter) = 0; // ----------------------------------------------------------------------- // Feature methods // ----------------------------------------------------------------------- /** * Set the state of a feature * * It is possible for a DOMBuilder to recognize a feature name but to be * unable to set its value. * *"Experimental - subject to change"
* * See http://xml.apache.org/xerces-c/program-dom.html#DOMBuilderFeatures for * the list of supported features. * * @param name The feature name. * @param state The requested state of the feature (true or false). * @exception DOMException * NOT_SUPPORTED_ERR: Raised when the DOMBuilder recognizes the * feature name but cannot set the requested value. *"Experimental - subject to change"
* * @param name The feature name. * @return The current state of the feature (true or false) * @exception DOMException * NOT_FOUND_ERR: Raised when the DOMBuilder does not recognize * the feature name. * * @see #getFeature * @see #canSetFeature * @since DOM Level 3 */ virtual bool getFeature(const XMLCh* const name) const = 0; /** * Query whether setting a feature to a specific value is supported. * *"Experimental - subject to change"
* * @param name The feature name. * @param state The requested state of the feature (true or false). * @returntrue
if the feature could be successfully set
* to the specified value, or false
if the feature
* is not recognized or the requested value is not supported. The
* value of the feature itself is not changed.
*
* @see #getFeature
* @see #setFeature
* @since DOM Level 3
*/
virtual bool canSetFeature(const XMLCh* const name, const bool state) const = 0;
// -----------------------------------------------------------------------
// Parsing methods
// -----------------------------------------------------------------------
/**
* 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.
*
* The parser owns the returned DOMDocument. It will be deleted
* when the parser is released.
*
* "Experimental - subject to change"
* * @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 DOMDocument is returned. If the DOMBuilder is * asynchronous thennull
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
* @see resetDocumentPool
* @since DOM Level 3
*/
virtual DOMDocument* parse(const DOMInputSource& source) = 0;
/**
* Parse via a file path or URL
*
* This method invokes the parsing process on the XML file specified by
* the Unicode string parameter 'systemId'.
*
* The parser owns the returned DOMDocument. It will be deleted
* when the parser is released.
*
* "Experimental - subject to change"
* * @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 DOMDocument is returned. If the DOMBuilder is * asynchronous thennull
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 #parse(DOMInputSource,...)
* @see resetDocumentPool
* @since DOM Level 3
*/
virtual DOMDocument* parseURI(const XMLCh* const systemId) = 0;
/**
* 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'.
*
* The parser owns the returned DOMDocument. It will be deleted
* when the parser is released.
*
* "Experimental - subject to change"
* * @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 DOMDocument is returned. If the DOMBuilder is * asynchronous thennull
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 #parse(DOMInputSource,...)
* @see resetDocumentPool
*/
virtual DOMDocument* parseURI(const char* const systemId) = 0;
/**
* Parse via an input source object
*
* This method invokes the parsing process on the XML file specified
* by the DOMInputSource parameter, and inserts the content into an
* existing document at the position specified with the contextNode
* and action arguments. When parsing the input stream the context node
* is used for resolving unbound namespace prefixes.
*
* "Experimental - subject to change"
* * @param source A const reference to the DOMInputSource object which * points to the XML file to be parsed. * @param contextNode The node that is used as the context for the data * that is being parsed. This node must be a Document * node, a DocumentFragment node, or a node of a type * that is allowed as a child of an element, e.g. it * can not be an attribute node. * @param action This parameter describes which action should be taken * between the new set of node being inserted and the * existing children of the context node. * @exception DOMException * NOT_SUPPORTED_ERR: Raised when the DOMBuilder doesn't support * this method. *"Experimental - subject to change"
* * @param source A const reference to the DOMInputSource object which * points to the schema grammar file to be preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache Iftrue
, we cache the preparsed grammar,
* otherwise, no chaching. Default is false
.
* @return The preparsed schema grammar object (SchemaGrammar or
* DTDGrammar). That grammar object is owned by the parser.
*
* @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
*/
virtual Grammar* loadGrammar(const DOMInputSource& source,
const short grammarType,
const bool toCache = false) = 0;
/**
* Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL
*
* This method invokes the preparsing process on a schema grammar XML
* file specified by the file path parameter. If the 'toCache' flag is
* enabled, the parser will cache the grammars for re-use. If a grammar
* key is found in the pool, no caching of any grammar will take place.
*
* "Experimental - subject to change"
* * @param systemId A const XMLCh pointer to the Unicode string which * contains the path to the XML grammar file to be * preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache Iftrue
, we cache the preparsed grammar,
* otherwise, no chaching. Default is false
.
* @return The preparsed schema grammar object (SchemaGrammar or
* DTDGrammar). That grammar object is owned by the parser.
*
* @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.
*/
virtual Grammar* loadGrammar(const XMLCh* const systemId,
const short grammarType,
const bool toCache = false) = 0;
/**
* Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL
*
* This method invokes the preparsing process on a schema grammar XML
* file specified by the file path parameter. If the 'toCache' flag is
* enabled, the parser will cache the grammars for re-use. If a grammar
* key is found in the pool, no caching of any grammar will take place.
*
* "Experimental - subject to change"
* * @param systemId A const char pointer to a native string which contains * the path to the XML grammar file to be preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache Iftrue
, we cache the preparsed grammar,
* otherwise, no chaching. Default is false
.
* @return The preparsed schema grammar object (SchemaGrammar or
* DTDGrammar). That grammar object is owned by the parser.
*
*
* @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.
*/
virtual Grammar* loadGrammar(const char* const systemId,
const short grammarType,
const bool toCache = false) = 0;
/**
* Retrieve the grammar that is associated with the specified namespace key
*
* @param nameSpaceKey Namespace key
* @return Grammar associated with the Namespace key.
*/
virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) const = 0;
/**
* Retrieve the grammar where the root element is declared.
*
* @return Grammar where root element declared
*/
virtual Grammar* getRootGrammar() const = 0;
/**
* Returns the string corresponding to a URI id from the URI string pool.
*
* @param uriId id of the string in the URI string pool.
* @return URI string corresponding to the URI id.
*/
virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
/**
* Clear the cached grammar pool
*/
virtual void resetCachedGrammarPool() = 0;
/**
* Returns the current src offset within the input source.
*
* @return offset within the input source
*/
virtual unsigned int getSrcOffset() const = 0;
//@}
};
XERCES_CPP_NAMESPACE_END
#endif