private DocumentFragment replaceContent ( final DocumentFragment pushcontent ) { final NodeList children = pushcontent . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { final Node child = children . item ( i ) ; switch ( child . getNodeType ( ) ) { case Node . ELEMENT_NODE : final Element e = ( Element ) child ; replaceLinkAttributes ( e ) ; final NodeList elements = e . getElementsByTagName ( "*" ) ; for ( int j = 0 ; i < elements . getLength ( ) ; i ++ ) { replaceLinkAttributes ( ( Element ) elements . item ( j ) ) ; } break ; } } return pushcontent ; }
Rewrite link attributes .