String ns = uctx.getAttributeNamespace(i);
if (ns == null || ns.length() == 0) {
// check if schema attribute in allowed set
if (attrs.indexOf(name) < 0) {
ValidationContext vctx = (ValidationContext)ictx.getUserContext();
vctx.addError("Undefined attribute " + name, ictx.getStackTop());
}
} else if (SCHEMA_NAMESPACE.equals(ns)) {
// no attributes from schema namespace are defined
ValidationContext vctx = (ValidationContext)ictx.getUserContext();
vctx.addError("Undefined attribute " + name, ictx.getStackTop());
} else if (!extra) {
// warn on non-schema attribute present where forbidden
ValidationContext vctx = (ValidationContext)ictx.getUserContext();
String qname = UnmarshallingContext.buildNameString(ns, name);
vctx.addWarning("Non-schema attribute not allowed " + qname, ictx.getStackTop());
}
}
}