Menu

toHtml() and <!Doctype>

Help
2004-07-23
2004-07-26
  • Joel Trunick

    Joel Trunick - 2004-07-23

    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

     
    • Derrick Oswald

      Derrick Oswald - 2004-07-26

      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.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.