public class HtmlSerialization extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY
Used to key an instance of HtmlSerializer in
document.getUserData
|
static Set<String> |
URL_ATTRIBUTES |
| Constructor and Description |
|---|
HtmlSerialization() |
| Modifier and Type | Method and Description |
|---|---|
static void |
attach(Document doc,
HtmlSerializer serializer,
String originalContent)
Attach a serializer instance to the document
|
static StringWriter |
createWriter(Document doc)
Create a writer sized to the original length of the document
|
static boolean |
isUrlAttribute(org.apache.xerces.xni.QName name,
String attributeName)
Returns true if the listed attribute is an URL attribute.
|
static void |
outputDocType(DocumentType docType,
Appendable output) |
static void |
printEscapedText(CharSequence text,
Appendable output) |
static void |
printStartElement(Element elem,
Appendable output,
boolean withXmlClose)
Print the start of an HTML element.
|
static void |
printStartElement(String tagName,
NamedNodeMap attributes,
Appendable output,
boolean withXmlClose) |
static String |
serialize(Document doc)
Call the attached serializer and output the document
|
public static final String KEY
public static void attach(Document doc, HtmlSerializer serializer, String originalContent)
doc - serializer - originalContent - may be nullpublic static StringWriter createWriter(Document doc)
doc - public static String serialize(Document doc)
doc - public static void printEscapedText(CharSequence text, Appendable output) throws IOException
IOExceptionpublic static void printStartElement(Element elem, Appendable output, boolean withXmlClose) throws IOException
IOExceptionpublic static void printStartElement(String tagName, NamedNodeMap attributes, Appendable output, boolean withXmlClose) throws IOException
IOExceptionpublic static void outputDocType(DocumentType docType, Appendable output) throws IOException
IOExceptionpublic static boolean isUrlAttribute(org.apache.xerces.xni.QName name,
String attributeName)
Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.