At 03:42 PM 2001-04-08 +0200, Bjoern Hoehrmann wrote:
>[...]I strongly agree with your design rationale, but I still don't
>understand, why the manual implies, that the given construct is legal.
>[... i.e., where a table is inside a p ...]

Somewhere along the line I saw a decent amount of HTML that would've been
impossible to interpret if one assumed that p's /couldn't/ contain some set
of block-level elements, tables among them; and I apparently saw little or
no code that would break if one assumed that a p /could/ contain such
elements.


There were actually two points of contention in TreeBuilder's treatment of
p's: 1) what /can't/ be in a p, and so closes any open p, and 2) what /has/
to be in a p, and so implicates a p if a p (or li, or tr, or any other
phrasal-container) isn't open.  And I mix up which of those got which sort
of fiddling-with, but I'm rather sure they both got mulled over.


>If your application stores the content
>model in a different format, you don't need a DTD. HTML::Tagset
>does it this way. It does this in a manner i don't like, i.e. not
>conforming to the HTML 4.01 DTDs, e.g. %HTML::Tagset::optionalEndTag
>only stores those elements where the end tag is 'safely' omittable.

HTML::Tagset is mostly just tables that were needed for HTML::TreeBuilder
to work; each table is the way it is because something would have broken if
it were some other way -- conformance to a DTD was rarely if ever a
consideration.
To reuse a metaphor from linguistics, the DTDs are a prescriptive grammar,
but what I needed was a DEscriptive grammar -- and the DTDs didn't work for
that, so I had to come up with my own.  And, as is typically the case
between prescriptive and descriptive grammars, they do not agree.

If you want the information from the DTD, well, go get it from the DTD.
The only reason there's no CPAN module yet that merely recapitulates the
data in whatever HTML DTD you like, is just that no-one's written such a
thing and decided to put it in CPAN.  You could write it!


--
Sean M. Burke  [EMAIL PROTECTED]  http://www.spinn.net/~sburke/

Reply via email to