if (!fDeferNodeExpansion) {
if (fFilterReject) {
++fRejectedElementDepth;
return;
}
Element el = createElementNode (element);
int attrCount = attributes.getLength ();
boolean seenSchemaDefault = false;
for (int i = 0; i < attrCount; i++) {
attributes.getName (i, fAttrQName);
Attr attr = createAttrNode (fAttrQName);
String attrValue = attributes.getValue (i);
AttributePSVI attrPSVI =(AttributePSVI) attributes.getAugmentations (i).getItem (Constants.ATTRIBUTE_PSVI);
if (fStorePSVI && attrPSVI != null){
((PSVIAttrNSImpl) attr).setPSVI (attrPSVI);
}
attr.setValue (attrValue);
boolean specified = attributes.isSpecified(i);
// Take special care of schema defaulted attributes. Calling the
// non-namespace aware setAttributeNode() method could overwrite
// another attribute with the same local name.
if (!specified && (seenSchemaDefault || (fAttrQName.uri != null &&
fAttrQName.uri != NamespaceContext.XMLNS_URI && fAttrQName.prefix == null))) {
el.setAttributeNodeNS(attr);
seenSchemaDefault = true;
}
else {
el.setAttributeNode(attr);
}
// 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