Go to the documentation of this file.
22 #if !defined(XERCESC_INCLUDE_GUARD_ABSTRACTDOMPARSER_HPP)
23 #define XERCESC_INCLUDE_GUARD_ABSTRACTDOMPARSER_HPP
30 #include <xercesc/util/ValueStackOf.hpp>
31 #include <xercesc/validators/DTD/DocTypeHandler.hpp>
33 #include <xercesc/validators/DTD/DTDElementDecl.hpp>
34 #include <xercesc/framework/XMLBufferMgr.hpp>
42 class DOMDocumentImpl;
43 class DOMDocumentTypeImpl;
46 class GrammarResolver;
60 ,
public DocTypeHandler
265 bool getCreateEntityReferenceNodes()
const;
277 bool getIncludeIgnorableWhitespace()
const;
387 bool getCreateCommentNodes()
const;
439 bool getCreateSchemaInfo()
const;
450 bool getDoXInclude()
const;
613 void setCreateEntityReferenceNodes(
const bool create);
636 void setIncludeIgnorableWhitespace(
const bool include);
841 void setCreateCommentNodes(
const bool create);
885 void useImplementation(
const XMLCh*
const implementationFeatures);
917 void setDoXInclude(
const bool newState);
1062 const XMLCh*
const systemId
1063 , XMLPScanToken& toFill
1095 const char*
const systemId
1096 , XMLPScanToken& toFill
1129 , XMLPScanToken& toFill
1204 const XMLCh*
const localName
1205 ,
const XMLCh*
const uri
1211 const XMLCh*
const localName
1212 ,
const XMLCh*
const uri
1228 const XMLCh*
const localName
1229 ,
const XMLCh*
const uri
1255 const XMLCh*
const chars
1257 ,
const bool cdataSection
1270 const XMLCh*
const comment
1287 const XMLCh*
const target
1288 ,
const XMLCh*
const data
1316 ,
const unsigned int urlId
1318 ,
const XMLCh*
const elemPrefix
1354 const XMLCh*
const chars
1356 ,
const bool cdataSection
1403 ,
const unsigned int urlId
1404 ,
const XMLCh*
const elemPrefix
1405 ,
const RefVectorOf<XMLAttr>& attrList
1407 ,
const bool isEmpty
1445 const XMLCh*
const versionStr
1446 ,
const XMLCh*
const encodingStr
1447 ,
const XMLCh*
const standaloneStr
1448 ,
const XMLCh*
const actualEncStr
1461 const DTDElementDecl& elemDecl
1462 ,
const DTDAttDef& attDef
1463 ,
const bool ignoring
1468 const XMLCh*
const comment
1473 const DTDElementDecl& elemDecl
1474 ,
const XMLCh*
const publicId
1475 ,
const XMLCh*
const systemId
1476 ,
const bool hasIntSubset
1477 ,
const bool hasExtSubset =
false
1482 const XMLCh*
const target
1483 ,
const XMLCh*
const data
1488 const XMLCh*
const chars
1494 const DTDElementDecl& decl
1495 ,
const bool isIgnored
1500 const DTDElementDecl& elemDecl
1509 const DTDEntityDecl& entityDecl
1510 ,
const bool isPEDecl
1511 ,
const bool isIgnored
1519 ,
const bool isIgnored
1524 const DTDElementDecl& elemDecl
1533 const XMLCh*
const versionStr
1534 ,
const XMLCh*
const encodingStr
1548 const XMLCh* elemPrefix,
1549 const XMLCh* localName,
1550 const XMLCh* qName);
1554 const XMLCh* elemPrefix,
1555 const XMLCh* localName,
1556 const XMLCh* qName);
1608 XMLScanner* getScanner()
const;
1614 GrammarResolver* getGrammarResolver()
const;
1621 bool getParseInProgress()
const;
1642 void setCurrentNode(
DOMNode* toSet);
1658 void setParseInProgress(
const bool toSet);
1682 void resetInProgress();
const XMLValidator & getValidator() const
Get a const reference to the validator.
bool isDocumentAdopted() const
Returns true if the user has adopted the document.
void setStandardUriConformant(const bool newState)
Force standard uri.
bool getGenerateSyntheticAnnotations() const
Get the 'generate synthetic annotations' flag.
This class makes it possible to override the C++ memory management by adding new/delete operators to ...
Definition: XMemory.hpp:41
virtual void handleAttributesPSVI(const XMLCh *const localName, const XMLCh *const uri, PSVIAttributeList *psviAttributes)
Enables PSVI information about attributes to be passed back to the application.
virtual void resetDocument()
Handle a document reset event.
XMLCh * getExternalSchemaLocation() const
Get the set of Namespace/SchemaLocation that is specified externally.
XMLValidator * fValidator
Definition: AbstractDOMParser.hpp:1781
bool getIdentityConstraintChecking() const
Get the identity constraint checking' flag.
virtual void resetDocType()
bool parseFirst(const XMLCh *const systemId, XMLPScanToken &toFill)
Begin a progressive parse operation.
void setCurrentNode(DOMNode *toSet)
Set the current DOM node.
Definition: AbstractDOMParser.hpp:1888
virtual void startIntSubset()
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
virtual void startAttList(const DTDElementDecl &elemDecl)
bool getValidateAnnotations() const
Get the 'validate annotations' flag.
bool getIgnoreAnnotations() const
Get the 'ignore annotations' flag.
void setExternalSchemaLocation(const XMLCh *const schemaLocation)
This method allows the user to specify a list of schemas to use.
virtual void startExtSubset()
DOMNode * fCurrentNode
Definition: AbstractDOMParser.hpp:1774
char16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
ValSchemes getValidationScheme() const
This method returns an enumerated value that indicates the current validation scheme set on this pars...
DOMEntityImpl * fCurrentEntity
Definition: AbstractDOMParser.hpp:1775
XMLGrammarPool * fGrammarPool
Definition: AbstractDOMParser.hpp:1783
void setHandleMultipleImports(const bool newValue)
Set the 'handle multiple schema imports' flag.
void setExitOnFirstFatalError(const bool newState)
Set the 'exit on first error' flag.
This abstract class provides the interface for the scanner to return PSVI information to the applicat...
Definition: PSVIHandler.hpp:39
XMLSize_t getErrorCount() const
Get error count from the last parse operation.
void setCalculateSrcOfs(const bool newState)
Enable/disable src offset calculation.
bool fCreateSchemaInfo
Definition: AbstractDOMParser.hpp:1769
bool fDoXInclude
Definition: AbstractDOMParser.hpp:1770
void parse(const char *const systemId)
Parse via a file path or URL (in the local code page)
bool getCreateEntityReferenceNodes() const
Get the 'include entity references' flag.
Definition: AbstractDOMParser.hpp:1794
void reset()
Reset the parser.
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
void setLoadExternalDTD(const bool newState)
Set the 'Loading External DTD' flag.
virtual void doctypePI(const XMLCh *const target, const XMLCh *const data)
static char * replicate(const char *const toRep, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Replicates a string NOTE: The returned buffer is allocated with the MemoryManager.
GrammarResolver * fGrammarResolver
Definition: AbstractDOMParser.hpp:1779
virtual void setPSVIHandler(PSVIHandler *const handler)
This method installs the user specified PSVI handler on the parser.
virtual ~AbstractDOMParser()
Destructor.
XMLScanner * getScanner() const
Get the XML scanner.
Definition: AbstractDOMParser.hpp:1809
This class defines the core information of an element declaration.
Definition: XMLElementDecl.hpp:52
virtual void endAttList(const DTDElementDecl &elemDecl)
The DOMDocument interface represents the entire XML document.
Definition: DOMDocument.hpp:67
void setParseInProgress(const bool toSet)
Set the parse in progress flag.
Definition: AbstractDOMParser.hpp:1893
bool getDisableDefaultEntityResolution() const
Get the 'disable default entity resolution' flag.
void setValidateAnnotations(const bool newValue)
set the 'validlate annotations' flag
virtual void docCharacters(const XMLCh *const chars, const XMLSize_t length, const bool cdataSection)
Handle document character events.
virtual void TextDecl(const XMLCh *const versionStr, const XMLCh *const encodingStr)
This abstract class is a callback mechanism for the scanner.
Definition: XMLEntityHandler.hpp:44
void useScanner(const XMLCh *const scannerName)
Set the scanner to use when scanning the XML document.
bool getLoadSchema() const
Get the 'Loading Schema' flag.
void setCreateEntityReferenceNodes(const bool create)
Set the 'include entity references' flag.
Definition: AbstractDOMParser.hpp:1846
DOMDocument * getDocument()
Get the DOM document.
virtual void startEntityReference(const XMLEntityDecl &entDecl)
Handle a start entity reference event.
void setIncludeIgnorableWhitespace(const bool include)
Set the 'include ignorable whitespace' flag.
Definition: AbstractDOMParser.hpp:1851
This class defines that core information that defines an XML entity, no matter what validator is used...
Definition: XMLEntityDecl.hpp:51
virtual void startElement(const XMLElementDecl &elemDecl, const unsigned int urlId, const XMLCh *const elemPrefix, const RefVectorOf< XMLAttr > &attrList, const XMLSize_t attrCount, const bool isEmpty, const bool isRoot)
Handle a start element event.
bool getSkipDTDValidation() const
Get the 'skip DTD validation' flag.
This class represents the core information about a notation declaration that all validators must at l...
Definition: XMLNotationDecl.hpp:42
void setExternalNoNamespaceSchemaLocation(const XMLCh *const noNamespaceSchemaLocation)
This method allows the user to specify the no target namespace XML Schema Location externally.
virtual void XMLDecl(const XMLCh *const versionStr, const XMLCh *const encodingStr, const XMLCh *const standaloneStr, const XMLCh *const actualEncStr)
Handle an XMLDecl event.
void setDoSchema(const bool newState)
Set the 'do schema' flag.
virtual void elementDecl(const DTDElementDecl &decl, const bool isIgnored)
virtual void docComment(const XMLCh *const comment)
Handle a document comment event.
void useImplementation(const XMLCh *const implementationFeatures)
Set the implementation to use when creating the document.
Definition: AbstractDOMParser.hpp:1861
virtual void handleElementPSVI(const XMLCh *const localName, const XMLCh *const uri, PSVIElement *elementInfo)
Receive notification of the PSVI properties of an element.
virtual void endDocument()
Handle the end of document event.
void setSecurityManager(SecurityManager *const securityManager)
This allows an application to set a SecurityManager on the parser; this object stores information tha...
virtual void endElement(const XMLElementDecl &elemDecl, const unsigned int urlId, const bool isRoot, const XMLCh *const elemPrefix)
Handle and end of element event.
void setDoNamespaces(const bool newState)
Set the 'do namespaces' flag.
bool getValidationConstraintFatal() const
This method returns the state of the parser's validation-constraint-fatal flag.
virtual void docPI(const XMLCh *const target, const XMLCh *const data)
Handle a document PI event.
bool getDoXInclude() const
Get the 'do XInclude' flag.
Definition: AbstractDOMParser.hpp:1839
Definition: XMLGrammarPool.hpp:44
void setLowWaterMark(XMLSize_t lwm)
Set the raw buffer low water mark for this parser.
bool getHandleMultipleImports() const
Get the 'handle multiple schema imports' flag.
void setCreateCommentNodes(const bool create)
Set the 'create comment nodes' flag.
Definition: AbstractDOMParser.hpp:1856
This abstract class defines a callback mechanism for the scanner.
Definition: XMLErrorReporter.hpp:43
void setLoadSchema(const bool newState)
Set the 'Loading Schema' flag.
bool getExitOnFirstFatalError() const
Get the 'exit on first error' flag.
bool getCreateCommentNodes() const
Get the 'create comment node' flag.
Definition: AbstractDOMParser.hpp:1819
size_t XMLSize_t
Definition: Xerces_autoconf_config.hpp:112
bool getDoSchema() const
Get the 'do schema' flag.
bool getDoNamespaces() const
Get the 'do namespaces' flag.
virtual void doctypeDecl(const DTDElementDecl &elemDecl, const XMLCh *const publicId, const XMLCh *const systemId, const bool hasIntSubset, const bool hasExtSubset=false)
const XMLSize_t & getLowWaterMark() const
Get the raw buffer low water mark for this parser.
PSVIHandler * fPSVIHandler
Definition: AbstractDOMParser.hpp:1786
virtual DOMCDATASection * createCDATASection(const XMLCh *, XMLSize_t)
MemoryManager * getMemoryManager() const
Definition: AbstractDOMParser.hpp:1880
virtual void endIntSubset()
void parse(const InputSource &source)
Parse via an input source object.
void setIdentityConstraintChecking(const bool newState)
This method allows users to enable or disable the parser's identity constraint checks.
void setValidationSchemaFullChecking(const bool schemaFullChecking)
This method allows the user to turn full Schema constraint checking on/off.
bool getParseInProgress() const
Get the parse in progress flag.
Definition: AbstractDOMParser.hpp:1804
bool getValidationSchemaFullChecking() const
Get the 'full schema constraint checking' flag.
virtual void handlePartialElementPSVI(const XMLCh *const localName, const XMLCh *const uri, PSVIElement *elementInfo)
Receive notification of partial PSVI properties of an element.
void setExternalNoNamespaceSchemaLocation(const char *const noNamespaceSchemaLocation)
This method is same as setExternalNoNamespaceSchemaLocation(const XMLCh* const).
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length, const bool cdataSection)
Handle an ignorable whitespace vent.
virtual void attDef(const DTDElementDecl &elemDecl, const DTDAttDef &attDef, const bool ignoring)
bool fDocumentAdoptedByUser
Definition: AbstractDOMParser.hpp:1768
The DOMText interface inherits from DOMCharacterData and represents the textual content (termed chara...
Definition: DOMText.hpp:51
DOMDocumentImpl * fDocument
Definition: AbstractDOMParser.hpp:1776
DOMNode * getCurrentNode()
Get the current DOM node.
Definition: AbstractDOMParser.hpp:1875
XMLCh * fImplementationFeatures
Definition: AbstractDOMParser.hpp:1772
virtual void deallocate(void *p)=0
This method deallocates memory.
virtual void entityDecl(const DTDEntityDecl &entityDecl, const bool isPEDecl, const bool isIgnored)
void setDocument(DOMDocument *toSet)
Set the document node.
bool fCreateEntityReferenceNodes
Definition: AbstractDOMParser.hpp:1763
virtual DOMAttr * createAttrNS(const XMLCh *namespaceURI, const XMLCh *elemPrefix, const XMLCh *localName, const XMLCh *qName)
The DOMAttr class refers to an attribute of an XML element.
Definition: DOMAttr.hpp:57
void setGenerateSyntheticAnnotations(const bool newValue)
set the 'generate synthetic annotations' flag
bool getLoadExternalDTD() const
Get the 'Loading External DTD' flag.
XMLScanner * fScanner
Definition: AbstractDOMParser.hpp:1771
GrammarResolver * getGrammarResolver() const
Get the Grammar resolver.
Definition: AbstractDOMParser.hpp:1814
XMLBufferMgr fBufMgr
Definition: AbstractDOMParser.hpp:1784
void setIgnoreAnnotations(const bool newValue)
Set the 'ignore annotation' flag.
bool fCreateCommentNodes
Definition: AbstractDOMParser.hpp:1767
void parseReset(XMLPScanToken &token)
Reset the parser after a progressive parse.
virtual void notationDecl(const XMLNotationDecl ¬Decl, const bool isIgnored)
AbstractDOMParser(XMLValidator *const valToAdopt=0, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager, XMLGrammarPool *const gramPool=0)
Construct a AbstractDOMParser, with an optional validator.
bool parseFirst(const char *const systemId, XMLPScanToken &toFill)
Begin a progressive parse operation.
Allow application to force the parser to behave in a security-conscious way.
Definition: SecurityManager.hpp:52
XMLCh * getExternalNoNamespaceSchemaLocation() const
Get the noNamespace SchemaLocation that is specified externally.
virtual void endExtSubset()
bool getCalculateSrcOfs() const
Get the 'calculate src offset flag'.
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
Definition: DOMElement.hpp:66
This class implements the Document Object Model (DOM) interface.
Definition: AbstractDOMParser.hpp:62
Definition: PSVIElement.hpp:42
#define PARSERS_EXPORT
Definition: XercesDefs.hpp:168
void setExternalSchemaLocation(const char *const schemaLocation)
This method is same as setExternalSchemaLocation(const XMLCh* const).
virtual DOMText * createText(const XMLCh *, XMLSize_t)
virtual void doctypeWhitespace(const XMLCh *const chars, const XMLSize_t length)
DOMDocument * adoptDocument()
Adopt the DOM document.
void setDisableDefaultEntityResolution(const bool newValue)
Set the 'disable default entity resolution' flag.
bool parseNext(XMLPScanToken &token)
Continue a progressive parse operation.
SecurityManager * getSecurityManager() const
Get the SecurityManager instance attached to this parser.
void setValidationScheme(const ValSchemes newScheme)
This method allows users to set the validation scheme to be used by this parser.
bool parseFirst(const InputSource &source, XMLPScanToken &toFill)
Begin a progressive parse operation.
virtual DOMElement * createElement(const XMLCh *name)
XMLStringPool * fURIStringPool
Definition: AbstractDOMParser.hpp:1780
bool fIncludeIgnorableWhitespace
Definition: AbstractDOMParser.hpp:1764
XMLBuffer & fInternalSubset
Definition: AbstractDOMParser.hpp:1785
Configurable memory manager.
Definition: MemoryManager.hpp:40
RefVectorOf< DOMDocumentImpl > * fDocumentVector
Definition: AbstractDOMParser.hpp:1778
void setDoXInclude(const bool newState)
Set the 'do XInclude' flag.
Definition: AbstractDOMParser.hpp:1867
MemoryManager * fMemoryManager
Definition: AbstractDOMParser.hpp:1782
This abstract class provides the interface for all validators.
Definition: XMLValidator.hpp:53
bool fWithinElement
Definition: AbstractDOMParser.hpp:1765
virtual void endEntityReference(const XMLEntityDecl &entDecl)
Handle and end of entity reference event.
bool fParseInProgress
Definition: AbstractDOMParser.hpp:1766
bool getCreateSchemaInfo() const
Get the 'associate schema info' flag.
Definition: AbstractDOMParser.hpp:1834
PSVIHandler * getPSVIHandler()
This method returns the installed PSVI handler.
Definition: AbstractDOMParser.hpp:1824
CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...
Definition: DOMCDATASection.hpp:65
Definition: PSVIAttributeList.hpp:60
virtual DOMElement * createElementNS(const XMLCh *namespaceURI, const XMLCh *elemPrefix, const XMLCh *localName, const XMLCh *qName)
virtual DOMAttr * createAttr(const XMLCh *name)
This abstract class provides the interface for the scanner to return XML document information up to t...
Definition: XMLDocumentHandler.hpp:43
bool getIncludeIgnorableWhitespace() const
Get the 'include ignorable whitespace' flag.
Definition: AbstractDOMParser.hpp:1799
virtual void startDocument()
Handle a start document event.
bool getStandardUriConformant() const
Get the 'force standard uri flag'.
void setValidationConstraintFatal(const bool newState)
This method allows users to set the parser's behaviour when it encounters a validation constraint err...
void setCreateSchemaInfo(const bool newState)
Set the 'associate schema info' flag.
void setSkipDTDValidation(const bool newValue)
Set the 'skip DTD validation' flag.
DOMNode * fCurrentParent
Definition: AbstractDOMParser.hpp:1773
ValSchemes
ValScheme enum used in setValidationScheme Val_Never: Do not report validation errors.
Definition: AbstractDOMParser.hpp:78
virtual void doctypeComment(const XMLCh *const comment)
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition: DOMNode.hpp:139
void parse(const XMLCh *const systemId)
Parse via a file path or URL.
DOMDocumentTypeImpl * fDocumentType
Definition: AbstractDOMParser.hpp:1777