Package org.htmlunit.html
Class XmlSerializer
java.lang.Object
org.htmlunit.html.XmlSerializer
Utility to handle conversion from HTML code to XML string.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasXml(DomElement node) getAttributesFor(HtmlImage image) 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 voidPrints the text content from this node and all children.protected voidprintXml(DomElement node) void
-
Constructor Details
-
XmlSerializer
public XmlSerializer()
-
-
Method Details
-
save
- Throws:
IOException
-
asXml
- Parameters:
node- a node- Returns:
- the xml representation according to the setting of this serializer
- Throws:
IOException- in case of problem saving resources
-
printXml
- Throws:
IOException
-
asText
- Parameters:
node- a node- Returns:
- the text representation according to the setting of this serializer
-
printText
Prints the text content from this node and all children.- Parameters:
node- the node
-
printOpeningTag
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:
IOException- in case of problem saving resources
-
getAttributesFor
- Parameters:
link- the link to get the attributes from- Returns:
- the attribute map
- Throws:
IOException- in case of error
-
getAttributesFor
- Parameters:
image- the image to get the attributes from- Returns:
- the attribute map
-
isExcluded
- Parameters:
element- the element to check- Returns:
- true if the element is a HtmlScript
-