@Test public void testClone() { Document doc = Jsoup.parse("<title>Hello</title> <p>One<p>Two"); Document clone = doc.clone(); assertEquals("<html><head><title>Hello</title> </head><body><p>One</p><p>Two</p></body></html>", TextUtil.stripNewlines(clone.html())); clone.title("Hello there"); clone.select("p").first().text("One more").attr("id", "1"); assertEquals("<html><head><title>Hello there</title> </head><body><p id=\"1\">One more</p><p>Two</p></body></html>", TextUtil.stripNewlines(clone.html())); assertEquals("<html><head><title>Hello</title> </head><body><p>One</p><p>Two</p></body></html>", TextUtil.stripNewlines(doc.html())); }
@Override public Document clone() { Document clone = (Document) super.clone(); clone.outputSettings = this.outputSettings.clone(); return clone; }
Document extends Element { @Override public Document clone() { Document clone = (Document) super.clone(); clone.outputSettings = this.outputSettings.clone(); return clone; } }
Document extends Element { @Override public Document clone() { Document clone = (Document) super.clone(); clone.outputSettings = this.outputSettings.clone(); return clone; } Document(String baseUri); }
Document extends Element { @Override public Document clone() { Document clone = (Document) super.clone(); clone.outputSettings = this.outputSettings.clone(); return clone; } Document(String baseUri); static Document createShell(String baseUri); String location(); Element head(); Element body(); String title(); void title(String title); Element createElement(String tagName); Document normalise(); @Override String outerHtml(); @Override Element text(String text); @Override String nodeName(); void charset(Charset charset); Charset charset(); void updateMetaCharsetElement(boolean update); boolean updateMetaCharsetElement(); @Override Document clone(); OutputSettings outputSettings(); Document outputSettings(OutputSettings outputSettings); QuirksMode quirksMode(); Document quirksMode(QuirksMode quirksMode); }
Document extends Element { @Override public Document clone() { Document clone = (Document) super.clone(); clone.outputSettings = this.outputSettings.clone(); return clone; } Document(String baseUri); static Document createShell(String baseUri); String location(); Element head(); Element body(); String title(); void title(String title); Element createElement(String tagName); Document normalise(); @Override String outerHtml(); @Override Element text(String text); @Override String nodeName(); void charset(Charset charset); Charset charset(); void updateMetaCharsetElement(boolean update); boolean updateMetaCharsetElement(); @Override Document clone(); OutputSettings outputSettings(); Document outputSettings(OutputSettings outputSettings); QuirksMode quirksMode(); Document quirksMode(QuirksMode quirksMode);  }