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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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.