Buggy code:
protected final void expandEntityRef ( Node node , Node parent , Node reference ) { } protected final void namespaceFixUp ( ElementImpl element , AttributeMap attributes ) { } protected final void addNamespaceDecl ( String prefix , String uri , ElementImpl element ) { } protected final DOMError modifyDOMError ( String message , short severity , Node node ) { } protected final void updateQName ( Node node , QName qname ) { } final String normalizeAttributeValue ( String value , Attr attr ) { } protected final class XMLAttributesProxy implements XMLAttributes { protected AttributeMap fAttributes ; protected CoreDocumentImpl fDocument ; protected ElementImpl fElement ; protected final Vector fAugmentations = new Vector ( 5 ) ; public void setAttributes ( AttributeMap attributes , CoreDocumentImpl doc , ElementImpl elem ) { } public int addAttribute ( QName qname , String attrType , String attrValue ) { } public void removeAllAttributes ( ) { } public void removeAttributeAt ( int attrIndex ) { } public int getLength ( ) { } public int getIndex ( String qName ) { } public int getIndex ( String uri , String localPart ) { } public void setName ( int attrIndex , QName attrName ) { } public void getName ( int attrIndex , QName attrName ) { } public String getPrefix ( int index ) { } public String getURI ( int index ) { } public String getLocalName ( int index ) { } public String getQName ( int index ) { } public void setType ( int attrIndex , String attrType ) { } public String getType ( int index ) { } public String getType ( String qName ) { } public String getType ( String uri , String localName ) { } public void setValue ( int attrIndex , String attrValue ) { } public String getValue ( int index ) { } public String getValue ( String qName ) { } public String getValue ( String uri , String localName ) { } public void setNonNormalizedValue ( int attrIndex , String attrValue ) { } public String getNonNormalizedValue ( int attrIndex ) { } public void setSpecified ( int attrIndex , boolean specified ) { } public boolean isSpecified ( int attrIndex ) { } public Augmentations getAugmentations ( int attributeIndex ) { } public Augmentations getAugmentations ( String uri , String localPart ) { } public Augmentations getAugmentations ( String qName ) { } } public void startDocument ( XMLLocator locator , String encoding , NamespaceContext namespaceContext , Augmentations augs ) throws XNIException { } public void xmlDecl ( String version , String encoding , String standalone , Augmentations augs ) throws XNIException { } public void doctypeDecl ( String rootElement , String publicId , String systemId , Augmentations augs ) throws XNIException { } public void comment ( XMLString text , Augmentations augs ) throws XNIException { } public void processingInstruction ( String target , XMLString data , Augmentations augs ) throws XNIException { } public void startElement ( QName element , XMLAttributes attributes , Augmentations augs ) throws XNIException { Element currentElement = ( ( Element ) ( fCurrentNode ) ) ; int attrCount = attributes . getLength ( ) ; if ( DOMNormalizer . DEBUG_EVENTS ) { System . out . println ( ( ( ( "==>startElement:<seq2seq4repair_space>" + element ) + "<seq2seq4repair_space>attrs.length=" ) + attrCount ) ) ; } for ( int i = 0 ; i < attrCount ; i ++ ) { attributes . getName ( i , fAttrQName ) ; Attr attr = null ; attr = currentElement . getAttributeNodeNS ( fAttrQName . uri , fAttrQName . localpart ) ; AttributePSVI attrPSVI = ( ( AttributePSVI ) ( attributes . getAugmentations ( i ) . getItem ( ATTRIBUTE_PSVI ) ) ) ; if ( attrPSVI != null ) { XSTypeDefinition decl = attrPSVI . getMemberTypeDefinition ( ) ; boolean id = false ; if ( decl != null ) { id = ( ( org . apache . xerces . impl . dv . XSSimpleType ) ( decl ) ) . isIDType ( ) ; } else { decl = attrPSVI . getTypeDefinition ( ) ; if ( decl != null ) { id = ( ( org . apache . xerces . impl . dv . XSSimpleType ) ( decl ) ) . isIDType ( ) ; } } if ( id ) { <START_BUG> ( ( ElementImpl ) ( currentElement ) ) . setIdAttributeNode ( attr ) ; <END_BUG> } if ( fPSVI ) { ( ( PSVIAttrNSImpl ) ( attr ) ) . setPSVI ( attrPSVI ) ; } if ( ( ( fConfiguration . features ) & ( DOMConfigurationImpl . DTNORMALIZATION ) ) != 0 ) { boolean specified = attr . getSpecified ( ) ; attr . setValue ( attrPSVI . getSchemaNormalizedValue ( ) ) ; if ( ! specified ) { ( ( AttrImpl ) ( attr ) ) . setSpecified ( specified ) ; } } } } } public void emptyElement ( QName element , XMLAttributes attributes , Augmentations augs ) throws XNIException { } public void startGeneralEntity ( String name , XMLResourceIdentifier identifier , String encoding , Augmentations augs ) throws XNIException { } public void textDecl ( String version , String encoding , Augmentations augs ) throws XNIException { } public void endGeneralEntity ( String name , Augmentations augs ) throws XNIException { } public void characters ( XMLString text , Augmentations augs ) throws XNIException { } public void ignorableWhitespace ( XMLString text , Augmentations augs ) throws XNIException { } public void endElement ( QName element , Augmentations augs ) throws XNIException { } public void startCDATA ( Augmentations augs ) throws XNIException { } public void endCDATA ( Augmentations augs ) throws XNIException { } public void endDocument ( Augmentations augs ) throws XNIException { } public void setDocumentSource ( XMLDocumentSource source ) { } public XMLDocumentSource getDocumentSource ( ) { } }

Fix:
( ( ElementImpl ) ( currentElement ) ) . setIdAttributeNode ( attr , true ) ;