public void printElement ( String elementName , String value , Map < String , String > attributes ) { print ( "<" + elementName ) ; for ( Entry < String , String > entry : attributes . entrySet ( ) ) { print ( " " + entry . getKey ( ) + "=\"" + escape ( entry . getValue ( ) ) + "\"" ) ; } if ( value != null ) { println ( ">" + escape ( value ) + "</" + elementName + ">" ) ; } else { println ( "/>" ) ; } }
Output a complete element with the given content and attributes .