org.apache.xerces.validators.common
Class XMLValidator

java.lang.Object
  |
  +--org.apache.xerces.validators.common.XMLValidator
All Implemented Interfaces:
DefaultEntityHandler.EventHandler, FieldActivator, NamespacesScope.NamespacesHandler, XMLDocumentScanner.EventHandler, XMLEntityHandler.CharDataHandler

public final class XMLValidator
extends java.lang.Object
implements DefaultEntityHandler.EventHandler, XMLEntityHandler.CharDataHandler, XMLDocumentScanner.EventHandler, NamespacesScope.NamespacesHandler, FieldActivator

This class is the super all-in-one validator used by the parser.

Version:
$Id: XMLValidator.java 317893 2001-11-07 20:08:49Z neilg $

Inner Class Summary
static interface XMLValidator.AttributeValidator
          AttributeValidator.
protected  class XMLValidator.KeyRefValueStore
          Key reference value store.
protected  class XMLValidator.KeyValueStore
          Key value store.
protected  class XMLValidator.UniqueValueStore
          Unique value store.
protected  class XMLValidator.ValueStoreBase
          Value store implementation base class.
protected  class XMLValidator.ValueStoreCache
          Value store cache.
protected static class XMLValidator.XPathMatcherStack
          Stack of XPath matchers for identity constraints.
 
Field Summary
protected static boolean DEBUG_IDENTITY_CONSTRAINTS
          Compile to true to debug identity constraints.
protected static boolean DEBUG_VALUE_STORES
          Compile to true to debug value stores.
protected static java.lang.Object fgNullObject
           
protected  XMLValidator.XPathMatcherStack fMatcherStack
          Stack of active XPath matchers for identity constraints.
protected  SubstitutionGroupComparator fSGComparator
           
protected  XMLValidator.ValueStoreCache fValueStoreCache
          Cache of value stores for identity constraint fields.
protected  java.util.Hashtable UPACheckedGrammarURIs
           
 
Constructor Summary
XMLValidator(StringPool stringPool, XMLErrorReporter errorReporter, DefaultEntityHandler entityHandler, XMLDocumentScanner documentScanner)
          Constructs an XML validator.
 
Method Summary
 XPathMatcher activateField(Field field)
          Request to activate the specified field.
 boolean attribute(QName element, QName attrName, int attrValue)
          Signal the scanning of an attribute associated to the previous start element tag.
 void callCharacters(int ch)
          Call characters.
 void callComment(int comment)
          Call comment.
 void callEndCDATA()
          Call end CDATA section.
 void callEndDocument()
          Call end document.
 void callEndElement(int readerId)
          Call end element.
 void callProcessingInstruction(int target, int data)
          Call processing instruction.
 void callStandaloneIsYes()
          Signal standalone = "yes"
 void callStartCDATA()
          Call start CDATA section.
 void callStartDocument()
          Call start document.
 void callStartElement(QName element)
          Call start element.
 void callTextDecl(int version, int encoding)
          Call text declaration.
 void callXMLDecl(int version, int encoding, int standalone)
          Call XML declaration.
 void element(QName element)
          Signal the scanning of an element name in a start element tag.
 void endEntityReference(int entityName, int entityType, int entityContext)
          End entity reference.
 void endNamespaceDeclScope(int prefix)
          End a namespace declaration scope.
 void endValueScopeFor(IdentityConstraint identityConstraint)
          Ends the value scope for the specified identity constraint.
 boolean externalEntityStandaloneCheck()
          External entity standalone check.
protected  boolean getAttDefIsExternal(QName element, QName attribute)
          Protected for use by AttributeValidator classes.
 int getContentSpecHandle(int elementIndex)
          Returns the content spec handle for an element index.
 int getContentSpecType(int elementIndex)
          Returns the content spec type for an element index.
 boolean getDynamicValidationEnabled()
          Returns true if validation is dynamic.
 java.lang.String getExternalNoNamespaceSchema()
           
 java.lang.String getExternalSchemas()
           
 boolean getLoadDTDGrammar()
          Returns fLoadDTDGrammar
 boolean getNamespacesEnabled()
          Returns true if namespaces are enabled.
 boolean getNormalizeConents()
           
 boolean getSchemaFullCheckingEnabled()
          Returns true if full Schema checking is on.
 boolean getSchemaValidationEnabled()
          Returns true if Schema support is on.
 boolean getValidating()
          Return true if validating.
 boolean getValidationEnabled()
          Returns true if validation is enabled.
 boolean getWarningOnDuplicateAttDef()
          Returns true if duplicate attribute definitions signal a warning.
 boolean getWarningOnUndeclaredElements()
          Returns true if undeclared elements signal a warning.
 void initHandlers(boolean sendCharDataAsCharArray, XMLDocumentHandler docHandler, XMLDocumentHandler.DTDHandler dtdHandler)
          Set char data processing preference and handlers.
 void processCharacters(char[] chars, int offset, int length)
          Process characters.
 void processCharacters(int data)
          Process characters.
 void processWhitespace(char[] chars, int offset, int length)
          Process whitespace.
 void processWhitespace(int data)
          Process whitespace.
protected  void reportRecoverableXMLError(int majorCode, int minorCode)
          Report a recoverable xml error.
protected  void reportRecoverableXMLError(int majorCode, int minorCode, int stringIndex1)
          Report a recoverable xml error.
protected  void reportRecoverableXMLError(int majorCode, int minorCode, int stringIndex1, int stringIndex2)
          Report a recoverable xml error.
protected  void reportRecoverableXMLError(int majorCode, int minorCode, java.lang.String string1)
          Report a recoverable xml error.
protected  void reportRecoverableXMLError(int majorCode, int minorCode, java.lang.String string1, java.lang.String string2)
          Report a recoverable xml error.
protected  void reportRecoverableXMLError(int majorCode, int minorCode, java.lang.String string1, java.lang.String string2, java.lang.String string3)
          Report a recoverable xml error.
 void reset(StringPool stringPool)
          Reset.
 void resetOrCopy(StringPool stringPool)
          Reset or copy.
 void scanAttributeName(XMLEntityHandler.EntityReader entityReader, QName element, QName attribute)
          Scans attribute name.
 void scanElementType(XMLEntityHandler.EntityReader entityReader, char fastchar, QName element)
          Scans element type.
 boolean scanExpectedElementType(XMLEntityHandler.EntityReader entityReader, char fastchar, QName element)
          Scans expected element type.
 void sendEndOfInputNotifications(int entityName, boolean moreToFollow)
          Send end of input notification.
 void sendReaderChangeNotifications(XMLEntityHandler.EntityReader reader, int readerId)
          Send reader change notifications.
 void setDynamicValidationEnabled(boolean flag)
          Sets whether validation is dynamic.
 void setExternalNoNamespaceSchema(java.lang.Object value)
           
 void setExternalSchemas(java.lang.Object value)
           
 void setGrammarResolver(GrammarResolver grammarResolver)
           
 void setLoadDTDGrammar(boolean loadDG)
          Sets fLoadDTDGrammar when validation is off
 void setNamespacesEnabled(boolean flag)
          Sets whether namespaces are enabled.
 void setNormalizeAttributeValues(boolean normalize)
          Sets fNormalizeAttributeValues
 void setNormalizeContents(boolean normalize)
          Sets fNormalizeContents
 void setRootElementType(QName rootElement)
          Sets the root element.
 void setSchemaFullCheckingEnabled(boolean flag)
          Sets whether full Schema error checking is on/off
 void setSchemaValidationEnabled(boolean flag)
          Sets whether Schema support is on/off.
 void setValidationEnabled(boolean flag)
          Turning on validation/dynamic turns on validation if it is off, and this is remembered.
 void setWarningOnDuplicateAttDef(boolean flag)
          Sets whether duplicate attribute definitions signal a warning.
 void setWarningOnUndeclaredElements(boolean flag)
          Sets whether undeclared elements signal a warning.
 void startEntityReference(int entityName, int entityType, int entityContext)
          Start entity reference.
 void startNamespaceDeclScope(int prefix, int uri)
          Start a new namespace declaration scope.
 void startValueScopeFor(IdentityConstraint identityConstraint)
          Start the value scope for the specified identity constraint.
protected  int whatCanGoHere(int elementIndex, boolean fullyValid, InsertableElementsInfo info)
          Returns information about which elements can be placed at a particular point in the passed element's content model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_IDENTITY_CONSTRAINTS

