@Override
    public void render(DriverRequest httpRequest, String src, Writer out) throws IOException {
        try {
            HtmlDocumentBuilder htmlDocumentBuilder = new HtmlDocumentBuilder();
            htmlDocumentBuilder.setDoctypeExpectation(DoctypeExpectation.NO_DOCTYPE_ERRORS);
            Document document = htmlDocumentBuilder.parse(new InputSource(new StringReader(src)));
            Source source = new DOMSource(document);
            DOMResult result = new DOMResult();
            transformer.transform(source, result);
            XhtmlSerializer serializer = new XhtmlSerializer(out);
            Dom2Sax dom2Sax = new Dom2Sax(serializer, serializer);
            dom2Sax.parse(result.getNode());
        } catch (TransformerException e) {
            throw new ProcessingFailedException("Failed to transform source", e);
        } catch (SAXException e) {
            throw new ProcessingFailedException("Failed serialize transformation result", e);
        }
    }
@ Override public void render ( DriverRequest httpRequest , String src , Writer out ) throws IOException { try { HtmlDocumentBuilder htmlDocumentBuilder = new HtmlDocumentBuilder ( ) ; htmlDocumentBuilder . setDoctypeExpectation ( DoctypeExpectation . NO_DOCTYPE_ERRORS ) ; Document document = htmlDocumentBuilder . parse ( new InputSource ( new StringReader ( src ) ) ) ; Source source = new DOMSource ( document ) ; DOMResult result = new DOMResult ( ) ; transformer . transform ( source , result ) ; XhtmlSerializer serializer = new XhtmlSerializer ( out ) ; Dom2Sax dom2Sax = new Dom2Sax ( serializer , serializer ) ; dom2Sax . parse ( result . getNode ( ) ) ; } catch ( TransformerException e ) { throw new ProcessingFailedException ( "Failed to transform source" , e ) ; } catch ( SAXException e ) { throw new ProcessingFailedException ( "Failed serialize transformation result" , e ) ; } }
{@inheritDoc}