XML for Java 2.0.15

com.ibm.xml.parsers
Class TXRevalidatingDOMParser

java.lang.Object
  |
  +--com.ibm.xml.framework.XMLParser
        |
        +--com.ibm.xml.parsers.NonValidatingTXDOMParser
              |
              +--com.ibm.xml.parsers.TXDOMParser
                    |
                    +--com.ibm.xml.parsers.TXRevalidatingDOMParser

public class TXRevalidatingDOMParser
extends TXDOMParser

This class is a validating DOM parser which can also "revalidate" a DOM subtree after the document has been parsed.

Version:
Revision: 70 1.8 src/com/ibm/xml/parsers/TXRevalidatingDOMParser.java, parser, xml4j2, xml4j2_0_15
See Also:
TXDOMParser

Fields inherited from class com.ibm.xml.parsers.NonValidatingTXDOMParser
DEBUG, fCurrentNode, fCurrentParent, fDocument, fDocumentClass, fDocumentType, fEntityPool, fExpandEntityReferences, fNodeStack, fNormalizeTextNodes, fRootElementName, fWithinElement
 
Fields inherited from class com.ibm.xml.framework.XMLParser
fLocale, fNeedReset, fParseInProgress, fResourceBundle, fScanner
 
Constructor Summary
TXRevalidatingDOMParser()
           
 
Method Summary
 Node getErrorElement()
          Returns the element of the last error.
 Node validate(Node node)
          Given a node which is a DOM tree (or subtree), validate the tree against the current DTD.
 
Methods inherited from class com.ibm.xml.parsers.TXDOMParser
reset, resetOrCopy
 
Methods inherited from class com.ibm.xml.parsers.NonValidatingTXDOMParser
attlistDecl, buildCMNode, characters, characters, checkHandlers, comment, doctypeDecl, elementDecl, endDocument, endElement, endEntityReference, endExternalSubset, endInternalSubset, externalEntityDecl, getDocument, getExpandEntityReferences, ignorableWhitespace, ignorableWhitespace, init, internalEntityDecl, notationDecl, parameterEntityDecl, processingInstruction, setDocumentClass, setExpandEntityReferences, setNormalizeTextNodes, startDocument, startElement, startEntityReference, startExternalSubset, startInternalSubset, unparsedEntityDecl
 
Methods inherited from class com.ibm.xml.framework.XMLParser
error, error1, error2, error3, error4, errorHandlingEnabled, getAllowJavaEncodingName, getCheckNamespace, getContinueAfterFatalError, getDocumentHandler, getDocumentTypeHandler, getEntityHandler, getErrorHandler, getErrorMsgString, getLocator, getParserState, getScanner, getValidationHandler, getWarningOnDuplicateAttDef, handleError, isFatal, isWarning, loadCatalog, parse, parse, sendCharDataAsCharArray, setAllowJavaEncodingName, setCheckNamespace, setContinueAfterFatalError, setDocumentHandler, setDocumentHandler, setDocumentTypeHandler, setDTDHandler, setEntityHandler, setEntityResolver, setErrorHandler, setLocale, setValidationHandler, setWarningOnDuplicateAttDef, useDefaultValidationHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TXRevalidatingDOMParser

public TXRevalidatingDOMParser()
Method Detail

getErrorElement

public Node getErrorElement()
Returns the element of the last error. Note: This method only returns non-null if the last erroneous node was of type Node.ATTRIBUTE_NODE.

validate

public Node validate(Node node)
Given a node which is a DOM tree (or subtree), validate the tree against the current DTD. If the tree is valid, return null. If the subtree is invalid return the highest (closest to the root) and left most node which causes the tree to be invalid.

If the node returned from this method is of type Node.ATTRIBUTE_NODE, the attribute's element can be queried by calling the getErrorElement() method.

Parameters:
node - The node representing the root of the DOM subtree to be revalidated.
Returns:
null if the subtree is valid or the first (highest and leftmost) node where the tree is invalid.

XML for Java 2.0.15