Subject: RE: <!DOCTYPE> declaration

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

> On Tuesday, Dec 3, 2002, at 07:08 Canada/Eastern, Hollenbeck, Scott 
> wrote:
> 
> > 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.
> 
> 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."

The XML specs were written with DTD validation in mind, before XML Schema
existed.  XML Schema rewrites some of the earlier validation rules, but the
intent of the <!DOCTYPE> element is still present in the way the instance
document describes both the namespaces and the schema as part of the first
element.

Like I said, though, you can confirm that a validating parser that
understands XML Schema will digest the examples properly by simply parsing
the examples.  You can find files (to save copying and pasting time) here:

http://www.verisign-grs.com/files/

and here:

ftp://ftp.verisign.com/pub/epp/

-Scott-

---

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

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

> document describes both the namespaces and the schema as part of the 

Excellent, thanks for the clue.

Joe