Menu

Does httpunit support XML page?

Help
Tommy Tam
2003-08-01
2003-09-08
  • Tommy Tam

    Tommy Tam - 2003-08-01

    Some pages of my site product XML instead of HTML as the result. When I use getResponse(), it says

    ;  line 6 column 1 - Error: <message> is not recognized!
    ;
    ; This document has errors that must be fixed before
    ; using HTML Tidy to generate a tidied up version.

    How can I inspect the data in XML page?

     
    • Christian Hargraves

      For starters, try using the latest httpunit if haven't already.

      I don't know if HttpUnit supports XML, but you can check by taking JTidy.jar out of your classpath ( make sure you have nekohtml.jar in your classpath instead -- this should come with the httpunit tarball ).

      Nekohtml ( neko in Japanese means cat -- tidy - cat .. you like ;-) ). is much more forgiving than JTidy and you will then be able to parse your XML document by the getDOM() method in the WebReponse class. You might able to make things a bit easier to parse your XML by sending the DOM to another parser or something like jdom.

       

Log in to post a comment.

MongoDB Logo MongoDB