Re: to </p> or not to </p>
Jacob Kjome <[email protected]> Mon, 22 Sep 2003 14:52:27 -0500
| Newsgroups | gmane.comp.java.enhydra.xmlc |
|---|---|
| Message-ID | <[email protected]> |
Hi Mark, At 11:47 AM 9/22/2003 -0700, you wrote: >Jacob Kjome <[email protected]> writes: > > I'm wondering what peoples' thoughts are about DOM serialization and > > dealing with <p> elements. Currently, XMLC treats the <p> tag specially, > > classifying it as a tag that shouldn't have an end tag written for > > it.. This seems to have been an arbitrary preference of early developers > > of XMLC. > >I can't really remember why this was done. I think it's the only tag were the >the close tag is optional that is included in the NO_CLOSE_TAGS list. Yep, which is why it seems rather arbitrary. > > So, does anyone have a problem with modifying XMLC to force <p> tags to be > > ended with </p>? Obviously, either form is legal HTML4.01, but ending <p> > > tags with </p> seems like the more correct thing to do and matches up with > >I think the only thing that can be argued here is that it's more consistent >with the rest of the formatting. Since minimization is a part of HTML, >neither form is really more correct. Yep, otherwise we'd exclude the end tag for stuff all the following: <p>, <colgroup>, <dd>, <dt>, <li>, <option>, <tbody>, <td>, <tfoot>, <th>, <thead>, <tr>. To me, either all of these exclude the optional end tag or none of them do. Besides, markup such as complex tables are almost [human] unreadable with end tags excluded. And, actually, minimization is part of XHTML as much as it is for HTML. <br> in HTML is, after all, <br/> in XHTML. Both are minimized. The difference in HTML is that some non-minimized elements (mentioned above) don't require an end tag. > > the the next wave of HTML which is XHTML. People really should get > used to > > this at this point, but I'm asking for opinions here because I don't want > > to break everyone's layouts unnecessarily. > >Personally, I don't see this as an advantage, since XHTML and HTML still >have fundamentally different formatting. It's really deceptive to >imply otherwise. I would rather educate people on the differences >(and why this is a good motivation to use XHTML). I tend to disagree here. There are only a few basic differences between valid HTMl4.01 Strict and XHTML1.0 Strict, especially if one makes it a practice to include optional end tags in the HTML. The only real difference is that tags where end tags are forbidden in HTML simply add a forward slash at the end of the tag (just before the greater-than sign). Otherwise, they are exactly the same. XHTML1.0 doesn't even require an XML header, only a doctype which is perfectly compatible with HTML documents. >I think it really comes down to aesthetics and consistent behavior of the >formatter vs a small chance of irritating a buggy browser. Not sure it's >really worth the trouble, but then I often do somewhat risky things >in the name of consistency. I like consistency and I'm pinging the group to make sure I'm not doing something "risky". Jake