At 8:49 AM -0700 7/10/02, Mark Newhouse wrote:
> > Is there a reason why you have separated the markup into one
> > paragraph, a list, then a second paragraph? Structurally, this is
> > just a list *inside* a paragraph. Why not mark it up that way?
><answer style="length: short-and-to-the-point;">
>It is invalid XHTML.
And how does one know this in advance, except by running the
validator? I have spent a good thirty minutes surfing the web trying
to come up with a set of human-readable rules which answers this kind
of question, without success. I did locate the official DTD, but
that did not qualify as "human-readable." Is there a resource that
spits out the DTD rules in an understandable way, or do I just have
to re-validate everytime?
>Now, DIVs can contain anything. We could mark it up as a DIV with a list
>inside of it. But my whole idea was to add structure to a list that might
>otherwise not be seen in the document structure as a list. Taking the text
>out of a paragraph and putting it in a DIV removes the structure of the
>paragraph from the document. So it's six of one, half a dozen of the other,
>I guess. The P UL P compromise seemed best to me.
Hmm. Still seems counter-intuitive, at the least. I guess I would
still favor the non-list approach unless the main content of the
paragraph itself *is* the list. P UL P is definitely a compromise,
but I guess it is probably the best you can do if 1. you really need
valid markup, and 2. the list is central to the meaning.
This strikes me as a case of a rule that *will* get violated, and
therefore should be changed. People who validate code will do it
right, but there will be plenty of folks who don't and will dash off
pages on the perfectly reasonable assumption that this sort of
nesting makes sense (like I just did, except I wouldn't have posted a
final site page before validating). Most browsers will probably
render it as intended (it would almost take a special effort not to
do so) and the rule itself will end up obsolete.
Better to just change the rule, IMO.