DOMLSParser.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSPARSER_HPP)
#define XERCESC_INCLUDE_GUARD_DOMLSPARSER_HPP
#include <xercesc/dom/DOMConfiguration.hpp>
#include <xercesc/dom/DOMLSParserFilter.hpp>
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/validators/common/Grammar.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMErrorHandler;
class DOMLSInput;
class DOMNode;
class DOMDocument;
class CDOM_EXPORT DOMLSParser
{
protected :
// -----------------------------------------------------------------------
// Hidden constructors
// -----------------------------------------------------------------------
DOMLSParser() {};
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMLSParser(const DOMLSParser &);
DOMLSParser & operator = (const DOMLSParser &);
public:
// -----------------------------------------------------------------------
// All constructors are hidden, just the destructor is available
// -----------------------------------------------------------------------
virtual ~DOMLSParser() {};
// -----------------------------------------------------------------------
// Class types
// -----------------------------------------------------------------------
enum ActionType
{
ACTION_APPEND_AS_CHILDREN = 1,
ACTION_REPLACE_CHILDREN = 2,
ACTION_INSERT_BEFORE = 3,
ACTION_INSERT_AFTER = 4,
ACTION_REPLACE = 5
};
// -----------------------------------------------------------------------
// Virtual DOMLSParser interface
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Getter methods
// -----------------------------------------------------------------------
virtual DOMConfiguration* getDomConfig() = 0;
virtual const DOMLSParserFilter* getFilter() const = 0;
virtual bool getAsync() const = 0;
virtual bool getBusy() const = 0;
// -----------------------------------------------------------------------
// Setter methods
// -----------------------------------------------------------------------
virtual void setFilter(DOMLSParserFilter* const filter) = 0;
// -----------------------------------------------------------------------
// Parsing methods
// -----------------------------------------------------------------------
virtual DOMDocument* parse(const DOMLSInput* source) = 0;
virtual DOMDocument* parseURI(const XMLCh* const uri) = 0;
virtual DOMDocument* parseURI(const char* const uri) = 0;
virtual DOMNode* parseWithContext(const DOMLSInput* source, DOMNode* contextNode, const ActionType action) = 0;
virtual void abort() = 0;
// -----------------------------------------------------------------------
// Non-standard Extension
// -----------------------------------------------------------------------
virtual void release() = 0;
virtual void resetDocumentPool() = 0;
virtual Grammar* loadGrammar(const DOMLSInput* source,
const Grammar::GrammarType grammarType,
const bool toCache = false) = 0;
virtual Grammar* loadGrammar(const XMLCh* const systemId,
const Grammar::GrammarType grammarType,
const bool toCache = false) = 0;
virtual Grammar* loadGrammar(const char* const systemId,
const Grammar::GrammarType grammarType,
const bool toCache = false) = 0;
virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) const = 0;
virtual Grammar* getRootGrammar() const = 0;
virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
virtual void resetCachedGrammarPool() = 0;
virtual XMLFilePos getSrcOffset() const = 0;
};
XERCES_CPP_NAMESPACE_END
#endif
DOMConfiguration.hpp
DOMLSParserFilter.hpp
XercesDefs.hpp
CDOM_EXPORT
#define CDOM_EXPORT
Definition: XercesDefs.hpp:166
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
XMLFilePos
XMLUInt64 XMLFilePos
Definition: Xerces_autoconf_config.hpp:139
DOMConfiguration
The DOMConfiguration interface represents the configuration of a document and maintains a table of re...
Definition: DOMConfiguration.hpp:351
DOMDocument
The DOMDocument interface represents the entire XML document.
Definition: DOMDocument.hpp:67
DOMErrorHandler
Basic interface for DOM error handlers.
Definition: DOMErrorHandler.hpp:47
DOMLSInput
This interface represents a single input source for an XML entity.
Definition: DOMLSInput.hpp:60
DOMLSParserFilter
Definition: DOMLSParserFilter.hpp:45
DOMLSParser
DOMLSParser provides an API for parsing XML documents and building the corresponding DOM document tre...
Definition: DOMLSParser.hpp:48
DOMLSParser::parseURI
virtual DOMDocument * parseURI(const XMLCh *const uri)=0
Parse an XML document from a location identified by a URI reference [IETF RFC 2396].
DOMLSParser::getGrammar
virtual Grammar * getGrammar(const XMLCh *const nameSpaceKey) const =0
Retrieve the grammar that is associated with the specified namespace key.
DOMLSParser::getURIText
virtual const XMLCh * getURIText(unsigned int uriId) const =0
Returns the string corresponding to a URI id from the URI string pool.
DOMLSParser::getSrcOffset
virtual XMLFilePos getSrcOffset() const =0
Returns the current src offset within the input source.
DOMLSParser::~DOMLSParser
virtual ~DOMLSParser()
Destructor.
Definition: DOMLSParser.hpp:78
DOMLSParser::resetDocumentPool
virtual void resetDocumentPool()=0
Reset the documents vector pool and release all the associated memory back to the system.
DOMLSParser::getFilter
virtual const DOMLSParserFilter * getFilter() const =0
Get a const pointer to the application filter.
DOMLSParser::parseURI
virtual DOMDocument * parseURI(const char *const uri)=0
Parse an XML document from a location identified by a URI reference [IETF RFC 2396].
DOMLSParser::loadGrammar
virtual Grammar * loadGrammar(const DOMLSInput *source, const Grammar::GrammarType grammarType, const bool toCache=false)=0
Preparse schema grammar (XML Schema, DTD, etc.) via an input source object.
DOMLSParser::getAsync
virtual bool getAsync() const =0
Return whether the parser is asynchronous.
DOMLSParser::getDomConfig
virtual DOMConfiguration * getDomConfig()=0
Get a pointer to the DOMConfiguration object used when parsing an input source.
DOMLSParser::setFilter
virtual void setFilter(DOMLSParserFilter *const filter)=0
Set the application filter.
DOMLSParser::parseWithContext
virtual DOMNode * parseWithContext(const DOMLSInput *source, DOMNode *contextNode, const ActionType action)=0
Parse an XML fragment from a resource identified by a DOMLSInput and insert the content into an exist...
DOMLSParser::DOMLSParser
DOMLSParser()
Definition: DOMLSParser.hpp:55
DOMLSParser::loadGrammar
virtual Grammar * loadGrammar(const char *const systemId, const Grammar::GrammarType grammarType, const bool toCache=false)=0
Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL.
DOMLSParser::loadGrammar
virtual Grammar * loadGrammar(const XMLCh *const systemId, const Grammar::GrammarType grammarType, const bool toCache=false)=0
Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL.
DOMLSParser::abort
virtual void abort()=0
Abort the loading of the document that is currently being loaded by the DOMLSParser.
DOMLSParser::release
virtual void release()=0
Called to indicate that this DOMLSParser is no longer in use and that the implementation may relinqui...
DOMLSParser::parse
virtual DOMDocument * parse(const DOMLSInput *source)=0
Parse an XML document from a resource identified by a DOMLSInput.
DOMLSParser::getRootGrammar
virtual Grammar * getRootGrammar() const =0
Retrieve the grammar where the root element is declared.
DOMLSParser::resetCachedGrammarPool
virtual void resetCachedGrammarPool()=0
Clear the cached grammar pool.
DOMLSParser::getBusy
virtual bool getBusy() const =0
Return whether the parser is busy parsing.
DOMLSParser::ActionType
ActionType
A set of possible actions for the parseWithContext method.
Definition: DOMLSParser.hpp:118
DOMNode
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition: DOMNode.hpp:139