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);
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
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
type = attributes.getType(i);
attrImpl.setType(type);
id = (type.equals("ID")) ? true : false;
}
if (id) {
((ElementImpl) el).setIdAttributeNode(attr, true);
}
attrImpl.setSpecified(attributes.isSpecified(i));
// REVISIT: Handle entities in attribute value.
}
}
setCharacterData(false);
if (augs != null) {
ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elementPSVI != null && fNamespaceAware) {
XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
if (type == null) {
type = elementPSVI.getTypeDefinition();
}
((ElementNSImpl)el).setType(type);
}
}
// filter nodes
if (fDOMFilter != null) {
short code = fDOMFilter.startElement(el);
switch (code) {
case DOMBuilderFilter.FILTER_INTERRUPT:{
throw new RuntimeException("The normal processing of the document was interrupted.");
}
case DOMBuilderFilter.FILTER_REJECT:{
fFilterReject = true;
fRejectedElement.setValues(element);
return;
}
case DOMBuilderFilter.FILTER_SKIP: {
fSkippedElemStack.push(element);
return;
}
default: {
}
}
}
fCurrentNode.appendChild(el);
fCurrentNode = el;
}
else {
Object type = null;
if (augs != null) {
ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elementPSVI != null) {
type = elementPSVI.getMemberTypeDefinition();
if (type == null) {
type = elementPSVI.getTypeDefinition();
}
}
}
int el =
fDeferredDocumentImpl.createDeferredElement(fNamespaceAware ?
element.uri : null,
element.rawname,
type);
int attrCount = attributes.getLength();
for (int i = 0; i < attrCount; i++) {
// set type information
AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);
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();
}
}
else {