NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/adapter/PrintExemptionDetailsAdapter.java
/**
     * Replace escaped HTML markup in the request message with equivalent XSL:FO markup.
     *
     * Text sourced from the back-office is intended for display on a web page and may contain HTML markup,
     * without this, the mark-up will appear as text in the output.
     *
     * The exact formatting transforms can be found in replace-html-with-fo.xslt.
     */
Replace escaped HTML markup in the request message with equivalent XSL:FO markup.
Text sourced from the back-office is intended for display on a web page and may contain HTML markup,
without this, the mark-up will appear as text in the output.

The exact formatting transforms can be found in replace-html-with-fo.xslt.
Replace escaped HTML markup in the request message with equivalent XSL : FO markup . Text sourced from the back - office is intended for display on a web page and may contain HTML markup without this the mark - up will appear as text in the output . The exact formatting transforms can be found in replace - html - with - fo . xslt .
public void unescapeHtml(Exchange exchange) throws NdsApplicationException {
        NdsSoapRequestAdapterExchangeProxyImpl ndsExchange = new NdsSoapRequestAdapterExchangeProxyImpl(exchange);
        try {
            Document body = (Document) ndsExchange.getRequestMessageBody(Document.class);
            NodeList evaluate = findInlineTextNodes(body);
            try (InputStream templateIs = getClass().getClassLoader().getResourceAsStream(
                    "replace-html-with-fo.xslt")) {
                StreamSource templateSource = new StreamSource(templateIs);
                Transformer transformer = TransformerFactory.newInstance().newTransformer(templateSource);
                transformHtmlToXslFo(body, evaluate, transformer);
                if (logger.isDebugEnabled()) {
                    DOMImplementationLS domImplementation = (DOMImplementationLS) body.getImplementation();
                    LSSerializer lsSerializer = domImplementation.createLSSerializer();
                    logger.debug(lsSerializer.writeToString(body));
                }
            }
        } catch (ClassNotFoundException | XPathExpressionException | TransformerException | SAXException | IOException e) {
            throw new NdsApplicationException("Request failed due to : " + e.getMessage(), e);
        }
    }
public void unescapeHtml ( Exchange exchange ) throws NdsApplicationException { NdsSoapRequestAdapterExchangeProxyImpl ndsExchange = new NdsSoapRequestAdapterExchangeProxyImpl ( exchange ) ; try { Document body = ( Document ) ndsExchange . getRequestMessageBody ( Document . class ) ; NodeList evaluate = findInlineTextNodes ( body ) ; try ( InputStream templateIs = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( "replace-html-with-fo.xslt" ) ) { StreamSource templateSource = new StreamSource ( templateIs ) ; Transformer transformer = TransformerFactory . newInstance ( ) . newTransformer ( templateSource ) ; transformHtmlToXslFo ( body , evaluate , transformer ) ; if ( logger . isDebugEnabled ( ) ) { DOMImplementationLS domImplementation = ( DOMImplementationLS ) body . getImplementation ( ) ; LSSerializer lsSerializer = domImplementation . createLSSerializer ( ) ; logger . debug ( lsSerializer . writeToString ( body ) ) ; } } } catch ( ClassNotFoundException | XPathExpressionException | TransformerException | SAXException | IOException e ) { throw new NdsApplicationException ( "Request failed due to : " + e . getMessage ( ) , e ) ; } }
Replace escaped HTML markup in the request message with equivalent XSL:FO markup.
Replace escaped HTML markup in the request message with equivalent XSL : FO markup .
// Template is based on documentation at http://www.ibm.com/developerworks/xml/library/x-xslfo2app/