• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Testing well-formedness of HTML

 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I test well-formedness of my HTML document produced by Struts/Velocity?

TIA,
- Manish
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTML is not a well-formed markup language - so I'm not sure what you need to test. If you are worried about whether HTML is well-formed in the way XHTML is, then a quick test is save the document as XML and open it in IE.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For testing XHTML for well-formedness and correctness against the official DTD, you can use XHTMLUnit: http://sf.net/projects/xhtmlunit
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have HTTP-UNIT and I was trying to test this with it, but am not too familiar with these tools, so don't know how exactly I can test it. Especially trying to understand how can I get the resultant HTML in my test by passing the parameters to struts action.

rgds,
- Manish
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Manish Hatwalne:
I have HTTP-UNIT and I was trying to test this with it, but am not too familiar with these tools, so don't know how exactly I can test it. Especially trying to understand how can I get the resultant HTML in my test by passing the parameters to struts action.


I would suggest reading the cookbook to get started with the basics and then examining the API to figure out what kind of things you can do with certain types of objects.

For example, the WebResponse#getInputStream() method would probably be relevant for you if you need to access the raw HTML source code produced by your web application (excluding HTTP headers).
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!