question: public void testEntityReferenceSetTextContent ( ) throws TransformerException { document = builder . newDocument ( ) ; Element root = document . createElement ( "menu" ) ; document . appendChild ( root ) ; EntityReference entityReference = document . createEntityReference ( "sp" ) ; root . appendChild ( entityReference ) ; try { entityReference . setTextContent ( "Lite Syrup" ) ; fail ( ) ; } catch ( DOMException e ) { } }
target:  Tests setTextContent on entity references. Although the other tests can act on a parsed DOM, this needs to use a programmatically constructed DOM because the parser may have replaced the entity reference with the corresponding text.