public String convert ( String messagePayload ) { initialize ( ) ; // check if we already have XHTML message content if ( messagePayload . contains ( XHTML_DOCTYPE_DEFINITION ) ) { return messagePayload ; } else { String xhtmlPayload ; StringWriter xhtmlWriter = new StringWriter ( ) ; tidyInstance . parse ( new StringReader ( messagePayload ) , xhtmlWriter ) ; xhtmlPayload = xhtmlWriter . toString ( ) ; xhtmlPayload = xhtmlPayload . replaceFirst ( W3_XHTML1_URL , "org/w3/xhtml/" ) ; return xhtmlPayload ; } }
Converts message to XHTML conform representation .