protected static final boolean DEBUG_IDENTITY_CONSTRAINTS
Compile to true to debug identity constraints.

DEBUG_VALUE_STORES

protected static final boolean DEBUG_VALUE_STORES
Compile to true to debug value stores.

fMatcherStack

protected XMLValidator.XPathMatcherStack fMatcherStack
Stack of active XPath matchers for identity constraints. All active XPath matchers are notified of startElement, characters and endElement callbacks in order to perform their matches.

For each element with identity constraints, the selector of each identity constraint is activated. When the selector matches its XPath, then all the fields of the identity constraint are activated.

Note: Once the activation scope is left, the XPath matchers are automatically removed from the stack of active matchers and no longer receive callbacks.


fValueStoreCache

protected XMLValidator.ValueStoreCache fValueStoreCache
Cache of value stores for identity constraint fields.

fSGComparator

protected SubstitutionGroupComparator fSGComparator

UPACheckedGrammarURIs

protected java.util.Hashtable UPACheckedGrammarURIs

fgNullObject

protected static java.lang.Object fgNullObject
Constructor Detail

XMLValidator

public XMLValidator(StringPool stringPool,
                    XMLErrorReporter errorReporter,
                    DefaultEntityHandler entityHandler,
                    XMLDocumentScanner documentScanner)
Constructs an XML validator.
Method Detail

setGrammarResolver

public void setGrammarResolver(GrammarResolver grammarResolver)

initHandlers

public void initHandlers(boolean sendCharDataAsCharArray,
                         XMLDocumentHandler docHandler,
                         XMLDocumentHandler.DTDHandler dtdHandler)
Set char data processing preference and handlers.

resetOrCopy

public void resetOrCopy(StringPool stringPool)
                 throws java.lang.Exception
Reset or copy.

reset

public void reset(StringPool stringPool)
           throws java.lang.Exception
Reset.

setValidationEnabled

public void setValidationEnabled(boolean flag)
                          throws java.lang.Exception
Turning on validation/dynamic turns on validation if it is off, and this is remembered. Turning off validation DISABLES validation/dynamic if it is on. Turning off validation/dynamic DOES NOT turn off validation if it was explicitly turned on, only if it was turned on BECAUSE OF the call to turn validation/dynamic on. Turning on validation will REENABLE and turn validation/dynamic back on if it was disabled by a call that turned off validation while validation/dynamic was enabled.

getValidationEnabled

public boolean getValidationEnabled()
Returns true if validation is enabled.

setSchemaValidationEnabled

public void setSchemaValidationEnabled(boolean flag)
Sets whether Schema support is on/off.

getSchemaValidationEnabled

public boolean getSchemaValidationEnabled()
Returns true if Schema support is on.

setSchemaFullCheckingEnabled

public void setSchemaFullCheckingEnabled(boolean flag)
Sets whether full Schema error checking is on/off

setExternalSchemas

public void setExternalSchemas(java.lang.Object value)

setExternalNoNamespaceSchema

public void setExternalNoNamespaceSchema(java.lang.Object value)

getExternalSchemas

public java.lang.String getExternalSchemas()

getExternalNoNamespaceSchema

public java.lang.String getExternalNoNamespaceSchema()

getSchemaFullCheckingEnabled

public boolean getSchemaFullCheckingEnabled()
Returns true if full Schema checking is on.

setDynamicValidationEnabled

public void setDynamicValidationEnabled(boolean flag)
                                 throws java.lang.Exception
Sets whether validation is dynamic.

getDynamicValidationEnabled

public boolean getDynamicValidationEnabled()
Returns true if validation is dynamic.

setNormalizeAttributeValues

public void setNormalizeAttributeValues(boolean normalize)
Sets fNormalizeAttributeValues

setLoadDTDGrammar

public void setLoadDTDGrammar(boolean loadDG)
Sets fLoadDTDGrammar when validation is off

getLoadDTDGrammar

public boolean getLoadDTDGrammar()
Returns fLoadDTDGrammar

setNamespacesEnabled

public void setNamespacesEnabled(boolean flag)
Sets whether namespaces are enabled.

getNamespacesEnabled

public boolean getNamespacesEnabled()
Returns true if namespaces are enabled.

setWarningOnDuplicateAttDef

