#include <DOMLSParser.hpp>
Public Types | |
Public Constants | |
enum | ActionType { ACTION_APPEND_AS_CHILDREN = 1, ACTION_REPLACE_CHILDREN = 2, ACTION_INSERT_BEFORE = 3, ACTION_INSERT_AFTER = 4, ACTION_REPLACE = 5 } |
A set of possible actions for the parseWithContext method. More... | |
Public Member Functions | |
Destructor | |
virtual | ~DOMLSParser () |
Destructor. | |
Functions introduced in DOM Level 3 | |
virtual DOMConfiguration * | getDomConfig ()=0 |
Get a pointer to the DOMConfiguration object used when parsing an input source. | |
virtual const DOMLSParserFilter * | getFilter () const =0 |
Get a const pointer to the application filter. | |
virtual bool | getAsync () const =0 |
Return whether the parser is asynchronous. | |
virtual bool | getBusy () const =0 |
Return whether the parser is busy parsing. | |
virtual void | setFilter (DOMLSParserFilter *const filter)=0 |
Set the application filter. | |
virtual DOMDocument * | parse (const DOMLSInput *source)=0 |
Parse an XML document from a resource identified by a DOMLSInput . | |
virtual DOMDocument * | parseURI (const XMLCh *const uri)=0 |
Parse an XML document from a location identified by a URI reference [IETF RFC 2396]. | |
virtual DOMDocument * | parseURI (const char *const uri)=0 |
Parse an XML document from a location identified by a URI reference [IETF RFC 2396]. | |
virtual void | 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 existing document at the position specified with the context and action arguments. | |
virtual void | abort ()=0 |
Abort the loading of the document that is currently being loaded by the DOMLSParser . | |
Non-standard Extension | |
virtual void | release ()=0 |
Called to indicate that this DOMLSParser is no longer in use and that the implementation may relinquish any resources associated with it. | |
virtual void | resetDocumentPool ()=0 |
Reset the documents vector pool and release all the associated memory back to the system. | |
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. | |
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. | |
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. | |
virtual Grammar * | getGrammar (const XMLCh *const nameSpaceKey) const =0 |
Retrieve the grammar that is associated with the specified namespace key. | |
virtual Grammar * | getRootGrammar () const =0 |
Retrieve the grammar where the root element is declared. | |
virtual const XMLCh * | getURIText (unsigned int uriId) const =0 |
Returns the string corresponding to a URI id from the URI string pool. | |
virtual void | resetCachedGrammarPool ()=0 |
Clear the cached grammar pool. | |
virtual XMLFilePos | getSrcOffset () const =0 |
Returns the current src offset within the input source. | |
Protected Member Functions | |
Hidden constructors | |
DOMLSParser () |
A DOMLSParser instance is obtained from the DOMImplementationLS interface by invoking its createLSParser method.
|
A set of possible actions for the parseWithContext method.
|
|
|
|
Destructor.
|
|
Abort the loading of the document that is currently being loaded by the
If the
Note: invoking this method will remove the installed
|
|
Return whether the parser is asynchronous.
|
|
Return whether the parser is busy parsing.
|
|
Get a pointer to the
This
In addition to the parameters recognized in on the
"charset-overrides-xml-encoding" true [optional] (default) If a higher level protocol such as HTTP [IETF RFC 2616] provides an indication of the character encoding of the input stream being processed, that will override any encoding specified in the XML declaration or the Text declaration (see also section 4.3.3, "Character Encoding in Entities", in [XML 1.0]). Explicitly setting an encoding in the "disallow-doctype" true [optional] Throw a fatal "doctype-not-allowed" error if a doctype node is found while parsing the document. This is useful when dealing with things like SOAP envelopes where doctype nodes are not allowed. false [required] (default) Allow doctype nodes in the document. "ignore-unknown-character-denormalizations" true [required] (default) If, while verifying full normalization when [XML 1.1] is supported, a processor encounters characters for which it cannot determine the normalization properties, then the processor will ignore any possible denormalizations caused by these characters. This parameter is ignored for [XML 1.0]. false [optional] Report an fatal "unknown-character-denormalization" error if a character is encountered for which the processor cannot determine the normalization properties. "infoset" See the definition of DOMConfiguration for a description of this parameter. Unlike in [DOM Level 3 Core], this parameter will default to true for DOMLSParser. "namespaces" true [required] (default) Perform the namespace processing as defined in [XML Namespaces] and [XML Namespaces 1.1]. false [optional] Do not perform the namespace processing. "resource-resolver" [required] A pointer to a DOMLSResourceResolver object, or NULL. If the value of this parameter is not null when an external resource (such as an external XML entity or an XML schema location) is encountered, the implementation will request that the DOMLSResourceResolver referenced in this parameter resolves the resource. "supported-media-types-only" true [optional] Check that the media type of the parsed resource is a supported media type. If an unsupported media type is encountered, a fatal error of type "unsupported-media-type" will be raised. The media types defined in [IETF RFC 3023] must always be accepted. false [required] (default) Accept any media type.
"validate" See the definition of
"validate-if-schema" See the definition of
"well-formed" See the definition of In addition to these, Xerces adds these non standard parameters: "http://apache.org/xml/properties/entity-resolver" A pointer to a XMLEntityResolver object, or NULL. If the value of this parameter is not null when an external resource (such as an external XML entity or an XML schema location) is encountered, the implementation will request that the XMLEntityResolver referenced in this parameter resolves the resource. "http://apache.org/xml/properties/schema/external-schemaLocation" A string holding a set of [namespaceUri schemaLocation] entries that will be treated as the content of the attribute xsi:schemaLocation of the root element "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation" A string holding the schemaLocation for the empty namespace URI that will be treated as the content of the attribute xsi:noNamespaceSchemaLocation of the root element "http://apache.org/xml/properties/security-manager" A pointer to a SecurityManager object that will control how many entity references will be expanded during parsing "http://apache.org/xml/properties/scannerName" A string holding the type of scanner used while parsing. The valid names are:
"http://apache.org/xml/properties/parser-use-DOMDocument-from-Implementation" A string holding the capabilities of the DOM implementation to be used to create the DOMDocument resulting from the parse operation. For instance, "LS" or "Core" "http://apache.org/xml/features/validation/schema" true Enable XMLSchema validation (note that also namespace processing should be enabled) false (default) Don't perform XMLSchema validation "http://apache.org/xml/features/validation/schema-full-checking" true Turn on full XMLSchema checking (e.g. Unique Particle Attribution) false (default) Don't perform full XMLSchema checking "http://apache.org/xml/features/validating/load-schema" true (default) Allow the parser to load schemas that are not in the grammar pool false Schemas that are not in the grammar pool are ignored
"http://apache.org/xml/features/dom/user-adopts-DOMDocument" true The DOMDocument objects returned by "http://apache.org/xml/features/nonvalidating/load-external-dtd" true (default) Allow the parser to load external DTDs false References to external DTDs will be ignored "http://apache.org/xml/features/continue-after-fatal-error" true Parsing should try to continue even if a fatal error has been triggered, trying to generate a DOM tree from a non well-formed XML false (default) Violation of XML rules will abort parsing "http://apache.org/xml/features/validation-error-as-fatal" true Validation errors are treated as fatal errors, and abort parsing (unless "continue-after-fatal-error" has been specified) false (default) Validation errors are normal errors "http://apache.org/xml/features/validation/cache-grammarFromParse" true XMLSchemas referenced by an XML file are cached in order to be reused by other parse operations false (default) XMLSchemas loaded during a parse operation will be discarded before the next one "http://apache.org/xml/features/validation/use-cachedGrammarInParse" true During this parse operation, reuse the XMLSchemas found in the cache false (default) Don't reuse the XMLSchemas found in the cache "http://apache.org/xml/features/calculate-src-ofs" true During parsing update the position in the source stream false (default) Don't waste time computing the position in the source stream "http://apache.org/xml/features/standard-uri-conformant" true Require that every URL being resolved is made of valid URL characters only false (default) Allow invalid URL characters in URL (e.g. spaces) "http://apache.org/xml/features/dom-has-psvi-info" true Add schema informations to DOMElement and DOMAttr nodes in the output DOM tree false (default) Don't store schema informations in the output DOM tree "http://apache.org/xml/features/generate-synthetic-annotations" true Create annotation objects in the representation of the loaded XMLSchemas false (default) Discard annotations found in the loaded XMLSchemas "http://apache.org/xml/features/validate-annotations" true Check that annotations are valid according to their XMLSchema definition false (default) Don't validate annotations "http://apache.org/xml/features/validation/identity-constraint-checking" true (default) Enforce identity constraints specified in the XMLSchema false Don't enforce identity constraints
"http://apache.org/xml/features/validation/ignoreCachedDTD" true Don't reuse DTDs found in the cache, even if use-cachedGrammarInParse is "http://apache.org/xml/features/schema/ignore-annotations" true Don't process annotations found in an XMLSchema false (default) Process the annotations found in an XMLSchema "http://apache.org/xml/features/disable-default-entity-resolution" true Entities will be resolved only by a resolver installed by the user false (default) If the entity resolver has not been installed, or it refuses to resolve the given entity, the parser will try to locate it himself
"http://apache.org/xml/features/validation/schema/skip-dtd-validation" true If XMLSchema validation is
|
|
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.
|
|
Retrieve the grammar that is associated with the specified namespace key.
|
|
Retrieve the grammar where the root element is declared.
|
|
Returns the current src offset within the input source.
|
|
Returns the string corresponding to a URI id from the URI string pool.
|
|
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.
|
|
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.
|
|
Preparse schema grammar (XML Schema, DTD, etc.) via an input source object. This method invokes the preparsing process on a schema grammar XML file specified by the DOMLSInput 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.
|
|
Parse an XML document from a resource identified by a The parser owns the returned DOMDocument. It will be deleted when the parser is released.
|
|
Parse an XML document from a location identified by a URI reference [IETF RFC 2396]. If the URI contains a fragment identifier (see section 4.1 in [IETF RFC 2396]), the behavior is not defined by this specification, future versions of this specification may define the behavior. The parser owns the returned DOMDocument. It will be deleted when the parser is released.
|
|
Parse an XML document from a location identified by a URI reference [IETF RFC 2396]. If the URI contains a fragment identifier (see section 4.1 in [IETF RFC 2396]), the behavior is not defined by this specification, future versions of this specification may define the behavior. The parser owns the returned DOMDocument. It will be deleted when the parser is released.
|
|
Parse an XML fragment from a resource identified by a
When parsing the input stream, the context node (or its parent, depending on where the result will be inserted) is used for resolving unbound namespace prefixes. The context node's
|
|
Called to indicate that this DOMLSParser is no longer in use and that the implementation may relinquish any resources associated with it. Access to a released object will lead to unexpected result. |
|
Clear the cached grammar pool.
|
|
Reset the documents vector pool and release all the associated memory back to the system. When parsing a document using a DOM parser, all memory allocated for a DOM tree is associated to the DOM document. If you do multiple parse using the same DOM parser instance, then multiple DOM documents will be generated and saved in a vector pool. All these documents (and thus all the allocated memory) won't be deleted until the parser instance is destroyed. If you don't need these DOM documents anymore and don't want to destroy the DOM parser instance at this moment, then you can call this method to reset the document vector pool and release all the allocated memory back to the system. It is an error to call this method if you are in the middle of a parse (e.g. in the mid of a progressive parse).
|
|
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 Any previously set filter is merely dropped, since the parser does not own them.
|