Re: Minimized P valid XHTML?

At 2001-03-29T18:14-0000, Osmo Saarikumpu wrote:-

> 4.3 For non-empty elements, end tags are required
>
> In SGML-based HTML 4 certain elements were permitted to omit the end tag;
> with the elements that followed implying closure. This omission is not
> permitted in XML-based XHTML. All elements other than those declared in the
> DTD as EMPTY must have an end tag.
>
> So, this is not a backwards compatibility issue, at least as far as I can
> tell?

It is, in that that is the reason that that constraint is present. The
document is still valid XML if all contentless element instances are
represented by empty-element tags.

> Concerning this then, I have a question (I'm relying on your kindness):
>
> Is the following document then perfectly valid, as the validator says, or is
> it invalid, as it would seem to me (according to my understanding of the the
> wording of the Reformulation of HTML 4 in XML 1.0):
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <title>Testing</title>
> </head>
> <body>
> <h1 />Hello world!
> <q />Hello again!
> <p />Have a nice day!
> </body>
> </html>

It is _valid_, if rather strange (since the three child elements of body
are all empty). It is not _conformant_ XHTML 1.0, as it violates a
constraint imposed outside the DTD (viz. that any element not declared as
EMPTY must have an end tag).


Tim Bagot

Received on Thursday, 29 March 2001 14:21:57 UTC