Package org.htmlunit.html
Class XmlSerializer
- java.lang.Object
-
- org.htmlunit.html.XmlSerializer
-
public class XmlSerializer extends java.lang.ObjectUtility to handle conversion from HTML code to XML string.
-
-
Constructor Summary
Constructors Constructor Description XmlSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringasText(DomNode node)java.lang.StringasXml(DomElement node)protected java.util.Map<java.lang.String,DomAttr>getAttributesFor(HtmlImage image)protected java.util.Map<java.lang.String,DomAttr>getAttributesFor(HtmlLink link)protected booleanisExcluded(DomElement element)protected voidprintOpeningTag(DomElement node)Prints the content between "<" and ">" (or "/>") in the output of the tag name and its attributes in XML format.protected voidprintText(DomNode node)protected voidprintXml(DomElement node)voidsave(SgmlPage page, java.io.File file)
-
-
-
Method Detail
-
save
public void save(SgmlPage page, java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
asXml
public java.lang.String asXml(DomElement node) throws java.io.IOException
- Parameters:
node- a node- Returns:
- the xml representation according to the setting of this serializer
- Throws:
java.io.IOException- in case of problem saving resources
-
printXml
protected void printXml(DomElement node) throws java.io.IOException
- Throws:
java.io.IOException
-
asText
public java.lang.String asText(DomNode node)
- Parameters:
node- a node- Returns:
- the text representation according to the setting of this serializer
-
printText
protected void printText(DomNode node)
-
printOpeningTag
protected void printOpeningTag(DomElement node) throws java.io.IOException
Prints the content between "<" and ">" (or "/>") in the output of the tag name and its attributes in XML format.- Parameters:
node- the node whose opening tag is to be printed- Throws:
java.io.IOException- in case of problem saving resources
-
getAttributesFor
protected java.util.Map<java.lang.String,DomAttr> getAttributesFor(HtmlLink link) throws java.io.IOException
- Throws:
java.io.IOException
-
getAttributesFor
protected java.util.Map<java.lang.String,DomAttr> getAttributesFor(HtmlImage image)
-
isExcluded
protected boolean isExcluded(DomElement element)
-
-