MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / asXml

Method asXml

src/main/java/org/htmlunit/html/XmlSerializer.java:106–120  ·  view source on GitHub ↗

@param node a node @return the xml representation according to the setting of this serializer @throws IOException in case of problem saving resources

(final DomElement node)

Source from the content-addressed store, hash-verified

104 * @throws IOException in case of problem saving resources
105 */
106 public String asXml(final DomElement node) throws IOException {
107 builder_.setLength(0);
108 indent_.setLength(0);
109 final SgmlPage page = node.getPage();
110 if (null != page && page.isHtmlPage()) {
111 final Charset charsetName = page.getCharset();
112 if (charsetName != null && node instanceof HtmlHtml) {
113 builder_.append("<?xml version=\"1.0\" encoding=\"").append(charsetName).append("\"?>\n");
114 }
115 }
116 printXml(node);
117 final String response = builder_.toString();
118 builder_.setLength(0);
119 return response;
120 }
121
122 protected void printXml(final DomElement node) throws IOException {
123 if (!isExcluded(node)) {

Callers

nothing calls this directly

Calls 7

isHtmlPageMethod · 0.95
getCharsetMethod · 0.95
printXmlMethod · 0.95
getPageMethod · 0.65
setLengthMethod · 0.45
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected