private static InputStream transform ( final TransformerFactory factory , final InputStream xml ) throws TransformerException { final byte [ ] input ; try { input = RsXslt . consume ( xml ) ; } catch ( final IOException ex ) { throw new IllegalStateException ( ex ) ; } final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; final Source xsl = RsXslt . stylesheet ( factory , new StreamSource ( new Utf8InputStreamContent ( new ByteArrayInputStream ( new Utf8String ( input ) . asBytes ( ) ) ) ) ) ; RsXslt . transformer ( factory , xsl ) . transform ( new StreamSource ( new Utf8InputStreamContent ( new ByteArrayInputStream ( new Utf8String ( input ) . asBytes ( ) ) ) ) , new StreamResult ( new Utf8OutputStreamContent ( baos ) ) ) ; return new ByteArrayInputStream ( new Utf8String ( baos . toByteArray ( ) ) . asBytes ( ) ) ; }
Transform XML into HTML .