Re: xml:id error erratum confusion (was Re: XML Core WG Status and Open Actions as of 2009 April 13)

Henry S. Thompson scripsit:

> John, anyone, can you explain what's _wrong_ with what D.3 says?  As
> far as I can see, what it says is _true_ of a conformant xml:id +
> RelaxNG processor.
> 
> Section 4 [2] says "An xml:id error occurs for any xml:id attribute that
> does not [satisfy: t]he declared type of the attribute, if it has one,
> is ID."
> 
> D.3 [3] says "A document that uses xml:id attributes that have a declared
> type other than xs:ID will always generate xml:id errors."

The question is, declared by whom, and reported by whom?  Unless the
RELAX NG processor and the xml:id processor are deeply intertwingled,
they have no way to pass type information from one to the other.

If the xml:id processor comes first (as I'd expect), it will set the
attribute type of any xml:id attributes it finds to ID in the Infoset.
But RNG validators completely ignore attribute-type information in the
Infoset.  You can declare some attribute as of type ID using a DTD and
give it a type of xsd:float in the RNG schema, and the RNG validator
will insist that the attribute value look like a float rather than an ID.

Per contra, if the RNG validator comes first, it reports only validity
or invalidity and does not provide a PSVI; thus there is no way for it
to communicate to a later xml:id processor that it believes the attribute
to be of type xs:ID.

So if there is a conflict, nobody is in a position to report it in
either case.

As a sidenote, there is also a mild problem with xml:id and RNG
validation: normally an explicit declaration of xsd:IDness overrides
any wildcard declaration of the attribute (attribute wildcards must be
of type text, with no constraints), but Jing will by default complain
about it anyway, because it handles ID/IDREF checking (which is *not*
part of RNG proper) in a strictly DTD-compatible way.  This will probably
be changed by updating Jing to handle xml:id specially.

-- 
All Norstrilians knew what laughter was:        John Cowan
it was "pleasurable corrigible malfunction".    cowan@ccil.org
        --Cordwainer Smith, Norstrilia

Received on Friday, 17 April 2009 19:25:52 UTC