#include <AbstractDOMParser.hpp>
Inheritance diagram for AbstractDOMParser:
Public Types | |
Val_Never | |
Val_Always | |
Val_Auto | |
Public constants | |
enum | ValSchemes { Val_Never, Val_Always, Val_Auto } |
Public Member Functions | |
Destructor | |
virtual | ~AbstractDOMParser () |
Utility methods | |
void | reset () |
DOMDocument * | adoptDocument () |
Getter methods | |
DOMDocument * | getDocument () |
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 |
XMLCh * | getExternalSchemaLocation () const |
XMLCh * | getExternalNoNamespaceSchemaLocation () const |
SecurityManager * | getSecurityManager () const |
bool | getLoadExternalDTD () const |
bool | getCreateCommentNodes () const |
bool | getCalculateSrcOfs () const |
bool | getStandardUriConformant () const |
Setter methods | |
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 | setExternalSchemaLocation (const XMLCh *const schemaLocation) |
void | setExternalSchemaLocation (const char *const schemaLocation) |
void | setExternalNoNamespaceSchemaLocation (const XMLCh *const noNamespaceSchemaLocation) |
void | setExternalNoNamespaceSchemaLocation (const char *const noNamespaceSchemaLocation) |
void | setSecurityManager (SecurityManager *const securityManager) |
void | setLoadExternalDTD (const bool newState) |
void | setCreateCommentNodes (const bool create) |
void | setCalculateSrcOfs (const bool newState) |
void | setStandardUriConformant (const bool newState) |
void | useScanner (const XMLCh *const scannerName) |
Parsing methods | |
void | parse (const InputSource &source) |
void | parse (const XMLCh *const systemId) |
void | parse (const char *const systemId) |
bool | parseFirst (const XMLCh *const systemId, XMLPScanToken &toFill) |
bool | parseFirst (const char *const systemId, XMLPScanToken &toFill) |
bool | parseFirst (const InputSource &source, XMLPScanToken &toFill) |
bool | parseNext (XMLPScanToken &token) |
void | parseReset (XMLPScanToken &token) |
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, const XMLCh *const elemPrefix) |
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 DocTypeHandler Interfaces | |
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, const bool hasExtSubset=false) |
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) |
Deprecated Methods | |
bool | getDoValidation () const |
void | setDoValidation (const bool newState) |
bool | getExpandEntityReferences () const |
void | setExpandEntityReferences (const bool expand) |
Protected Member Functions | |
Constructors | |
AbstractDOMParser (XMLValidator *const valToAdopt=0, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) | |
Protected getter methods | |
DOMNode * | getCurrentNode () |
XMLScanner * | getScanner () const |
GrammarResolver * | getGrammarResolver () const |
bool | getParseInProgress () const |
MemoryManager * | getMemoryManager () const |
Protected setter methods | |
void | setCurrentNode (DOMNode *toSet) |
void | setDocument (DOMDocument *toSet) |
void | setParseInProgress (const bool toSet) |
Protected helper methods | |
virtual DOMElement * | createElementNSNode (const XMLCh *fNamespaceURI, const XMLCh *qualifiedName) |
void | resetPool () |
bool | isDocumentAdopted () const |
Private Member Functions | |
void | initialize () |
void | cleanUp () |
Private Attributes | |
bool | fCreateEntityReferenceNodes |
bool | fIncludeIgnorableWhitespace |
bool | fWithinElement |
bool | fParseInProgress |
bool | fCreateCommentNodes |
bool | fDocumentAdoptedByUser |
XMLScanner * | fScanner |
DOMNode * | fCurrentParent |
DOMNode * | fCurrentNode |
DOMEntity * | fCurrentEntity |
DOMDocumentImpl * | fDocument |
ValueStackOf< DOMNode * > * | fNodeStack |
DOMDocumentTypeImpl * | fDocumentType |
RefVectorOf< DOMDocumentImpl > * | fDocumentVector |
GrammarResolver * | fGrammarResolver |
XMLStringPool * | fURIStringPool |
XMLValidator * | fValidator |
MemoryManager * | fMemoryManager |
XMLBufferMgr | fBufMgr |
XMLBuffer & | fInternalSubset |
Definition at line 91 of file AbstractDOMParser.hpp.
ValScheme enum used in setValidationScheme Val_Never: Do not report validation errors. Val_Always: The parser will always report validation errors. Val_Auto: The parser will report validation errors only if a grammar is specified.
Definition at line 113 of file AbstractDOMParser.hpp.
virtual AbstractDOMParser::~AbstractDOMParser | ( | ) | [virtual] |
Destructor
AbstractDOMParser::AbstractDOMParser | ( | XMLValidator *const | valToAdopt = 0 , |
|
MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager | |||
) | [protected] |
Construct a AbstractDOMParser, 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.
valToAdopt | Pointer to the validator instance to use. The parser is responsible for freeing the memory. |
DOMDocument* AbstractDOMParser::adoptDocument | ( | ) |
Adopt the DOM document
This method returns the DOMDocument object representing the root of the document tree.
The caller will adopt the DOMDocument and thus is responsible to call DOMDocument::release() to release the associated memory. The parser will not delete it. The ownership is transferred from the parser to the caller.
virtual void AbstractDOMParser::attDef | ( | const DTDElementDecl & | elemDecl, | |
const DTDAttDef & | attDef, | |||
const bool | ignoring | |||
) | [virtual] |
Implements DocTypeHandler.
void AbstractDOMParser::cleanUp | ( | ) | [private] |
virtual DOMElement* AbstractDOMParser::createElementNSNode | ( | const XMLCh * | fNamespaceURI, | |
const XMLCh * | qualifiedName | |||
) | [protected, virtual] |
virtual void AbstractDOMParser::docCharacters | ( | const XMLCh *const | chars, | |
const unsigned int | length, | |||
const bool | cdataSection | |||
) | [virtual] |
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.
chars | A const pointer to a Unicode string representing the character data. | |
length | The length of the Unicode string returned in 'chars'. | |
cdataSection | A flag indicating if the characters represent content from the CDATA section. |
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::docComment | ( | const XMLCh *const | comment | ) | [virtual] |
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.
comment | A const pointer to a null terminated Unicode string representing the comment text. |
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::docPI | ( | const XMLCh *const | target, | |
const XMLCh *const | data | |||
) | [virtual] |
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.
target | A const pointer to a Unicode string representing the target of the PI declaration. | |
data | A const pointer to a Unicode string representing the data of the PI declaration. See the PI production rule in the XML specification for details. |
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::doctypeComment | ( | const XMLCh *const | comment | ) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::doctypeDecl | ( | const DTDElementDecl & | elemDecl, | |
const XMLCh *const | publicId, | |||
const XMLCh *const | systemId, | |||
const bool | hasIntSubset, | |||
const bool | hasExtSubset = false | |||
) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::doctypePI | ( | const XMLCh *const | target, | |
const XMLCh *const | data | |||
) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::doctypeWhitespace | ( | const XMLCh *const | chars, | |
const unsigned int | length | |||
) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::elementDecl | ( | const DTDElementDecl & | decl, | |
const bool | isIgnored | |||
) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::endAttList | ( | const DTDElementDecl & | elemDecl | ) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::endDocument | ( | ) | [virtual] |
Handle the end of document event
This method is used to indicate the end of the current document.
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::endElement | ( | const XMLElementDecl & | elemDecl, | |
const unsigned int | urlId, | |||
const bool | isRoot, | |||
const XMLCh *const | elemPrefix | |||
) | [virtual] |
Handle and end of element event
This method is used to indicate the end tag of an element. The DOM parser pops the current element off the top of the element stack, and make it the new current element.
elemDecl | A const reference to the object containing element declaration information. | |
urlId | An id referring to the namespace prefix, if namespaces setting is switched on. | |
isRoot | A flag indicating whether this element was the root element. | |
elemPrefix | A const pointer to a Unicode string containing the namespace prefix for this element. Applicable only when namespace processing is enabled. |
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::endEntityReference | ( | const XMLEntityDecl & | entDecl | ) | [virtual] |
Handle and end of entity reference event
This method is used to indicate that an end of an entity reference was just scanned.
entDecl | A const reference to the object containing the entity declaration information. |
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::endExtSubset | ( | ) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::endIntSubset | ( | ) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::entityDecl | ( | const DTDEntityDecl & | entityDecl, | |
const bool | isPEDecl, | |||
const bool | isIgnored | |||
) | [virtual] |
Implements DocTypeHandler.
bool AbstractDOMParser::getCalculateSrcOfs | ( | ) | const |
Get the 'calculate src offset flag'
This method returns the state of the parser's src offset calculation when parsing an XML document.
bool AbstractDOMParser::getCreateCommentNodes | ( | ) | const [inline] |
Get the 'create comment node' flag
This method returns the flag that specifies whether the parser is creating comment nodes in the DOM tree being produced.
Definition at line 1528 of file AbstractDOMParser.hpp.
References fCreateCommentNodes.
bool AbstractDOMParser::getCreateEntityReferenceNodes | ( | ) | const [inline] |
Get the 'include entity references' flag
This method returns the flag that specifies whether the parser is creating entity reference nodes in the DOM tree being produced.
Definition at line 1503 of file AbstractDOMParser.hpp.
References fCreateEntityReferenceNodes.
DOMNode * AbstractDOMParser::getCurrentNode | ( | ) | [inline, protected] |
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.
Definition at line 1560 of file AbstractDOMParser.hpp.
References fCurrentNode.
DOMDocument* AbstractDOMParser::getDocument | ( | ) |
Get the DOM document
This method returns the DOMDocument object representing the root of the document tree. This object provides the primary access to the document's data.
The returned DOMDocument object is owned by the parser.
bool AbstractDOMParser::getDoNamespaces | ( | ) | const |
Get the 'do namespaces' flag
This method returns the state of the parser's namespace processing flag.
bool AbstractDOMParser::getDoSchema | ( | ) | const |
Get the 'do schema' flag
This method returns the state of the parser's schema processing flag.
bool AbstractDOMParser::getDoValidation | ( | ) | const |
This method returns the state of the parser's validation handling flag which controls whether validation checks are enforced or not.
int AbstractDOMParser::getErrorCount | ( | ) | const |
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.
bool AbstractDOMParser::getExitOnFirstFatalError | ( | ) | const |
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.
bool AbstractDOMParser::getExpandEntityReferences | ( | ) | const [inline] |
Get the 'expand entity references' flag. DEPRECATED Use getCreateEntityReferenceNodes() instead.
This method returns the state of the parser's expand entity references flag.
Definition at line 1499 of file AbstractDOMParser.hpp.
References fCreateEntityReferenceNodes.
XMLCh* AbstractDOMParser::getExternalNoNamespaceSchemaLocation | ( | ) | const |
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.
XMLCh* AbstractDOMParser::getExternalSchemaLocation | ( | ) | const |
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.
GrammarResolver * AbstractDOMParser::getGrammarResolver | ( | ) | const [inline, protected] |
Get the Grammar resolver
This provides derived classes with access to the grammar resolver.
Definition at line 1523 of file AbstractDOMParser.hpp.
References fGrammarResolver.
bool AbstractDOMParser::getIncludeIgnorableWhitespace | ( | ) | const [inline] |
Get the 'include ignorable whitespace' flag.
This method returns the state of the parser's include ignorable whitespace flag.
Definition at line 1508 of file AbstractDOMParser.hpp.
References fIncludeIgnorableWhitespace.
bool AbstractDOMParser::getLoadExternalDTD | ( | ) | const |
Get the 'Loading External DTD' flag
This method returns the state of the parser's loading external DTD flag.
MemoryManager * AbstractDOMParser::getMemoryManager | ( | ) | const [inline, protected] |
bool AbstractDOMParser::getParseInProgress | ( | ) | const [inline, protected] |
Get the parse in progress flag
This provides derived classes with access to the parse in progress flag.
Definition at line 1513 of file AbstractDOMParser.hpp.
References fParseInProgress.
XMLScanner * AbstractDOMParser::getScanner | ( | ) | const [inline, protected] |
Get the XML scanner
This provides derived classes with access to the XML scanner.
Definition at line 1518 of file AbstractDOMParser.hpp.
References fScanner.
SecurityManager* AbstractDOMParser::getSecurityManager | ( | ) | const |
Get the SecurityManager instance attached to this parser.
This method returns the security manager that was specified using setSecurityManager.
The SecurityManager instance must have been specified by the application; this should not be deleted until after the parser has been deleted (or a new SecurityManager instance has been supplied to the parser).
bool AbstractDOMParser::getStandardUriConformant | ( | ) | const |
Get the 'force standard uri flag'
This method returns the state if the parser forces standard uri
bool AbstractDOMParser::getValidationConstraintFatal | ( | ) | const |
This method returns the state of the parser's validation-constraint-fatal flag.
bool AbstractDOMParser::getValidationSchemaFullChecking | ( | ) | const |
Get the 'full schema constraint checking' flag
This method returns the state of the parser's full schema constraint checking flag.
ValSchemes AbstractDOMParser::getValidationScheme | ( | ) | const |
This method returns an enumerated value that indicates the current validation scheme set on this parser.
const XMLValidator& AbstractDOMParser::getValidator | ( | ) | const |
Get a const reference to the validator
This method returns a reference to the parser's installed validator.
virtual void AbstractDOMParser::ignorableWhitespace | ( | const XMLCh *const | chars, | |
const unsigned int | length, | |||
const bool | cdataSection | |||
) | [virtual] |
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 DOMNode::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.
chars | A const pointer to a Unicode string representing the ignorable whitespace character data. | |
length | The length of the Unicode string 'chars'. | |
cdataSection | A flag indicating if the characters represent content from the CDATA section. |
Implements XMLDocumentHandler.
void AbstractDOMParser::initialize | ( | ) | [private] |
bool AbstractDOMParser::isDocumentAdopted | ( | ) | const [protected] |
Returns true if the user has adopted the document
virtual void AbstractDOMParser::notationDecl | ( | const XMLNotationDecl & | notDecl, | |
const bool | isIgnored | |||
) | [virtual] |
Implements DocTypeHandler.
void AbstractDOMParser::parse | ( | const char *const | systemId | ) |
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'.
systemId | A const char pointer to a native string which contains the path to the XML file to be parsed. |
SAXException | Any SAX exception, possibly wrapping another exception. | |
XMLException | An exception from the parser or client handler code. | |
DOMException | A DOM exception as per DOM spec. |
void AbstractDOMParser::parse | ( | const XMLCh *const | 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.
systemId | A const XMLCh pointer to the Unicode string which contains the path to the XML file to be parsed. |
SAXException | Any SAX exception, possibly wrapping another exception. | |
XMLException | An exception from the parser or client handler code. | |
DOMException | A DOM exception as per DOM spec. |
void AbstractDOMParser::parse | ( | const InputSource & | source | ) |
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.
source | A const reference to the InputSource object which points to the XML file to be parsed. |
SAXException | Any SAX exception, possibly wrapping another exception. | |
XMLException | An exception from the parser or client handler code. | |
DOMException | A DOM exception as per DOM spec. |
bool AbstractDOMParser::parseFirst | ( | const InputSource & | source, | |
XMLPScanToken & | toFill | |||
) |
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.
source | A const reference to the InputSource object which points to the XML file to be parsed. | |
toFill | A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls. |
parseFirst(XMLCh*,...)
parseFirst(char*,...)
bool AbstractDOMParser::parseFirst | ( | const char *const | systemId, | |
XMLPScanToken & | toFill | |||
) |
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.
systemId | A pointer to a regular native string represting the path to the XML file to be parsed. | |
toFill | A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls. |
parseFirst(XMLCh*,...)
parseFirst(InputSource&,...)
bool AbstractDOMParser::parseFirst | ( | const XMLCh *const | systemId, | |
XMLPScanToken & | toFill | |||
) |
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.
systemId | A pointer to a Unicode string represting the path to the XML file to be parsed. | |
toFill | A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls. |
parseFirst(char*,...)
parseFirst(InputSource&,...)
bool AbstractDOMParser::parseNext | ( | XMLPScanToken & | token | ) |
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).
token | A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls. |
parseFirst(char*,...)
parseFirst(InputSource&,...)
void AbstractDOMParser::parseReset | ( | XMLPScanToken & | token | ) |
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.
token | A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls. |
parseFirst(char*,...)
parseFirst(InputSource&,...)
void AbstractDOMParser::reset | ( | ) |
Reset the parser
This method resets the state of the DOM driver and makes it ready for a fresh parse run.
virtual void AbstractDOMParser::resetDocType | ( | ) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::resetDocument | ( | ) | [virtual] |
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.
void AbstractDOMParser::resetPool | ( | ) | [protected] |
void AbstractDOMParser::setCalculateSrcOfs | ( | const bool | newState | ) |
Enable/disable src offset calculation
This method allows users to enable/disable src offset calculation. Disabling the calculation will improve performance.
The parser's default state is: false.
newState | The value specifying whether we should enable or disable src offset calculation |
void AbstractDOMParser::setCreateCommentNodes | ( | const bool | create | ) | [inline] |
Set the 'create comment nodes' flag
This method allows the user to specify whether the parser should create comment nodes in the DOM tree being produced.
The default value is 'true'.
create | The new state of the create comment nodes flag. |
Definition at line 1551 of file AbstractDOMParser.hpp.
References fCreateCommentNodes.
void AbstractDOMParser::setCreateEntityReferenceNodes | ( | const bool | create | ) | [inline] |
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 parser will create EntityReference nodes in the DOM tree. The EntityReference nodes and their child nodes will be read-only. When the 'create' flag is false, no EntityReference nodes will be created.
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.
The default value is 'true'.
create | The new state of the create entity reference nodes flag. |
Definition at line 1541 of file AbstractDOMParser.hpp.
References fCreateEntityReferenceNodes.
void AbstractDOMParser::setCurrentNode | ( | DOMNode * | toSet | ) | [inline, protected] |
Set the current DOM node
This method sets the current node maintained inside the parser to the one specified.
toSet | The DOM node which will be the current node. |
Definition at line 1573 of file AbstractDOMParser.hpp.
References fCurrentNode.
void AbstractDOMParser::setDocument | ( | DOMDocument * | toSet | ) | [inline, protected] |
Set the document node
This method sets the DOM Document node to the one specified.
toSet | The new DOM Document node for this XML document. |
Definition at line 1578 of file AbstractDOMParser.hpp.
References fDocument.
void AbstractDOMParser::setDoNamespaces | ( | const bool | newState | ) |
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.
newState | The value specifying whether NameSpace rules should be enforced or not. |
void AbstractDOMParser::setDoSchema | ( | const bool | newState | ) |
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.
Note: If set to true, namespace processing must also be turned on.
newState | The value specifying whether schema support should be enforced or not. |
void AbstractDOMParser::setDoValidation | ( | const bool | newState | ) |
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.
newState | The value specifying whether the parser should do validity checks or not against the DTD in the input XML document. |
void AbstractDOMParser::setExitOnFirstFatalError | ( | const bool | newState | ) |
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.
newState | The value specifying whether the parser should continue or exit when it encounters the first fatal error. |
void AbstractDOMParser::setExpandEntityReferences | ( | const bool | expand | ) | [inline] |
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.
The default value is 'false'.
expand | The new state of the expand entity reference flag. |
Definition at line 1536 of file AbstractDOMParser.hpp.
References fCreateEntityReferenceNodes.
void AbstractDOMParser::setExternalNoNamespaceSchemaLocation | ( | const char *const | noNamespaceSchemaLocation | ) |
This method is same as setExternalNoNamespaceSchemaLocation(const XMLCh* const). It takes native char string as parameter
noNamespaceSchemaLocation | the XML Schema Location with no target namespace |
void AbstractDOMParser::setExternalNoNamespaceSchemaLocation | ( | const XMLCh *const | noNamespaceSchemaLocation | ) |
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".
noNamespaceSchemaLocation | the XML Schema Location with no target namespace |
void AbstractDOMParser::setExternalSchemaLocation | ( | const char *const | schemaLocation | ) |
This method is same as setExternalSchemaLocation(const XMLCh* const). It takes native char string as parameter
schemaLocation | the list of schemas to use |
void AbstractDOMParser::setExternalSchemaLocation | ( | const XMLCh *const | schemaLocation | ) |
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.
schemaLocation | the list of schemas to use |
void AbstractDOMParser::setIncludeIgnorableWhitespace | ( | const bool | include | ) | [inline] |
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 DOMText::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.
include | The new state of the include ignorable whitespace flag. |
Definition at line 1546 of file AbstractDOMParser.hpp.
References fIncludeIgnorableWhitespace.
void AbstractDOMParser::setLoadExternalDTD | ( | const bool | newState | ) |
Set the 'Loading External DTD' flag
This method allows users to enable or disable the loading of external DTD. When set to false, the parser will ignore any external DTD completely if the validationScheme is set to Val_Never.
The parser's default state is: true.
This flag is ignored if the validationScheme is set to Val_Always or Val_Auto.
newState | The value specifying whether external DTD should be loaded or not. |
void AbstractDOMParser::setParseInProgress | ( | const bool | toSet | ) | [inline, protected] |
Set the parse in progress flag
This method sets the parse in progress flag to true or false.
toSet | The value of the flag to be set. |
Definition at line 1583 of file AbstractDOMParser.hpp.
References fParseInProgress.
void AbstractDOMParser::setSecurityManager | ( | SecurityManager *const | securityManager | ) |
This allows an application to set a SecurityManager on the parser; this object stores information that various components use to limit their consumption of system resources while processing documents.
If this method is called more than once, only the last one takes effect. It may not be reset during a parse.
securityManager | the SecurityManager instance to be used by this parser |
void AbstractDOMParser::setStandardUriConformant | ( | const bool | newState | ) |
Force standard uri
This method allows users to tell the parser to force standard uri conformance.
The parser's default state is: false.
newState | The value specifying whether the parser should reject malformed URI. |
void AbstractDOMParser::setValidationConstraintFatal | ( | const bool | newState | ) |
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 will treat validation error as fatal and will exit depends on the state of "getExitOnFirstFatalError". If false, then it will report the error and continue processing.
Note: setting this true does not mean the validation error will be printed with the word "Fatal Error". It is still printed as "Error", but the parser will exit if "setExitOnFirstFatalError" is set to true.
The default value is 'false'.
newState | If true, the parser will exit if "setExitOnFirstFatalError" is set to true. |
void AbstractDOMParser::setValidationSchemaFullChecking | ( | const bool | schemaFullChecking | ) |
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.
schemaFullChecking | True to turn on full schema constraint checking. |
void AbstractDOMParser::setValidationScheme | ( | const ValSchemes | newScheme | ) |
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:
Val_Never - turn off validation
Val_Always - turn on validation
Val_Auto - turn on validation if any internal/external DTD subset have been seen
The parser's default state is: Val_Auto.
newScheme | The new validation scheme to use. |
virtual void AbstractDOMParser::startAttList | ( | const DTDElementDecl & | elemDecl | ) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::startDocument | ( | ) | [virtual] |
Handle a start document event
This method is used to report the start of the parsing process.
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::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] |
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.)
elemDecl | A const reference to the object containing element declaration information. | |
urlId | An id referring to the namespace prefix, if namespaces setting is switched on. | |
elemPrefix | A const pointer to a Unicode string containing the namespace prefix for this element. Applicable only when namespace processing is enabled. | |
attrList | A const reference to the object containing the list of attributes just scanned for this element. | |
attrCount | A count of number of attributes in the list specified by the parameter 'attrList'. | |
isEmpty | A flag indicating whether this is an empty element or not. If empty, then no endElement() call will be made. | |
isRoot | A flag indicating whether this element was the root element. |
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::startEntityReference | ( | const XMLEntityDecl & | entDecl | ) | [virtual] |
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.
entDecl | A const reference to the object containing the entity declaration information. |
Implements XMLDocumentHandler.
virtual void AbstractDOMParser::startExtSubset | ( | ) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::startIntSubset | ( | ) | [virtual] |
Implements DocTypeHandler.
virtual void AbstractDOMParser::TextDecl | ( | const XMLCh *const | versionStr, | |
const XMLCh *const | encodingStr | |||
) | [virtual] |
Implements DocTypeHandler.
void AbstractDOMParser::useScanner | ( | const XMLCh *const | scannerName | ) |
Set the scanner to use when scanning the XML document
This method allows users to set the the scanner to use when scanning a given XML document.
scannerName | The name of the desired scanner |
virtual void AbstractDOMParser::XMLDecl | ( | const XMLCh *const | versionStr, | |
const XMLCh *const | encodingStr, | |||
const XMLCh *const | standaloneStr, | |||
const XMLCh *const | actualEncStr | |||
) | [virtual] |
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.
<font color="#FF0000">This method is a no-op for this DOM implementation.</font>
versionStr | A const pointer to a Unicode string representing version string value. | |
encodingStr | A const pointer to a Unicode string representing the encoding string value. | |
standaloneStr | A const pointer to a Unicode string representing the standalone string value. | |
actualEncStr | A const pointer to a Unicode string representing the actual encoding string value. |
Implements XMLDocumentHandler.
XMLBufferMgr AbstractDOMParser::fBufMgr [private] |
Definition at line 1490 of file AbstractDOMParser.hpp.
bool AbstractDOMParser::fCreateCommentNodes [private] |
Definition at line 1476 of file AbstractDOMParser.hpp.
Referenced by getCreateCommentNodes(), and setCreateCommentNodes().
bool AbstractDOMParser::fCreateEntityReferenceNodes [private] |
Definition at line 1472 of file AbstractDOMParser.hpp.
Referenced by getCreateEntityReferenceNodes(), getExpandEntityReferences(), setCreateEntityReferenceNodes(), and setExpandEntityReferences().
DOMEntity* AbstractDOMParser::fCurrentEntity [private] |
Definition at line 1481 of file AbstractDOMParser.hpp.
DOMNode* AbstractDOMParser::fCurrentNode [private] |
Definition at line 1480 of file AbstractDOMParser.hpp.
Referenced by getCurrentNode(), and setCurrentNode().
DOMNode* AbstractDOMParser::fCurrentParent [private] |
Definition at line 1479 of file AbstractDOMParser.hpp.
DOMDocumentImpl* AbstractDOMParser::fDocument [private] |
bool AbstractDOMParser::fDocumentAdoptedByUser [private] |
Definition at line 1477 of file AbstractDOMParser.hpp.
DOMDocumentTypeImpl* AbstractDOMParser::fDocumentType [private] |
Definition at line 1484 of file AbstractDOMParser.hpp.
RefVectorOf<DOMDocumentImpl>* AbstractDOMParser::fDocumentVector [private] |
Definition at line 1485 of file AbstractDOMParser.hpp.
GrammarResolver* AbstractDOMParser::fGrammarResolver [private] |
bool AbstractDOMParser::fIncludeIgnorableWhitespace [private] |
Definition at line 1473 of file AbstractDOMParser.hpp.
Referenced by getIncludeIgnorableWhitespace(), and setIncludeIgnorableWhitespace().
XMLBuffer& AbstractDOMParser::fInternalSubset [private] |
Definition at line 1491 of file AbstractDOMParser.hpp.
MemoryManager* AbstractDOMParser::fMemoryManager [private] |
ValueStackOf<DOMNode*>* AbstractDOMParser::fNodeStack [private] |
Definition at line 1483 of file AbstractDOMParser.hpp.
bool AbstractDOMParser::fParseInProgress [private] |
Definition at line 1475 of file AbstractDOMParser.hpp.
Referenced by getParseInProgress(), and setParseInProgress().
XMLScanner* AbstractDOMParser::fScanner [private] |
XMLStringPool* AbstractDOMParser::fURIStringPool [private] |
Definition at line 1487 of file AbstractDOMParser.hpp.
XMLValidator* AbstractDOMParser::fValidator [private] |
Definition at line 1488 of file AbstractDOMParser.hpp.
bool AbstractDOMParser::fWithinElement [private] |
Definition at line 1474 of file AbstractDOMParser.hpp.