public void setWarningOnDuplicateAttDef(boolean flag)
Sets whether duplicate attribute definitions signal a warning.

getWarningOnDuplicateAttDef

public boolean getWarningOnDuplicateAttDef()
Returns true if duplicate attribute definitions signal a warning.

setWarningOnUndeclaredElements

public void setWarningOnUndeclaredElements(boolean flag)
Sets whether undeclared elements signal a warning.

getWarningOnUndeclaredElements

public boolean getWarningOnUndeclaredElements()
Returns true if undeclared elements signal a warning.

setNormalizeContents

public void setNormalizeContents(boolean normalize)
Sets fNormalizeContents

getNormalizeConents

public boolean getNormalizeConents()

startValueScopeFor

public void startValueScopeFor(IdentityConstraint identityConstraint)
                        throws java.lang.Exception
Start the value scope for the specified identity constraint. This method is called when the selector matches in order to initialize the value store.
Specified by:
startValueScopeFor in interface FieldActivator
Parameters:
identityConstraint - The identity constraint.

activateField

public XPathMatcher activateField(Field field)
                           throws java.lang.Exception
Request to activate the specified field. This method returns the matcher for the field.
Specified by:
activateField in interface FieldActivator
Parameters:
field - The field to activate.

endValueScopeFor

public void endValueScopeFor(IdentityConstraint identityConstraint)
                      throws java.lang.Exception
Ends the value scope for the specified identity constraint.
Specified by:
endValueScopeFor in interface FieldActivator
Parameters:
identityConstraint - The identity constraint.

startEntityReference

public void startEntityReference(int entityName,
                                 int entityType,
                                 int entityContext)
                          throws java.lang.Exception
Start entity reference.
Specified by:
startEntityReference in interface DefaultEntityHandler.EventHandler

endEntityReference

public void endEntityReference(int entityName,
                               int entityType,
                               int entityContext)
                        throws java.lang.Exception
End entity reference.
Specified by:
endEntityReference in interface DefaultEntityHandler.EventHandler

sendEndOfInputNotifications

public void sendEndOfInputNotifications(int entityName,
                                        boolean moreToFollow)
                                 throws java.lang.Exception
Send end of input notification.
Specified by:
sendEndOfInputNotifications in interface DefaultEntityHandler.EventHandler

sendReaderChangeNotifications

public void sendReaderChangeNotifications(XMLEntityHandler.EntityReader reader,
                                          int readerId)
                                   throws java.lang.Exception
Send reader change notifications.
Specified by:
sendReaderChangeNotifications in interface DefaultEntityHandler.EventHandler

externalEntityStandaloneCheck

public boolean externalEntityStandaloneCheck()
External entity standalone check.
Specified by:
externalEntityStandaloneCheck in interface DefaultEntityHandler.EventHandler

getValidating

public boolean getValidating()
Return true if validating.
Specified by:
getValidating in interface DefaultEntityHandler.EventHandler

processCharacters

public void processCharacters(char[] chars,
                              int offset,
                              int length)
                       throws java.lang.Exception
Process characters. Schema Normalization
Specified by:
processCharacters in interface XMLEntityHandler.CharDataHandler
Following copied from interface: org.apache.xerces.readers.XMLEntityHandler.CharDataHandler
Parameters:
chars - character buffer to be processed
offset - offset in buffer where the data starts
length - length of characters to be processed
Throws:
java.lang.Exception -  

processCharacters

public void processCharacters(int data)
                       throws java.lang.Exception
Process characters.
Specified by:
processCharacters in interface XMLEntityHandler.CharDataHandler
Following copied from interface: org.apache.xerces.readers.XMLEntityHandler.CharDataHandler
Parameters:
stringHandle - StringPool handle to the character data
Throws:
java.lang.Exception -  

processWhitespace

public void processWhitespace(char[] chars,
                              int offset,
                              int length)
                       throws java.lang.Exception
Process whitespace.
Specified by:
processWhitespace in interface XMLEntityHandler.CharDataHandler
Following copied from interface: org.apache.xerces.readers.XMLEntityHandler.CharDataHandler
Parameters:
chars - character buffer to be processed
offset - offset in buffer where the data starts
length - length of whitespace to be processed
Throws:
java.lang.Exception -  

processWhitespace

