// NOTE: The specified value MUST be set after you set
// the node value because that turns the "specified"
// flag to "true" which may overwrite a "false"
// value from the attribute list. -Ac
if (fDocumentImpl != null) {
AttrImpl attrImpl = (AttrImpl) attr;
Object type = null;
boolean id = false;
// REVISIT: currently it is possible that someone turns off
// namespaces and turns on xml schema validation
// To avoid classcast exception in AttrImpl check for namespaces
// however the correct solution should probably disallow setting
// namespaces to false when schema processing is turned on.
if (attrPSVI != null && fNamespaceAware) {
// XML Schema
type = attrPSVI.getMemberTypeDefinition ();
if (type == null) {
type = attrPSVI.getTypeDefinition ();
if (type != null) {
id = ((XSSimpleType) type).isIDType ();
attrImpl.setType (type);
}
}
else {
id = ((XSSimpleType) type).isIDType ();
attrImpl.setType (type);
}
}
else {
// DTD
boolean isDeclared = Boolean.TRUE.equals (attributes.getAugmentations (i).getItem (Constants.ATTRIBUTE_DECLARED));
// For DOM Level 3 TypeInfo, the type name must
// be null if this attribute has not been declared
// in the DTD.
if (isDeclared) {
type = attributes.getType (i);
id = "ID".equals (type);
}
attrImpl.setType (type);
}
if (id) {
((ElementImpl) el).setIdAttributeNode (attr, true);
}
attrImpl.setSpecified (attributes.isSpecified (i));
// REVISIT: Handle entities in attribute value.
}
}
setCharacterData (false);