private void transform ( final String xml , final UIContext uic , final PrintWriter writer ) { Transformer transformer = newTransformer ( ) ; Source inputXml ; try { inputXml = new StreamSource ( new ByteArrayInputStream ( xml . getBytes ( "utf-8" ) ) ) ; StreamResult result = new StreamResult ( writer ) ; if ( debugRequested ) { transformer . setParameter ( "isDebug" , 1 ) ; } transformer . transform ( inputXml , result ) ; } catch ( UnsupportedEncodingException | TransformerException ex ) { throw new SystemException ( "Could not transform xml" , ex ) ; } }
Transform the UI XML to HTML using the correct XSLT from the classpath .