- From: Paul Grosso <paul@paulgrosso.name>
- Date: Mon, 20 Jan 2014 09:58:55 -0600
- To: public-xml-core-wg@w3.org
On 2014-01-19 18:42, John Cowan wrote: > Paul Grosso scripsit: > >> Interesting. I think they are (potentially) subject to validation, >> but what does it mean to validate a document against a "null" DTD? > A document with a DOCTYPE but neither an internal nor an external subset > is well-formed but invalid, because as Leif says all the elements and > attributes report that they are undeclared. > > This is the way it should be. XML is not HTML, and HTML validity is > not XML validity. Furthermore, XHTML5 conformance does not require > XML validity. > Yes, of course, I wasn't thinking correctly. The "Element valid" validity constraint [1] says "An element is valid if there is a declaration [for it]". What I was thinking was that it's "fine" to have an "empty DTD" or a partial set of declarations (e.g., for some elements and/or attributes), and certain tools may use those declarations (e.g., to provide some attribute defaults) when producing the infoset. Then, furthermore, one might later "validate" such a document against some (non-DTD) schema. But "fine" above still doesn't mean "valid" in the technical XML sense. [Unless one uses a catalog entry to associate a complete DTD with the document.] To reply to the original subject, to wit: Clarify that documents with DOCTYPE but without markup declaration are not subject to validation I'd say that the XML spec has no concept of "subject to validation". That is a tool issue. Per section 5.1 Validating and Non-Validating Processors [2]: Conforming XML processors fall into two classes: validating and non-validating. No where does the spec say that anything in the document (e.g., a doctype declaration) forces use of a validating processor. paul [1] http://www.w3.org/TR/REC-xml/#elementvalid [2] http://www.w3.org/TR/REC-xml/#proc-types
Received on Monday, 20 January 2014 15:59:25 UTC