[Standards] About stream namespaces

Robin Redeker elmex at x-paste.de
Mon Mar 19 06:22:12 UTC 2007

On Mon, Mar 19, 2007 at 04:24:56PM +1100, Daniel Noll wrote:
> > The whole paragraph '5 Conformance' in
> >     http://www.w3.org/TR/2006/REC-xml-20060816/#sec-conformance
> > says that any parser has to check for well-formedness.
> >
> > To check a XML document for well-formedness it first needs a _complete_
> > XML document (the recommendation does not define 'partial' XML
> > documents).
> >
> > And the quoted paragraph above says that any information retrieved from
> > unchecked or even errornous documents is not defined.
> Actually you can't even say "no, it isn't well-formed because it hasn't
> ended yet."  The well-formedness itself is undefined until the document
> ends -- it may be well-formed or it may not be well-formed.  (Quantum
> physicists would have us believe that it's both at the same time. ;-))

You can't check a partial XML document, because no such thing exists in
the recommendation.

And aside from that: Until you can say whether it's well-formed or not
any information got from the document is undefined to be correct.

> | Non-validating processors are REQUIRED to check only the document entity,
> | including the entire internal DTD subset, for well-formedness.
> This doesn't state that the entire document needs to be present either. 
> But it does state that if a DOCTYPE is present, the entire DTD needs to be
> validated.

It speaks about a 'document entity'. And a 'document entity' "is
well-formed if it matches the production labeled document." (4.3.2
Well-Formed Parsed Entities).

This text here: '<?xml version="1.0"?> <greeting>Hello, world!'
Is not well-formed XML. And you can't say what the contents
of the <greeting> element is until you have read the closing tag
and verified the well-formedness.

More information about the Standards mailing list