There is something in the JSP standard about an XML representation for
JSP pages (see
http://java.sun.com/products/jsp/download.html#specs),
but JSP pages are NEITHER XML nor HTML. To illustrate why, consider
the generation of an img tag with the name of the image file coming
from a call to some method on some object:
<img src="<%=picture.getFileName()%>" alt="generated picture">
How could you write this substitution in well-formed xhtml?
That said, I think the relevant question isn't so much whether JSP (or
its competitors, ASP, PHP, ColdFusion, etc.) are valid html, xml or
xhtml. It really is, can they be used to generate conforming valid
xhtml and/or html. If that is relevant, then what you may want to do
is carefully write your JSP so that it constructs a page which is both
valid xhtml (and therefore valid xml) and at the same time, valid
html. Go to the
www.w3c.org site, and look up the specification for
xhtml. There is a discussion in that document on how to write a page
that fills this requirement. Of course, that discussion is based on a
static view. You have to build a JSP whose output conforms to those
guidelines.
Cheers!
- Jerry Oberle