Re: XHTML - two questions

(Frank speaking for himself)

The easy one first.

>4.1.6 Empty Elements
>Empty elements must end with />.
>====================
>
>What about <br></br> which is legal in XML 1.0: "If an element is empty, it
>must be represented either by a start-tag immediately followed by an
end-tag
>or by an empty-element tag."
>(http://www.w3.org/TR/1998/REC-xml-19980210#sec-starttags)
>
>Is it not allowed to write <br></br> in XHTML?

Yes XML allows you to do this, however to be compatible with down level
browsers it is suggested you write <br />. Note the space before the
vertical slash.

This is a gross hack based on the fact that when parsing an element most
browsers look for either a 'space' or a '>' to read the element name.

However in future browsers using an XML engine, you should be able to use
the syntax you suggested.

For your second question.

If I write a SGML application such as an HTML document, it should conform to
the HTML DTD. (The fact that 98% of the documents on the web don't is beside
the point *grin*). If I wanted to add  new elements, it would mean rewriting
the whole DTD.

Using XML I can write a module containing my new elements, and reference it
from my DTD. All I would have to provide is the module.

A the present time the exact mechanism for doing this is under discussion
(see the WD), but one way that you can look at right now is via a name
space.

Both IE5b2 and Gecko allow you to reference HTML elements in your own XML
document using a namespace.

Frank (speaking for myself)





----- Original Message -----
From: Stefan Mintert <mintert@irb.informatik.uni-dortmund.de>
To: <www-html@w3.org>
Cc: <mintert@irb.informatik.uni-dortmund.de>
Sent: Thursday, February 25, 1999 8:18 AM
Subject: XHTML - two questions


>
>
>
>Hi!
>
>
>I have two questions concerning the XHTML 1.0 WD (WD-html-in-xml-19990224).
>Thanks in advance for any answers.
>
>
>====================
>1.3 Why the need for XHTML?
>[...]
>Under SGML, the
>     addition of a new group of elements would mean
>     alteration of the entire DTD. In an XML-based
>     DTD, all that is required is that the new set of
>     elements be internally consistent and well-formed
>     to be added to an existing DTD.
>====================
>
>
>I don't understand this statement.
>
>1) Why do I need to alter the *entire* DTD under SGML? I have to modify the
>content models of some old element types to allow some new element types as
>child elements.
>
>2) If I add a new set of elements to a XML DTD by putting the appropriate
><!ELEMENT ..> declarations at the end of the DTD, what does that help? As
>long as none of the new element types is included in the content model of
>some of the old element types, this change has no affect. I have to alter
the
>old DTD. Where's the difference to SGML?
>
>
>
>
>====================
>4.1.6 Empty Elements
>Empty elements must end with />.
>====================
>
>What about <br></br> which is legal in XML 1.0: "If an element is empty, it
>must be represented either by a start-tag immediately followed by an
end-tag
>or by an empty-element tag."
>(http://www.w3.org/TR/1998/REC-xml-19980210#sec-starttags)
>
>Is it not allowed to write <br></br> in XHTML?
>
>
>
>Bye,
>
>  Stefan.
>
>+-----------------------------------------------------------+
>  Stefan Mintert
>       UniDo:    mintert@irb.informatik.uni-dortmund.de
>       private:  stefan@mintert.com
>+-----------------------------------------------------------+
>
>
>        "let the music keep our spirits high..."
>
>                                (Jackson Browne)
>
>

Received on Thursday, 25 February 1999 10:12:39 UTC