protected void checkUnboundPrefixInEntRef ( Node node ) { Node child , next ; for ( child = node . getFirstChild ( ) ; child != null ; child = next ) { next = child . getNextSibling ( ) ; if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) { //If a NamespaceURI is not declared for the current //node's prefix, raise a fatal error. String prefix = child . getPrefix ( ) ; if ( prefix != null && fNSBinder . getURI ( prefix ) == null ) { String msg = Utils . messages . createMessage ( MsgKey . ER_ELEM_UNBOUND_PREFIX_IN_ENTREF , new Object [ ] { node . getNodeName ( ) , child . getNodeName ( ) , prefix } ) ; if ( fErrorHandler != null ) { fErrorHandler . handleError ( new DOMErrorImpl ( DOMError . SEVERITY_FATAL_ERROR , msg , MsgKey . ER_ELEM_UNBOUND_PREFIX_IN_ENTREF , null , null , null ) ) ; } } NamedNodeMap attrs = child . getAttributes ( ) ; for ( int i = 0 ; i < attrs . getLength ( ) ; i ++ ) { String attrPrefix = attrs . item ( i ) . getPrefix ( ) ; if ( attrPrefix != null && fNSBinder . getURI ( attrPrefix ) == null ) { String msg = Utils . messages . createMessage ( MsgKey . ER_ATTR_UNBOUND_PREFIX_IN_ENTREF , new Object [ ] { node . getNodeName ( ) , child . getNodeName ( ) , attrs . item ( i ) } ) ; if ( fErrorHandler != null ) { fErrorHandler . handleError ( new DOMErrorImpl ( DOMError . SEVERITY_FATAL_ERROR , msg , MsgKey . ER_ATTR_UNBOUND_PREFIX_IN_ENTREF , null , null , null ) ) ; } } } } if ( child . hasChildNodes ( ) ) { checkUnboundPrefixInEntRef ( child ) ; } } }
If the configuration parameter namespaces is set to true this methods checks if an entity whose replacement text contains unbound namespace prefixes is referenced in a location where there are no bindings for the namespace prefixes and if so raises a LSException with the error - type unbound - prefix - in - entity - reference