I noticed that the <!Doctype> tag at the top of the html is not displayed when I call toHtml on the parent node.
How do I display this as well, and any other items that may not be showing up when I call toHtml on the "parentmost" node?
J
The doctype tag is first node returned by the parser. It's not within the <HTML></HTML>. Do a toHtml() on the first node and it should be the doctype tag:
Parser parser = new Parser ("http://whatever"); NodeIterator iterator = parser.elements (); System.out.println (iterator.nextNode ().toHtml ());
Log in to post a comment.
I noticed that the <!Doctype> tag at the top of the html is not displayed when I call toHtml on the parent node.
How do I display this as well, and any other items that may not be showing up when I call toHtml on the "parentmost" node?
J
The doctype tag is first node returned by the parser.
It's not within the <HTML></HTML>.
Do a toHtml() on the first node and it should be the doctype tag:
Parser parser = new Parser ("http://whatever");
NodeIterator iterator = parser.elements ();
System.out.println (iterator.nextNode ().toHtml ());