Alan Burlison wrote:
>
> I'm trying to get my pages to validate as HTML 4.01 strict, but the
> Stripes tags output "/>" instead of ">" on the output they generate.
> I'm sure I've seen this discussed somewhere, but for the life of me I
> can't find it.
>
You would have to use your own tag library, or hack into the current one.
It would be a big pain in the ass to extend the current system, and frankly
I don't think it would work because of all the interdependencies, so really
the best way to do it would be to get the stripes source, build it yourself,
make your own little branch for yourself and just code in your own
replacement to the following
file:net.sourceforge.stripes.tag.HtmlTagSupport.java. Specifically, this
part:
/**
* Writes out a close tag using the tag name supplied.
*
* @param writer the JspWriter to write the open tag to
* @param tag the name of the tag to use
* @throws JspException if the JspWriter causes an exception
**/
protected void writeCloseTag(JspWriter writer, String tag) throws
JspException {
try {
writer.print("</");
writer.print(tag);
writer.print(">");
} catch (IOException ioe) {
JspException jspe = new JspException("IOException encountered
while writing close tag </" + tag + "> to the JspWriter.", ioe);
log.warn(jspe);
throw jspe;
}
}
/**
* Writes out a singleton tag (aka a bodiless tag or self-closing tag).
Similar to
* writeOpenTag except that instead of leaving the tag open, it closes
the tag.
*
* @param writer the JspWriter to write the open tag to
* @param tag the name of the tag to use
* @throws JspException if the JspWriter causes an exception
**/
protected void writeSingletonTag(JspWriter writer, String tag) throws
JspException {
try {
writer.print("<");
writer.print(tag);
writeAttributes(writer);
writer.print(" />");
} catch (IOException ioe) {
JspException jspe = new JspException("IOException encountered
while writing singleton tag &t;" + tag + "/> to the JspWriter.", ioe);
log.warn(jspe);
throw jspe;
}
This would be about where you'd throw in some kind of lookup table to verify
the tag is a self-closing or an open-style tag. But let me warn you, HTML
4.01 Strict has a dark side. And it looks something like this:
<table>
<tr>
<td>I'm a table cell!
<td>Hey, I didn't even put a closing tag.
<td>Hey, that's kind-of screwed-up, don't ya' think?
<tr>
<td colspan=3>Wow, don't even need quotes, huh? That's valid you
say? Yeesh. Looks pretty ugly to me.
</table>
At some point you've got to ask yourself, if it's really just a guideline,
how much time are you spending trying to satisfy some kind of self-satisfied
ego-trip? Don't get me wrong, I've spent countless hours trying to make my
documents HTML 4.01 Strict... no closing tags on inputs, imgs, links, brs...
all sorts of things. But if it's not perfect, it doesn't make it the end of
the world. Most web browsers since Netscape/IE 3 have understood that the
HTML they got in wasn't going to be perfectly formatted, and it will still
work with close tag or without, so what's the difference? I mean, there's
no gold ribbon for being perfectly HTML 4.01 Strict compliant, you know.
You can't even make the XML argument, which goes something like, "Parsers
can operate faster if they're guaranteed valid XML input" which is a load of
hooey, but regardless, none of it matters. If you send your document in
HTML, it gets treated like tag soup by the browser. If you send it in
perfect XML you'll
http://www.killersites.com/blog/2005/tag-soup-why-using-xhtml-does-make-sense/
still probably get treated like tag soup. And for what? Are your pages
going to look any better magically? No. Are they going to function better?
No. Are they going to be smaller, and faster? Perhaps a bit. But big
deal. You'll spend more cycles looking up whether this tag is self-closing
or that one isn't, when you could just say, heck with it, just follow a
simple pattern that all the browsers will understand and leave the dogma at
the doorstep.
--
View this message in context:
http://www.nabble.com/-%3E-versus-%3E-tp16333786p16341387.html
Sent from the stripes-users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users