public void updateStyleElement ( Document document , Element style ) { StringBuilder buf = new StringBuilder ( ) ; serialize ( buf ) ; Text cont = document . createTextNode ( buf . toString ( ) ) ; while ( style . hasChildNodes ( ) ) { style . removeChild ( style . getFirstChild ( ) ) ; } style . appendChild ( cont ) ; }
Update the text contents of an existing style element .