new Object[] {QNameHelper.pretty( attrName )}, attrName, null, null,
XmlValidationError.INCORRECT_ATTRIBUTE, state._type);
return;
}
SchemaLocalAttribute attrSchema =
state._attrModel == null
? null
: state._attrModel.getAttribute( attrName );
if (attrSchema != null)
{
_localAttribute = attrSchema;
if (attrSchema.getUse() == SchemaLocalAttribute.PROHIBITED)
{
emitFieldError( event, XmlErrorCodes.ELEM_COMPLEX_TYPE_LOCALLY_VALID$PROHIBITED_ATTRIBUTE,
new Object[] { QNameHelper.pretty( attrName ) } ,
attrName, null, null, XmlValidationError.INCORRECT_ATTRIBUTE, state._type );
return;
}
String value =
validateSimpleType(
attrSchema.getType(), attrSchema, event, false, false );
_constraintEngine.attr( event, attrName, attrSchema.getType(), value );
return;
}
int wildcardProcess = state._attrModel.getWildcardProcess();
_wildcardAttribute = state._attrModel;
if (wildcardProcess == SchemaAttributeModel.NONE)
{
// todo (dutta) need additional logic to determine the expectedSchemaType
emitFieldError( event, XmlErrorCodes.ELEM_COMPLEX_TYPE_LOCALLY_VALID$NO_WILDCARD,
new Object[] { QNameHelper.pretty( attrName ) },
attrName, null, null, XmlValidationError.INCORRECT_ATTRIBUTE, state._type);
return;
}
QNameSet attrWildcardSet = state._attrModel.getWildcardSet();
if (!attrWildcardSet.contains( attrName ))
{
// todo (dutta) need additional logic to determine the expectedSchemaType
emitFieldError( event, XmlErrorCodes.ELEM_COMPLEX_TYPE_LOCALLY_VALID$NOT_WILDCARD_VALID,
new Object[] { QNameHelper.pretty( attrName ) },
attrName, null, null, XmlValidationError.INCORRECT_ATTRIBUTE, state._type);
return;
}
if (wildcardProcess == SchemaAttributeModel.SKIP ||
wildcardProcess == SchemaAttributeModel.LAX && _treatLaxAsSkip)
return;
attrSchema = _globalTypes.findAttribute( attrName );
_localAttribute = attrSchema;
if (attrSchema == null)
{
if (wildcardProcess == SchemaAttributeModel.LAX)
return;
assert wildcardProcess == SchemaAttributeModel.STRICT;
// KHK: cvc-assess-attr.1.2 ?
// todo (dutta) need additional logic to determine the expectedSchemaType
emitFieldError( event, XmlErrorCodes.ASSESS_ATTR_SCHEMA_VALID$NOT_RESOLVED,
new Object[] { QNameHelper.pretty( attrName ) },
attrName, null, null, XmlValidationError.INCORRECT_ATTRIBUTE, state._type);
return;
}
String value =
validateSimpleType(
attrSchema.getType(), attrSchema, event, false, false );
_constraintEngine.attr( event, attrName, attrSchema.getType(), value );
}