W3C home > Mailing lists > Public > w3c-sgml-wg@w3.org > June 1997

Re: Valid vs. well formed Documents

From: Michael Sperberg-McQueen <U35395@UICVM.UIC.EDU>
Date: Tue, 10 Jun 97 18:25:48 CDT
Message-Id: <199706102331.TAA17832@www10.w3.org>
To: W3C SGML Working Group <w3c-sgml-wg@w3.org>
On Mon, 9 Jun 1997 09:56:15 -0400 (EDT) Bernhard Weichel said:
>Some weeks ago, I raise the question if any well formed XML document can
>be "upgraded" to a valid XML document. Occasionally I was misunderstood
>to raise the question on good or bad DTDs.

My apologies for misconstruing your note.

>So I want to raise the question again with a simple example:
>
>
>
><wellformed>
>   <empty, x="foo"/>
>   <empty, x="bar">now empty is not empty</empty>
></wellformed>
>
>
>Is this fragment part of a well formed document?

I believe so.

If we preface it with a DTD, it can also be a valid document instance:

 <!DOCTYPE wellformed [
 <!ELEMENT wellformed (empty+)>
 <!ELEMENT empty      (#PCDATA)>
 <!ATTLIST empty
           x          CDATA       #IMPLIED >
 ]>
 <wellformed>
    <empty, x="foo"/>
    <empty, x="bar">now empty is not empty</empty>
 </wellformed>


The form <e/> is required for all elements declared EMPTY.  It is not
necessarily required for all elements which happen to be empty -- but is
certainly well-formed XML and will be valid SGML after the TC allows the
'sole-tag' (<e/>) form to indicate an element with no content.

-C. M. Sperberg-McQueen
Received on Tuesday, 10 June 1997 19:31:28 EDT

This archive was generated by hypermail pre-2.1.9 : Wednesday, 24 September 2003 10:04:40 EDT