org.apache.xerces.impl.xs.traversers
Class XSAttributeChecker
java.lang.Object
org.apache.xerces.impl.xs.traversers.XSAttributeChecker
public class XSAttributeChecker
- extends java.lang.Object
Class XSAttributeCheck
is used to check the validity of attributes
appearing in the schema document. It
- reports an error for invalid element (invalid namespace, invalid name)
- reports an error for invalid attribute (invalid namespace, invalid name)
- reports an error for invalid attribute value
- return compiled values for attriute values
- provide default value for missing optional attributes
- provide default value for incorrect attribute values
But it's the caller's responsibility to check whether a required attribute
is present.
Things need revisiting:
- Whether to return non-schema attributes/values
- Do we need to update NamespaceScope and ErrorReporter when reset()?
- Should have the datatype validators return compiled value
- use symbol table instead of many hashtables
- Version:
- $Id: XSAttributeChecker.java 471890 2006-11-06 22:00:18Z mrglavas $
- Author:
- Sandy Gao, IBM
Method Summary |
java.lang.Object[] |
checkAttributes(Element element,
boolean isGlobal,
org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)
Check whether the specified element conforms to the attributes restriction
an array of attribute values is returned. |
java.lang.Object[] |
checkAttributes(Element element,
boolean isGlobal,
org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc,
boolean enumAsQName)
Check whether the specified element conforms to the attributes restriction
an array of attribute values is returned. |
void |
checkNonSchemaAttributes(XSGrammarBucket grammarBucket)
|
static java.lang.String |
normalize(java.lang.String content,
short ws)
|
void |
reset(SymbolTable symbolTable)
|
void |
resolveNamespace(Element element,
Attr[] attrs,
SchemaNamespaceSupport nsSupport)
|
void |
returnAttrArray(java.lang.Object[] attrArray,
org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ATTIDX_ABSTRACT
public static final int ATTIDX_ABSTRACT
ATTIDX_AFORMDEFAULT
public static final int ATTIDX_AFORMDEFAULT
ATTIDX_BASE
public static final int ATTIDX_BASE
ATTIDX_BLOCK
public static final int ATTIDX_BLOCK
ATTIDX_BLOCKDEFAULT
public static final int ATTIDX_BLOCKDEFAULT
ATTIDX_DEFAULT
public static final int ATTIDX_DEFAULT
ATTIDX_EFORMDEFAULT
public static final int ATTIDX_EFORMDEFAULT
ATTIDX_FINAL
public static final int ATTIDX_FINAL
ATTIDX_FINALDEFAULT
public static final int ATTIDX_FINALDEFAULT
ATTIDX_FIXED
public static final int ATTIDX_FIXED
ATTIDX_FORM
public static final int ATTIDX_FORM
ATTIDX_ID
public static final int ATTIDX_ID
ATTIDX_ITEMTYPE
public static final int ATTIDX_ITEMTYPE
ATTIDX_MAXOCCURS
public static final int ATTIDX_MAXOCCURS
ATTIDX_MEMBERTYPES
public static final int ATTIDX_MEMBERTYPES
ATTIDX_MINOCCURS
public static final int ATTIDX_MINOCCURS
ATTIDX_MIXED
public static final int ATTIDX_MIXED
ATTIDX_NAME
public static final int ATTIDX_NAME
ATTIDX_NAMESPACE
public static final int ATTIDX_NAMESPACE
ATTIDX_NAMESPACE_LIST
public static final int ATTIDX_NAMESPACE_LIST
ATTIDX_NILLABLE
public static final int ATTIDX_NILLABLE
ATTIDX_NONSCHEMA
public static final int ATTIDX_NONSCHEMA
ATTIDX_PROCESSCONTENTS
public static final int ATTIDX_PROCESSCONTENTS
ATTIDX_PUBLIC
public static final int ATTIDX_PUBLIC
ATTIDX_REF
public static final int ATTIDX_REF
ATTIDX_REFER
public static final int ATTIDX_REFER
ATTIDX_SCHEMALOCATION
public static final int ATTIDX_SCHEMALOCATION
ATTIDX_SOURCE
public static final int ATTIDX_SOURCE
ATTIDX_SUBSGROUP
public static final int ATTIDX_SUBSGROUP
ATTIDX_SYSTEM
public static final int ATTIDX_SYSTEM
ATTIDX_TARGETNAMESPACE
public static final int ATTIDX_TARGETNAMESPACE
ATTIDX_TYPE
public static final int ATTIDX_TYPE
ATTIDX_USE
public static final int ATTIDX_USE
ATTIDX_VALUE
public static final int ATTIDX_VALUE
ATTIDX_ENUMNSDECLS
public static final int ATTIDX_ENUMNSDECLS
ATTIDX_VERSION
public static final int ATTIDX_VERSION
ATTIDX_XML_LANG
public static final int ATTIDX_XML_LANG
ATTIDX_XPATH
public static final int ATTIDX_XPATH
ATTIDX_FROMDEFAULT
public static final int ATTIDX_FROMDEFAULT
ATTIDX_ISRETURNED
public static final int ATTIDX_ISRETURNED
XSAttributeChecker
public XSAttributeChecker(XSDHandler schemaHandler)
reset
public void reset(SymbolTable symbolTable)
checkAttributes
public java.lang.Object[] checkAttributes(Element element,
boolean isGlobal,
org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)
- Check whether the specified element conforms to the attributes restriction
an array of attribute values is returned. the caller must call
returnAttrArray
to return that array.
- Parameters:
element
- which element to checkisGlobal
- whether a child of <schema> or <redefine>schemaDoc
- the document where the element lives in
- Returns:
- an array containing attribute values
checkAttributes
public java.lang.Object[] checkAttributes(Element element,
boolean isGlobal,
org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc,
boolean enumAsQName)
- Check whether the specified element conforms to the attributes restriction
an array of attribute values is returned. the caller must call
returnAttrArray
to return that array. This method also takes
an extra parameter: if the element is "enumeration", whether to make a
copy of the namespace context, so that the value can be resolved as a
QName later.
- Parameters:
element
- which element to checkisGlobal
- whether a child of <schema> or <redefine>schemaDoc
- the document where the element lives inenumAsQName
- whether to tread enumeration value as QName
- Returns:
- an array containing attribute values
checkNonSchemaAttributes
public void checkNonSchemaAttributes(XSGrammarBucket grammarBucket)
normalize
public static java.lang.String normalize(java.lang.String content,
short ws)
returnAttrArray
public void returnAttrArray(java.lang.Object[] attrArray,
org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)
resolveNamespace
public void resolveNamespace(Element element,
Attr[] attrs,
SchemaNamespaceSupport nsSupport)