Buggy code:
protected Document fDocument ; protected CoreDocumentImpl fDocumentImpl ; protected boolean fStorePSVI ; protected String fDocumentClassName ; protected DocumentType fDocumentType ; protected Node fCurrentNode ; protected CDATASection fCurrentCDATASection ; protected EntityImpl fCurrentEntityDecl ; protected int fDeferredEntityDecl ; protected final StringBuffer fStringBuffer = new StringBuffer ( 50 ) ; protected StringBuffer fInternalSubset ; protected boolean fDeferNodeExpansion ; protected boolean fNamespaceAware ; protected DeferredDocumentImpl fDeferredDocumentImpl ; protected int fDocumentIndex ; protected int fDocumentTypeIndex ; protected int fCurrentNodeIndex ; protected int fCurrentCDATASectionIndex ; protected boolean fInDTDExternalSubset ; protected Node fRoot ; protected boolean fInCDATASection ; protected boolean fFirstChunk = false ; protected boolean fFilterReject = false ; protected final Stack fBaseURIStack = new Stack ( ) ; protected int fRejectedElementDepth = 0 ; protected Stack fSkippedElemStack = null ; protected boolean fInEntityRef = false ; private final QName fAttrQName = new QName ( ) ; private XMLLocator fLocator ; protected LSParserFilter fDOMFilter = null ; protected AbstractDOMParser ( XMLParserConfiguration config ) { } protected String getDocumentClassName ( ) { } protected void setDocumentClassName ( String documentClassName ) { } public Document getDocument ( ) { } public final void dropDocumentReferences ( ) { } public void reset ( ) throws XNIException { } public void setLocale ( Locale locale ) { } 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 comment ( XMLString text , Augmentations augs ) throws XNIException { } public void processingInstruction ( String target , XMLString data , Augmentations augs ) throws XNIException { } 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 startElement ( QName element , XMLAttributes attributes , Augmentations augs ) throws XNIException { } public void emptyElement ( QName element , XMLAttributes attributes , 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 endGeneralEntity ( String name , Augmentations augs ) throws XNIException { } protected final void handleBaseURI ( Node node ) { if ( ( fDocumentImpl ) != null ) { String baseURI = null ; short nodeType = node . getNodeType ( ) ; if ( nodeType == ( Node . ELEMENT_NODE ) ) { if ( fNamespaceAware ) { if ( ( ( ( Element ) ( node ) ) . getAttributeNodeNS ( "http:////www.w3.org//XML//1998//namespace" , "base" ) ) != null ) { return ; } } else if ( ( ( ( Element ) ( node ) ) . getAttributeNode ( "xml:base" ) ) != null ) { return ; } baseURI = ( ( org . apache . xerces . dom . EntityReferenceImpl ) ( fCurrentNode ) ) . getBaseURI ( ) ; if ( ( baseURI != null ) && ( ! ( baseURI . equals ( fDocumentImpl . getDocumentURI ( ) ) ) ) ) { if ( fNamespaceAware ) { <START_BUG> ( ( Element ) ( node ) ) . setAttributeNS ( "http:////www.w3.org//XML//1998//namespace" , "base" , baseURI ) ; <END_BUG> } else { ( ( Element ) ( node ) ) . setAttribute ( "xml:base" , baseURI ) ; } } } else if ( nodeType == ( Node . PROCESSING_INSTRUCTION_NODE ) ) { baseURI = ( ( org . apache . xerces . dom . EntityReferenceImpl ) ( fCurrentNode ) ) . getBaseURI ( ) ; if ( ( baseURI != null ) && ( ( fErrorHandler ) != null ) ) { DOMErrorImpl error = new DOMErrorImpl ( ) ; error . fType = "pi-base-uri-not-preserved" ; error . fRelatedData = baseURI ; error . fSeverity = DOMError . SEVERITY_WARNING ; fErrorHandler . getErrorHandler ( ) . handleError ( error ) ; } } } } protected final void handleBaseURI ( int node ) { } public void startDTD ( XMLLocator locator , Augmentations augs ) throws XNIException { } public void endDTD ( Augmentations augs ) throws XNIException { } public void startConditional ( short type , Augmentations augs ) throws XNIException { } public void endConditional ( Augmentations augs ) throws XNIException { } public void startExternalSubset ( XMLResourceIdentifier identifier , Augmentations augs ) throws XNIException { } public void endExternalSubset ( Augmentations augs ) throws XNIException { } public void internalEntityDecl ( String name , XMLString text , XMLString nonNormalizedText , Augmentations augs ) throws XNIException { } public void externalEntityDecl ( String name , XMLResourceIdentifier identifier , Augmentations augs ) throws XNIException { } public void startParameterEntity ( String name , XMLResourceIdentifier identifier , String encoding , Augmentations augs ) throws XNIException { } public void endParameterEntity ( String name , Augmentations augs ) throws XNIException { } public void unparsedEntityDecl ( String name , XMLResourceIdentifier identifier , String notation , Augmentations augs ) throws XNIException { } public void notationDecl ( String name , XMLResourceIdentifier identifier , Augmentations augs ) throws XNIException { } public void ignoredCharacters ( XMLString text , Augmentations augs ) throws XNIException { } public void elementDecl ( String name , String contentModel , Augmentations augs ) throws XNIException { }

Fix:
( ( Element ) ( node ) ) . setAttributeNS ( "http:////www.w3.org//XML//1998//namespace" , "xml:base" , baseURI ) ;