Subject: RE: <!DOCTYPE> declaration

From: "Hollenbeck, Scott" <[email-masked]>
Date: Tue, 3 Dec 2002 07:08:25 -0500

Joe,

The <!DOCTYPE> element is not used in XML Schema instances -- it's only
needed when a DTD is used to validate the document.  All of the examples are
both well-formed and valid, and you can confirm that by running them through
a validating parser like Xerces-J.

-Scott- 

> -----Original Message-----
> From: Joe Abley [mailto:[email-masked]]
> Sent: Tuesday, December 03, 2002 5:23 AM
> To: [email-masked]
> Subject: <!DOCTYPE> declaration
> 
> 
> My reading of the W3C XML spec seems to suggest that all the request 
> and response documents in the current drafts are well-formed, 
> but none 
> of them are valid (in the XML sense) since none of them include a 
> <!DOCTYPE> declaration as their first element.
> 
> My experience with XML parsers is somewhat light, but it seems 
> reasonable to me that a valid document is more likely to play nicely 
> with a validating parser than an invalid document.
> 
> Seems to me like there might be an argument for requiring 
> that request 
> and response documents MUST be valid (and hence include a <!DOCTYPE> 
> element). Alternatively, it could be specified that clients 
> and servers 
> MUST accept a <!DOCTYPE> element if it's present.
> 
> In any case, I think some mention needs to be made of <!DOCTYPE> 
> declarations, unless I am suffering delusions about what the 
> standalone="no" attribute means in the <?xml> decl.
> 
> 
> Joe

---

From: Joe Abley <[email-masked]>
Date: Tue, 3 Dec 2002 07:16:51 -0500

On Tuesday, Dec 3, 2002, at 07:08 Canada/Eastern, Hollenbeck, Scott 

> a validating parser like Xerces-J.

Right, they definitely don't look like they contain errors.

What is confusing me is that the XML spec is quite specific in saying 
that for a document to be valid, it MUST have a <!DOCTYPE> declaration 
as its first element. That makes me wonder whether validating parsers, 
following the letter of the spec, might mark them all invalid for that 
reason.

http://www.w3.org/TR/REC-xml#sec-prolog-dtd

"Definition: An XML document is valid if it has an associated document 
type declaration and if the document complies with the constraints 
expressed in it."

Joe