// For an attribute information item to be locally valid with respect to an attribute declaration all of the following must be true:
// 1 The declaration must not be absent (see Missing Sub-components (5.3) for how this can fail to be the case).
// 2 Its {type definition} must not be absent.
// 3 The item's normalized value must be locally valid with respect to that {type definition} as per String Valid (3.14.4).
// get simple type
XSSimpleType attDV = currDecl.fType;
Object actualValue = null;
try {
actualValue = attDV.validate(attrValue, fValidationState, fValidatedInfo);
// store the normalized value
if (fNormalizeData)
attributes.setValue(index, fValidatedInfo.normalizedValue);
if (attributes instanceof XMLAttributesImpl) {
XMLAttributesImpl attrs = (XMLAttributesImpl) attributes;
boolean schemaId =
fValidatedInfo.memberType != null
? fValidatedInfo.memberType.isIDType()
: attDV.isIDType();
attrs.setSchemaId(index, schemaId);
}
// PSVI: element notation
if (attDV.getVariety() == XSSimpleType.VARIETY_ATOMIC
&& attDV.getPrimitiveKind() == XSSimpleType.PRIMITIVE_NOTATION) {
QName qName = (QName) actualValue;
SchemaGrammar grammar = fGrammarBucket.getGrammar(qName.uri);
//REVISIT: is it possible for the notation to be in different namespace than the attribute
//with which it is associated, CHECK !! <fof n1:att1 = "n2:notation1" ..>
// should we give chance to the application to be able to retrieve a grammar - nb
//REVISIT: what would be the triggering component here.. if it is attribute value that
// triggered the loading of grammar ?? -nb
if (grammar != null) {
fNotation = grammar.getGlobalNotationDecl(qName.localpart);
}
}
} catch (InvalidDatatypeValueException idve) {
reportSchemaError(idve.getKey(), idve.getArgs());
reportSchemaError(
"cvc-attribute.3",
new Object[] { element.rawname, fTempQName.rawname, attrValue, attDV.getName()});
}
// get the value constraint from use or decl
// 4 The item's actual value must match the value of the {value constraint}, if it is present and fixed. // now check the value against the simpleType
if (actualValue != null && currDecl.getConstraintType() == XSConstants.VC_FIXED) {