public void processWhitespace(int data)
                       throws java.lang.Exception
Process whitespace.
Specified by:
processWhitespace in interface XMLEntityHandler.CharDataHandler
Following copied from interface: org.apache.xerces.readers.XMLEntityHandler.CharDataHandler
Parameters:
stringHandle - StringPool handle to the whitespace
Throws:
java.lang.Exception -  

scanElementType

public void scanElementType(XMLEntityHandler.EntityReader entityReader,
                            char fastchar,
                            QName element)
                     throws java.lang.Exception
Scans element type.

scanExpectedElementType

public boolean scanExpectedElementType(XMLEntityHandler.EntityReader entityReader,
                                       char fastchar,
                                       QName element)
                                throws java.lang.Exception
Scans expected element type.

scanAttributeName

public void scanAttributeName(XMLEntityHandler.EntityReader entityReader,
                              QName element,
                              QName attribute)
                       throws java.lang.Exception
Scans attribute name.

callStartDocument

public void callStartDocument()
                       throws java.lang.Exception
Call start document.
Specified by:
callStartDocument in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Throws:
java.lang.Exception -  

callEndDocument

public void callEndDocument()
                     throws java.lang.Exception
Call end document.
Specified by:
callEndDocument in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Throws:
java.lang.Exception -  

callXMLDecl

public void callXMLDecl(int version,
                        int encoding,
                        int standalone)
                 throws java.lang.Exception
Call XML declaration.
Specified by:
callXMLDecl in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Parameters:
version - the handle in the string pool for the version number
encoding - the handle in the string pool for the encoding
standalong - the handle in the string pool for the standalone value
Throws:
java.lang.Exception -  

callStandaloneIsYes

public void callStandaloneIsYes()
                         throws java.lang.Exception
Description copied from interface: XMLDocumentScanner.EventHandler
Signal standalone = "yes"
Specified by:
callStandaloneIsYes in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Throws:
java.lang.Exception -  

callTextDecl

public void callTextDecl(int version,
                         int encoding)
                  throws java.lang.Exception
Call text declaration.
Specified by:
callTextDecl in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Parameters:
version - the handle in the string pool for the version number
encoding - the handle in the string pool for the encoding
Throws:
java.lang.Exception -  

element

public void element(QName element)
             throws java.lang.Exception
Signal the scanning of an element name in a start element tag.
Specified by:
element in interface XMLDocumentScanner.EventHandler
Parameters:
element - Element name scanned.

attribute

public boolean attribute(QName element,
                         QName attrName,
                         int attrValue)
                  throws java.lang.Exception
Signal the scanning of an attribute associated to the previous start element tag.
Specified by:
attribute in interface XMLDocumentScanner.EventHandler
Parameters:
element - Element name scanned.
attrName - Attribute name scanned.
attrValue - The string pool index of the attribute value.

callStartElement

public void callStartElement(QName element)
                      throws java.lang.Exception
Call start element.
Specified by:
callStartElement in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Parameters:
element - Element name scanned.
Throws:
java.lang.Exception -  

callEndElement

public void callEndElement(int readerId)
                    throws java.lang.Exception
Call end element.
Specified by:
callEndElement in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Parameters:
readerId - the Id of the reader being used to scan the end tag.
Throws:
java.lang.Exception -  

callStartCDATA

public void callStartCDATA()
                    throws java.lang.Exception
Call start CDATA section.
Specified by:
callStartCDATA in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Throws:
java.lang.Exception -  

callEndCDATA

public void callEndCDATA()
                  throws java.lang.Exception
Call end CDATA section.
Specified by:
callEndCDATA in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Throws:
java.lang.Exception -  

callCharacters

public void callCharacters(int ch)
                    throws java.lang.Exception
Call characters.
Specified by:
callCharacters in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Parameters:
ch - the handle in the string pool of the character data that was scanned
Throws:
java.lang.Exception -  

callProcessingInstruction

public void callProcessingInstruction(int target,
                                      int data)
                               throws java.lang.Exception
Call processing instruction.
Specified by:
callProcessingInstruction in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Parameters:
piTarget - the handle in the string pool of the processing instruction targe
piData - the handle in the string pool of the processing instruction data
Throws:
java.lang.Exception -  

callComment

public void callComment(int comment)
                 throws java.lang.Exception
