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
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);
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 && !fInEntityRef) {
if (fRoot.rawname == null) {
// fill value of the root element
fRoot.setValues(element);
} else {
short code = fDOMFilter.startElement(el);
switch (code) {
case LSParserFilter.FILTER_INTERRUPT :
{
throw new RuntimeException("The normal processing of the document was interrupted.");
}
case LSParserFilter.FILTER_REJECT :
{
fFilterReject = true;
fRejectedElement.setValues(element);
return;
}
case LSParserFilter.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 {