org.apache.xerces.impl.xs.traversers
public class XSAttributeChecker extends Object
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,v 1.36 2004/10/29 05:05:13 mrglavas Exp $
UNKNOWN:
Field Summary | |
---|---|
static int | ATTIDX_ABSTRACT |
static int | ATTIDX_AFORMDEFAULT |
static int | ATTIDX_BASE |
static int | ATTIDX_BLOCK |
static int | ATTIDX_BLOCKDEFAULT |
static int | ATTIDX_DEFAULT |
static int | ATTIDX_EFORMDEFAULT |
static int | ATTIDX_ENUMNSDECLS |
static int | ATTIDX_FINAL |
static int | ATTIDX_FINALDEFAULT |
static int | ATTIDX_FIXED |
static int | ATTIDX_FORM |
static int | ATTIDX_FROMDEFAULT |
static int | ATTIDX_ID |
static int | ATTIDX_ISRETURNED |
static int | ATTIDX_ITEMTYPE |
static int | ATTIDX_MAXOCCURS |
static int | ATTIDX_MEMBERTYPES |
static int | ATTIDX_MINOCCURS |
static int | ATTIDX_MIXED |
static int | ATTIDX_NAME |
static int | ATTIDX_NAMESPACE |
static int | ATTIDX_NAMESPACE_LIST |
static int | ATTIDX_NILLABLE |
static int | ATTIDX_NONSCHEMA |
static int | ATTIDX_PROCESSCONTENTS |
static int | ATTIDX_PUBLIC |
static int | ATTIDX_REF |
static int | ATTIDX_REFER |
static int | ATTIDX_SCHEMALOCATION |
static int | ATTIDX_SOURCE |
static int | ATTIDX_SUBSGROUP |
static int | ATTIDX_SYSTEM |
static int | ATTIDX_TARGETNAMESPACE |
static int | ATTIDX_TYPE |
static int | ATTIDX_USE |
static int | ATTIDX_VALUE |
static int | ATTIDX_VERSION |
static int | ATTIDX_XML_LANG |
static int | ATTIDX_XPATH |
protected static int | DT_ANYURI |
protected static int | DT_BLOCK |
protected static int | DT_BLOCK1 |
protected static int | DT_BOOLEAN |
protected static int | DT_COUNT |
protected static int | DT_FINAL |
protected static int | DT_FINAL1 |
protected static int | DT_FINAL2 |
protected static int | DT_FORM |
protected static int | DT_ID |
protected static int | DT_LANGUAGE |
protected static int | DT_MAXOCCURS |
protected static int | DT_MAXOCCURS1 |
protected static int | DT_MEMBERTYPES |
protected static int | DT_MINOCCURS1 |
protected static int | DT_NAMESPACE |
protected static int | DT_NCNAME |
protected static int | DT_NONNEGINT |
protected static int | DT_POSINT |
protected static int | DT_PROCESSCONTENTS |
protected static int | DT_QNAME |
protected static int | DT_STRING |
protected static int | DT_TOKEN |
protected static int | DT_USE |
protected static int | DT_WHITESPACE |
protected static int | DT_XPATH |
protected static int | DT_XPATH1 |
protected Vector | fNamespaceList |
protected Hashtable | fNonSchemaAttrs |
protected XSDHandler | fSchemaHandler |
protected boolean[] | fSeen |
protected SymbolTable | fSymbolTable |
Constructor Summary | |
---|---|
XSAttributeChecker(XSDHandler schemaHandler) |
Method Summary | |
---|---|
Object[] | checkAttributes(Element element, boolean isGlobal, 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.
|
Object[] | checkAttributes(Element element, boolean isGlobal, 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. |
void | checkNonSchemaAttributes(XSGrammarBucket grammarBucket) |
protected Object[] | getAvailableArray() |
static String | normalize(String content, short ws) |
void | reset(SymbolTable symbolTable) |
void | resolveNamespace(Element element, Attr[] attrs, SchemaNamespaceSupport nsSupport) |
void | returnAttrArray(Object[] attrArray, XSDocumentInfo schemaDoc) |
returnAttrArray
to return that array.
Parameters: element which element to check isGlobal whether a child of <schema> or <redefine> schemaDoc the document where the element lives in
Returns: an array containing attribute values
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 check isGlobal whether a child of <schema> or <redefine> schemaDoc the document where the element lives in enumAsQName whether to tread enumeration value as QName
Returns: an array containing attribute values