public class HtmlTransformer
extends java.lang.Object
implements java.io.Serializable, org.w3c.tidy.TidyMessageListener
Modifier and Type | Field and Description |
---|---|
protected org.w3c.tidy.Tidy |
ivTidy
The Tidy parser that will perform transformations.
|
private static java.lang.String |
MSG
The formatter for messages logged to the log writer.
|
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
HtmlTransformer()
Constructs a new HTML transformer.
|
Modifier and Type | Method and Description |
---|---|
void |
messageReceived(org.w3c.tidy.TidyMessage message)
Called by Tidy when a warning or error occurs during transformation.
|
java.io.ByteArrayOutputStream |
toXhtml(java.lang.String html)
Transforms HTML to XHTML and returns the results.
|
java.io.ByteArrayOutputStream |
toXhtml(java.lang.String template,
org.apache.velocity.VelocityContext data)
Transforms HTML to XHTML and returns the results.
|
java.io.ByteArrayOutputStream |
toXml(java.lang.String html)
Transforms HTML to XML and returns the results.
|
java.io.ByteArrayOutputStream |
toXml(java.lang.String template,
org.apache.velocity.VelocityContext data)
Transforms HTML to XML and returns the results.
|
java.io.ByteArrayOutputStream |
toXml2(java.lang.String xml)
Transforms XML to XML and returns the results.
|
java.io.ByteArrayOutputStream |
toXml2(java.lang.String template,
org.apache.velocity.VelocityContext data)
Transforms XML to XML and returns the results.
|
private static final long serialVersionUID
private static final java.lang.String MSG
protected org.w3c.tidy.Tidy ivTidy
public java.io.ByteArrayOutputStream toXhtml(java.lang.String html) throws java.lang.Exception
html
- (String) The HTML to process.java.lang.Exception
- - if an error occurs during transformation.public java.io.ByteArrayOutputStream toXhtml(java.lang.String template, org.apache.velocity.VelocityContext data) throws java.lang.Exception
template
- (String) The name of the HTML template file to process.data
- (VelocityContext) The data to use for substitutions or
null
if no data is to be substituted.java.lang.Exception
- - if an error occurs during transformation.public java.io.ByteArrayOutputStream toXml(java.lang.String html) throws java.lang.Exception
html
- (String) The HTML to process.java.lang.Exception
- - if an error occurs during transformation.public java.io.ByteArrayOutputStream toXml(java.lang.String template, org.apache.velocity.VelocityContext data) throws java.lang.Exception
template
- (String) The name of the HTML template file to process.data
- (VelocityContext) The data to use for substitutions or
null
if no data is to be substituted.java.lang.Exception
- - if an error occurs during transformation.public java.io.ByteArrayOutputStream toXml2(java.lang.String xml) throws java.lang.Exception
xml
- (String) The XML to process.java.lang.Exception
- - if an error occurs during transformation.public java.io.ByteArrayOutputStream toXml2(java.lang.String template, org.apache.velocity.VelocityContext data) throws java.lang.Exception
template
- (String) The name of the XML template file to process.data
- (VelocityContext) The data to use for substitutions or
null
if no data is to be substituted.java.lang.Exception
- - if an error occurs during transformation.public void messageReceived(org.w3c.tidy.TidyMessage message)
messageReceived
in interface org.w3c.tidy.TidyMessageListener
message
- (TidyMessage) A Tidy message.