Re: On Henry's comment about documents with DOCTYPE but without markup declaration

On 2014-01-28 12:49, Henry S. Thompson wrote:
>
>> In particular, if there is no DTD, and the user has not chosen to turn
>> off reporting of validity errors, a validating parser must diagnose a
>> a violation of the Element Valid VC for every element, and a violation
>> of the Attribute Value Type VC for every attribute.  The definition
>> of Element Valid begins "An element is valid if there is a declaration
>> matching elementdecl where the Name matches the element type" and since
>> there is not, every element in the document is invalid.  Similarly,
>> the definition of Attribute Value Type begins "The attribute must have
>> been declared", and it has not.
>>
>>> <!DOCTYPE html>
>>> <xyzzy/>
>> A validating parser, [must report] a violation of the Element
>> Valid VC
> I agree wrt that example, because, at least on a pedantic reading, it
> _has_ a document type definition.  But I don't agree wrt just plain
>
> <xyzzy/>
>
> which definitely lacks a document type definition.  I believe John and
> Paul are both arguing that a parser when invoked in validating mode
> must report a violation of the Element Valid VC for such a document.


Yes, I would argue that it "MUST, at user option, report" that
violation (quote from the definition of "validating processor").


>
> For me that case is the crux of the matter, and it asks a substantive
> question.  In practice neither rxp nor xmllint report an Element Valid
> VC, when invoked on that document in validating mode---are they
> to be labelled non-conforming as a result?
>
> On my interpretation, they're right not to do so.  On John's (and
> Paul's, I think) they're wrong.

If we're talking about a validating processor, it "MUST, at user
option, report" that violation.  (I never was quite sure what the
"at user option" part means.)  If--as mentioned below--a tool decides
to react to the absence of a DTD by switching out of validating mode,
I think that's fine.



>
> At the very least the wording of the definition of *valid* [1] and the
> wording in the Conformance section [2] need to be brought into line.

Yes, in an earlier email, I suggested augmenting the definition
of valid to read:

  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 and the document violates no
  validity constraints.

[Final seven words above to be added.]

But I consider that a clarification of what is already evident
enough in the spec.


>
> But I'm curious what the original authors thought they were asking for
> a parser to do, when invoked in validating mode, on a well-formed
> document with no document type definition.
>
> I find rxp's warning message the most illuminating:
>
>    Document has no DTD, validating abandoned

As I said above, if the tool wants to use the absence
of a DTD to signal that it shouldn't act as a validating
processor, that's fine.  But if it is going to return
a boolean response to the question "is document valid",
it must return "false".


>
> ht
>
> [1] http://www.w3.org/TR/REC-xml/#dt-valid
> [2] http://www.w3.org/TR/REC-xml/#dt-validating
> [3] http://www.w3.org/XML/Test/xmlconf-20130923.html

Received on Tuesday, 28 January 2014 19:41:55 UTC