Inheritance diagram for DOMParser:
Public Types | |
enum | ValSchemes { Val_Never, Val_Always, Val_Auto } |
Public Methods | |
void | reset () |
Constructors and Destructor | |
DOMParser (XMLValidator *const valToAdopt=0) | |
~DOMParser () | |
Getter methods | |
DOM_Document | getDocument () |
ErrorHandler * | getErrorHandler () |
const ErrorHandler * | getErrorHandler () const |
EntityResolver * | getEntityResolver () |
const EntityResolver * | getEntityResolver () const |
const XMLScanner & | getScanner () const |
const XMLValidator & | getValidator () const |
ValSchemes | getValidationScheme () const |
bool | getDoSchema () const |
bool | getValidationSchemaFullChecking () const |
int | getErrorCount () const |
bool | getDoNamespaces () const |
bool | getExitOnFirstFatalError () const |
bool | getValidationConstraintFatal () const |
bool | getCreateEntityReferenceNodes () const |
bool | getIncludeIgnorableWhitespace () const |
bool | getToCreateXMLDeclTypeNode () const |
XMLCh * | getExternalSchemaLocation () const |
XMLCh * | getExternalNoNamespaceSchemaLocation () const |
bool | getURLEntityCaching () const |
XMLCh * | getURLEntityCacheDir () const |
Setter methods | |
void | setErrorHandler (ErrorHandler *const handler) |
void | setEntityResolver (EntityResolver *const handler) |
void | setDoNamespaces (const bool newState) |
void | setExitOnFirstFatalError (const bool newState) |
void | setValidationConstraintFatal (const bool newState) |
void | setCreateEntityReferenceNodes (const bool create) |
void | setIncludeIgnorableWhitespace (const bool include) |
void | setValidationScheme (const ValSchemes newScheme) |
void | setDoSchema (const bool newState) |
void | setValidationSchemaFullChecking (const bool schemaFullChecking) |
void | setToCreateXMLDeclTypeNode (const bool create) |
void | setExternalSchemaLocation (const XMLCh *const schemaLocation) |
void | setExternalSchemaLocation (const char *const schemaLocation) |
void | setExternalNoNamespaceSchemaLocation (const XMLCh *const noNamespaceSchemaLocation) |
void | setExternalNoNamespaceSchemaLocation (const char *const noNamespaceSchemaLocation) |
void | setURLEntityCaching (const bool useCache) |
void | setURLEntityCacheDir (const XMLCh *const cachedir) |
void | setURLEntityCacheDir (const char *const cachedir) |
Parsing methods | |
void | parse (const InputSource &source, const bool reuseGrammar=false) |
void | parse (const XMLCh *const systemId, const bool reuseGrammar=false) |
void | parse (const char *const systemId, const bool reuseGrammar=false) |
bool | parseFirst (const XMLCh *const systemId, XMLPScanToken &toFill, const bool reuseGrammar=false) |
bool | parseFirst (const char *const systemId, XMLPScanToken &toFill, const bool reuseGrammar=false) |
bool | parseFirst (const InputSource &source, XMLPScanToken &toFill, const bool reuseGrammar=false) |
bool | parseNext (XMLPScanToken &token) |
void | parseReset (XMLPScanToken &token) |
Implementation of the XMLErrorReporter interface. | |
virtual void | error (const unsigned int errCode, const XMLCh *const msgDomain, const XMLErrorReporter::ErrTypes errType, const XMLCh *const errorText, const XMLCh *const systemId, const XMLCh *const publicId, const unsigned int lineNum, const unsigned int colNum) |
virtual void | resetErrors () |
Implementation of the XMLEntityHandler interface. | |
virtual void | endInputSource (const InputSource &inputSource) |
virtual bool | expandSystemId (const XMLCh *const systemId, XMLBuffer &toFill) |
virtual void | resetEntities () |
virtual InputSource * | resolveEntity (const XMLCh *const publicId, const XMLCh *const systemId) |
virtual void | startInputSource (const InputSource &inputSource) |
Implementation of the XMLDocumentHandler interface. | |
virtual void | docCharacters (const XMLCh *const chars, const unsigned int length, const bool cdataSection) |
virtual void | docComment (const XMLCh *const comment) |
virtual void | docPI (const XMLCh *const target, const XMLCh *const data) |
virtual void | endDocument () |
virtual void | endElement (const XMLElementDecl &elemDecl, const unsigned int urlId, const bool isRoot) |
virtual void | endEntityReference (const XMLEntityDecl &entDecl) |
virtual void | ignorableWhitespace (const XMLCh *const chars, const unsigned int length, const bool cdataSection) |
virtual void | resetDocument () |
virtual void | startDocument () |
virtual void | startElement (const XMLElementDecl &elemDecl, const unsigned int urlId, const XMLCh *const elemPrefix, const RefVectorOf< XMLAttr > &attrList, const unsigned int attrCount, const bool isEmpty, const bool isRoot) |
virtual void | startEntityReference (const XMLEntityDecl &entDecl) |
virtual void | XMLDecl (const XMLCh *const versionStr, const XMLCh *const encodingStr, const XMLCh *const standaloneStr, const XMLCh *const actualEncStr) |
Deprecated Methods | |
void | setExpandEntityReferences (const bool expand) |
bool | getExpandEntityReferences () const |
bool | getDoValidation () const |
void | setDoValidation (const bool newState) |
virtual void | attDef (const DTDElementDecl &elemDecl, const DTDAttDef &attDef, const bool ignoring) |
virtual void | doctypeComment (const XMLCh *const comment) |
virtual void | doctypeDecl (const DTDElementDecl &elemDecl, const XMLCh *const publicId, const XMLCh *const systemId, const bool hasIntSubset) |
virtual void | doctypePI (const XMLCh *const target, const XMLCh *const data) |
virtual void | doctypeWhitespace (const XMLCh *const chars, const unsigned int length) |
virtual void | elementDecl (const DTDElementDecl &decl, const bool isIgnored) |
virtual void | endAttList (const DTDElementDecl &elemDecl) |
virtual void | endIntSubset () |
virtual void | endExtSubset () |
virtual void | entityDecl (const DTDEntityDecl &entityDecl, const bool isPEDecl, const bool isIgnored) |
virtual void | resetDocType () |
virtual void | notationDecl (const XMLNotationDecl ¬Decl, const bool isIgnored) |
virtual void | startAttList (const DTDElementDecl &elemDecl) |
virtual void | startIntSubset () |
virtual void | startExtSubset () |
virtual void | TextDecl (const XMLCh *const versionStr, const XMLCh *const encodingStr) |
Protected Methods | |
Protected getter methods | |
DOM_Node | getCurrentNode () |
Protected setter methods | |
void | setCurrentNode (DOM_Node toSet) |
void | setDocument (DOM_Document toSet) |
It can be used to instantiate a validating or non-validating parser, by setting a member flag.
|
Construct a DOMParser, 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.
|
|
Destructor |
|
Deprecated doctypehandler interfaces |
|
Handle document character events This method is used to report all the characters scanned by the parser. This DOM implementation stores this data in the appropriate DOM node, creating one if necessary.
Implements XMLDocumentHandler. |
|
Handle a document comment event This method is used to report any comments scanned by the parser. A new comment node is created which stores this data.
Implements XMLDocumentHandler. |
|
Handle a document PI event This method is used to report any PI scanned by the parser. A new PI node is created and appended as a child of the current node in the tree.
Implements XMLDocumentHandler. |
|
Handle the end of document event This method is used to indicate the end of the current document. Implements XMLDocumentHandler. |
|
Handle and end of element event This method is used to indicate the end tag of an element. The DOMParse pops the current element off the top of the element stack, and make it the new current element.
Implements XMLDocumentHandler. |
|
Handle and end of entity reference event This method is used to indicate that an end of an entity reference was just scanned.
Implements XMLDocumentHandler. |
|
Handle an end of input source event This method is used to indicate the end of parsing of an external entity file. This method is a no-op for this DOM implementation.
Implements XMLEntityHandler. |
|
Handle errors reported from the parser This method is used to report back errors found while parsing the XML file. This method is also borrowed from the SAX specification. It calls the corresponding user installed Error Handler method: 'fatal', 'error', 'warning' depending on the severity of the error. This classification is defined by the XML specification.
|
|
Expand a system id This method allows an installed XMLEntityHandler to further process any system id's of enternal entities encountered in the XML file being parsed, such as redirection etc. This method always returns 'false' for this DOM implementation.
Implements XMLEntityHandler. |
|
Get the 'include entity references' flag This flag specifies whether the parser is creating entity reference nodes in the DOM tree being produced. When the 'create' flag is true, the DOM tree will contain entity reference nodes. When the 'create' flag is false, no entity reference nodes are included in the DOM tree. The replacement text of the entity is included in either case, either as a child of the Entity Reference node or in place at the location of the reference.
|
|
Get the current DOM node This provides derived classes with access to the current node, i.e. the node to which new nodes are being added. |
|
Get the DOM document This method returns the DOM_Document object representing the root of the document tree. This object provides the primary access to the document's data.
|
|
Get the 'do namespaces' flag This method returns the state of the parser's namespace processing flag.
|
|
Get the 'do schema' flag This method returns the state of the parser's schema processing flag.
|
|
DEPRECATED Use getValidationScheme() instead This method returns the state of the parser's validation handling flag which controls whether validation checks are enforced or not.
|
|
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.
|
|
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.
|
|
Get error count from the last parse operation. This method returns the error count from the last parse operation. Note that this count is actually stored in the scanner, so this method simply returns what the scanner reports.
|
|
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.
|
|
Get a 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.
|
|
Get the 'exit on first error' flag This method returns the state of the parser's exit-on-First-Fatal-Error flag. If this flag is true, then the parse will exit the first time it sees any non-wellformed XML or any validity error. The default state is true.
|
|
Get the 'expand entity references' flag. DEPRECATED Use getCreateEntityReferenceNodes() instead. This method returns the state of the parser's expand entity references flag.
|
|
Get the noNamespace SchemaLocation that is specified externaly. This method returns the no target namespace XML Schema Location that was specified using setExternalNoNamespaceSchemaLocation. The parser owns the returned string, and the memory allocated for the returned string will be destroyed when the parser is deleted. To ensure assessiblity of the returned information after the parser is deleted, callers need to copy and store the returned information somewhere else.
|
|
Get the set of Namespace/SchemaLocation that is specified externaly. This method returns the list of Namespace/SchemaLocation that was specified using setExternalSchemaLocation. The parser owns the returned string, and the memory allocated for the returned string will be destroyed when the parser is deleted. To ensure assessiblity of the returned information after the parser is deleted, callers need to copy and store the returned information somewhere else.
|
|
Get the 'include ignorable whitespace' flag. This method returns the state of the parser's include ignorable whitespace flag.
|
|
Get a const reference to the underlying scanner This method returns a reference to the underlying scanner object. It allows read only access to data maintained in the scanner.
|
|
Get the 'to create MXLDecl node' flag. This method returns the state of the parser's to create XMLDecl DOM Node flag.
|
|
This method returns the absolute directory path where the entity files are cached.
|
|
This method returns the state of the parser's entity file caching capability.
|
|
This method returns the state of the parser's validation-constraint-fatal flag.
|
|
Get the 'full schema constraint checking' flag This method returns the state of the parser's full schema constraint checking flag.
|
|
This method returns an enumerated value that indicates the current validation scheme set on this parser.
|
|
Get a const reference to the validator This method returns a reference to the parser's installed validator.
|
|
Handle an ignorable whitespace vent This method is used to report all the whitespace characters, which are determined to be 'ignorable'. This distinction between characters is only made, if validation is enabled. Any whitespace before content is ignored. If the current node is already of type DOM_Node::TEXT_NODE, then these whitespaces are appended, otherwise a new Text node is created which stores this data. Essentially all contiguous ignorable characters are collected in one node.
Implements XMLDocumentHandler. |
|
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'.
|
|
Parse via a file path or URL This method invokes the parsing process on the XML file specified by the Unicode string parameter 'systemId'. This method is borrowed from the SAX Parser interface.
|
|
Parse via an input source object This method invokes the parsing process on the XML file specified by the InputSource parameter. This API is borrowed from the SAX Parser interface.
|
|
Begin a progressive parse operation This method is used to start a progressive parse on a XML file. To continue parsing, subsequent calls must be to the parseNext method. It scans through the prolog and returns a token to be used on subsequent scanNext() calls. If the return value is true, then the token is legal and ready for further use. If it returns false, then the scan of the prolog failed and the token is not going to work on subsequent scanNext() calls.
|
|
Begin a progressive parse operation This method is used to start a progressive parse on a XML file. To continue parsing, subsequent calls must be to the parseNext method. It scans through the prolog and returns a token to be used on subsequent scanNext() calls. If the return value is true, then the token is legal and ready for further use. If it returns false, then the scan of the prolog failed and the token is not going to work on subsequent scanNext() calls.
|
|
Begin a progressive parse operation This method is used to start a progressive parse on a XML file. To continue parsing, subsequent calls must be to the parseNext method. It scans through the prolog and returns a token to be used on subsequent scanNext() calls. If the return value is true, then the token is legal and ready for further use. If it returns false, then the scan of the prolog failed and the token is not going to work on subsequent scanNext() calls.
|
|
Continue a progressive parse operation This method is used to continue with progressive parsing of XML files started by a call to 'parseFirst' method. It parses the XML file and stops as soon as it comes across a XML token (as defined in the XML specification).
|
|
Reset the parser after a progressive parse If a progressive parse loop exits before the end of the document is reached, the parser has no way of knowing this. So it will leave open any files or sockets or memory buffers that were in use at the time that the parse loop exited. The next parse operation will cause these open files and such to be closed, but the next parse operation might occur at some unknown future point. To avoid this problem, you should reset the parser if you exit the loop early. If you exited because of an error, then this cleanup will be done for you. Its only when you exit the file prematurely of your own accord, because you've found what you wanted in the file most likely.
|
|
Reset the parser This method resets the state of the DOM driver and makes it ready for a fresh parse run. |
|
Handle a document reset event This method allows the user installed Document Handler to 'reset' itself, freeing all the memory resources. The scanner calls this method before starting a new parse event. Implements XMLDocumentHandler. |
|
Reset any entity handler information This method allows the installed XMLEntityHandler to reset itself. This method is a no-op for this DOM implementation. Implements XMLEntityHandler. |
|
Reset any error data before a new parse This method allows the user installed Error Handler callback to 'reset' itself. This method is a no-op for this DOM implementation. Implements XMLErrorReporter. |
|
Resolve a public/system id This method allows a user installed entity handler to further process any pointers to external entities. The applications can implement 'redirection' via this callback. This method is also borrowed from the SAX specification.
Implements XMLEntityHandler. |
|
Set the 'include entity references' flag This method allows the user to specify whether the parser should create entity reference nodes in the DOM tree being produced. When the 'create' flag is true, the DOM tree constains entity reference nodes. When the 'create' flag is false, no entity reference nodes are included in the DOM tree. The replacement text of the entity is included in either case, either as a child of the Entity Reference node or in place at the location of the reference.
|
|
Set the current DOM node This method sets the current node maintained inside the parser to the one specified.
|
|
Set the document node This method sets the DOM Document node to the one specified.
|
|
Set the 'do namespaces' flag This method allows users to enable or disable the parser's namespace processing. When set to true, parser starts enforcing all the constraints and rules specified by the NameSpace specification. The parser's default state is: false. This flag is ignored by the underlying scanner if the installed validator indicates that namespace constraints should be enforced.
|
|
Set the 'do schema' flag This method allows users to enable or disable the parser's schema processing. When set to false, parser will not process any schema found. The parser's default state is: false.
|
|
DEPRECATED Use setValidationScheme(const ValSchemes newScheme) instead This method allows users to enable or disable the parser's validation checks. By default, the parser does not to any validation. The default value is false.
|
|
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.
|
|
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.
|
|
Set the 'exit on first error' flag This method allows users to set the parser's behaviour when it encounters the first fatal error. If set to true, the parser will exit at the first fatal error. If false, then it will report the error and continue processing. The default value is 'true' and the parser exits on the first fatal error.
|
|
Set the 'expand entity references' flag DEPRECATED. USE setCreateEntityReferenceNodes instead. This method allows the user to specify whether the parser should expand all entity reference nodes. When the 'do expansion' flag is true, the DOM tree does not have any entity reference nodes. It is replaced by the sub-tree representing the replacement text of the entity. When the 'do expansion' flag is false, the DOM tree contains an extra entity reference node, whose children is the sub tree of the replacement text.
|
|
This method is same as setExternalNoNamespaceSchemaLocation(const XMLCh* const). It takes native char string as parameter
|
|
This method allows the user to specify the no target namespace XML Schema Location externally. If specified, the instance document's noNamespaceSchemaLocation attribute will be effectively ignored. If this method is called more than once, only the last one takes effect. The syntax is the same as for the noNamespaceSchemaLocation attribute that may occur in an instance document: e.g."file_name.xsd".
|
|
This method is same as setExternalSchemaLocation(const XMLCh* const). It takes native char string as parameter
|
|
This method allows the user to specify a list of schemas to use. If the targetNamespace of a schema specified using this method matches the targetNamespace of a schema occuring in the instance document in the schemaLocation attribute, or if the targetNamespace matches the namespace attribute of the "import" element, the schema specified by the user using this method will be used (i.e., the schemaLocation attribute in the instance document or on the "import" element will be effectively ignored). If this method is called more than once, only the last one takes effect. The syntax is the same as for schemaLocation attributes in instance documents: e.g, "http://www.example.com file_name.xsd". The user can specify more than one XML Schema in the list.
|
|
Set the 'include ignorable whitespace' flag This method allows the user to specify whether a validating parser should include ignorable whitespaces as text nodes. It has no effect on non-validating parsers which always include non-markup text. When set to true (also the default), ignorable whitespaces will be added to the DOM tree as text nodes. The method DOM_Text::isIgnorableWhitespace() will return true for those text nodes only. When set to false, all ignorable whitespace will be discarded and no text node is added to the DOM tree. Note: applications intended to process the "xml:space" attribute should not set this flag to false. And this flag also overrides any schema datateye whitespace facets, that is, all ignorable whitespace will be discarded even though 'preserve' is set in schema datatype whitespace facets.
|
|
This method allows users to set the toCreateXMLDeclTypeNode flag by this parser. By setting it to 'true' user can have XMLDecl type nodes attached to the DOM tree. The parser's default state is: false
|
|
This method is same as setURLEntityCacheDir(const XMLCh* const). It takes native char string as parameter
|
|
Set the absolute path where the files are to be cached. This method allows the users to specify the absolute path of the directory where the files are to be cached. If this method is not invoked by the user but the Caching is turned on, the current directory is used by default. The parser's default value is : PWD
|
|
Set the external entity file caching flag This method allows users to enable or disable the parsers external entity file caching. When set to false, the external entity files are not cached locally. The parser's default behaviour is: true. (always caches files)
|
|
This method allows users to set the parser's behaviour when it encounters a validtion constraint error. If set to true, and the the parser is set to exit when it encounter the first fatal error, the parser will exit at the first encounter. If false, then it will report the error and continue processing. The default value is 'false'.
|
|
This method allows the user to turn full Schema constraint checking on/off. Only takes effect if Schema validation is enabled. If turned off, partial constraint checking is done. Full schema constraint checking includes those checking that may be time-consuming or memory intensive. Currently, particle unique attribution constraint checking and particle derivation resriction checking are controlled by this option. The parser's default state is: false.
|
|
This method allows users to set the validation scheme to be used by this parser. The value is one of the ValSchemes enumerated values defined by this class:
The parser's default state is: Val_Auto.
|
|
Handle a start document event This method is used to report the start of the parsing process. Implements XMLDocumentHandler. |
|
Handle a start element event This method is used to report the start of an element. It is called at the end of the element, by which time all attributes specified are also parsed. A new DOM Element node is created along with as many attribute nodes as required. This new element is added appended as a child of the current node in the tree, and then replaces it as the current node (if the isEmpty flag is false.)
Implements XMLDocumentHandler. |
|
Handle a start entity reference event This method is used to indicate the start of an entity reference. If the expand entity reference flag is true, then a new DOM Entity reference node is created.
Implements XMLDocumentHandler. |
|
Handle a 'start input source' event This method is used to indicate the start of parsing an external entity file. This method is a no-op for this DOM parse implementation.
Implements XMLEntityHandler. |
|
Handle an XMLDecl event This method is used to report the XML decl scanned by the parser. Refer to the XML specification to see the meaning of parameters. This method is a no-op for this DOM implementation.
Implements XMLDocumentHandler. |