Call comment.
Specified by:
callComment in interface XMLDocumentScanner.EventHandler
Following copied from interface: org.apache.xerces.framework.XMLDocumentScanner.EventHandler
Parameters:
data - the handle in the string pool of the comment text
Throws:
java.lang.Exception -  

startNamespaceDeclScope

public void startNamespaceDeclScope(int prefix,
                                    int uri)
                             throws java.lang.Exception
Start a new namespace declaration scope.
Specified by:
startNamespaceDeclScope in interface NamespacesScope.NamespacesHandler
Following copied from interface: org.apache.xerces.utils.NamespacesScope.NamespacesHandler
Parameters:
prefix - the StringPool handle of the namespace prefix being declared
uri - the StringPool handle of the namespace's URI
Throws:
java.lang.Exception -  

endNamespaceDeclScope

public void endNamespaceDeclScope(int prefix)
                           throws java.lang.Exception
End a namespace declaration scope.
Specified by:
endNamespaceDeclScope in interface NamespacesScope.NamespacesHandler
Following copied from interface: org.apache.xerces.utils.NamespacesScope.NamespacesHandler
Parameters:
prefix - the StringPool handle of the namespace prefix going out of scope
Throws:
java.lang.Exception -  

setRootElementType

public void setRootElementType(QName rootElement)
Sets the root element.

getContentSpecType

public int getContentSpecType(int elementIndex)
Returns the content spec type for an element index.

getContentSpecHandle

public int getContentSpecHandle(int elementIndex)
Returns the content spec handle for an element index.

reportRecoverableXMLError

protected void reportRecoverableXMLError(int majorCode,
                                         int minorCode)
                                  throws java.lang.Exception
Report a recoverable xml error.

reportRecoverableXMLError

protected void reportRecoverableXMLError(int majorCode,
                                         int minorCode,
                                         int stringIndex1)
                                  throws java.lang.Exception
Report a recoverable xml error.

reportRecoverableXMLError

protected void reportRecoverableXMLError(int majorCode,
                                         int minorCode,
                                         java.lang.String string1)
                                  throws java.lang.Exception
Report a recoverable xml error.

reportRecoverableXMLError

protected void reportRecoverableXMLError(int majorCode,
                                         int minorCode,
                                         int stringIndex1,
                                         int stringIndex2)
                                  throws java.lang.Exception
Report a recoverable xml error.

reportRecoverableXMLError

protected void reportRecoverableXMLError(int majorCode,
                                         int minorCode,
                                         java.lang.String string1,
                                         java.lang.String string2)
                                  throws java.lang.Exception
Report a recoverable xml error.

reportRecoverableXMLError

protected void reportRecoverableXMLError(int majorCode,
                                         int minorCode,
                                         java.lang.String string1,
                                         java.lang.String string2,
                                         java.lang.String string3)
                                  throws java.lang.Exception
Report a recoverable xml error.

whatCanGoHere

protected int whatCanGoHere(int elementIndex,
                            boolean fullyValid,
                            InsertableElementsInfo info)
                     throws java.lang.Exception
Returns information about which elements can be placed at a particular point in the passed element's content model.

Note that the incoming content model to test must be valid at least up to the insertion point. If not, then -1 will be returned and the info object will not have been filled in.

If, on return, the info.isValidEOC flag is set, then the 'insert after' elemement is a valid end of content, i.e. nothing needs to be inserted after it to make the parent element's content model valid.

Parameters:
elementIndex - The index within the ElementDeclPool of the element which is being querying.
fullyValid - Only return elements that can be inserted and still maintain the validity of subsequent elements past the insertion point (if any). If the insertion point is at the end, and this is true, then only elements that can be legal final states will be returned.
info - An object that contains the required input data for the method, and which will contain the output information if successful.
Returns:
The value -1 if fully valid, else the 0 based index of the child that first failed before the insertion point. If the value returned is equal to the number of children, then the specified children are valid but additional content is required to reach a valid ending state.
Throws:
java.lang.Exception - Thrown on error.
See Also:
InsertableElementsInfo

getAttDefIsExternal

protected boolean getAttDefIsExternal(QName element,
                                      QName attribute)
Protected for use by AttributeValidator classes.


Copyright © 1999-2001 Apache XML Project. All Rights Reserved.