Re: required/optional/fixed for xlink:type in sample schema docs

Henry S. Thompson scripsit:

> It follows that, contrary to my initial belief, the sample DTD in
> appendix B of both versions of the spec, is correct in supplying
> appropriate default values for xlink:type in the ATTLIST declarations
> for the various elements (simple, extended, locator, etc.) which it
> defines.

There's a fundamental difference between the three schemas that is not
explained anywhere:

        The DTD provides a particular XLink-compatible schema, and
        validates only documents that claim to adhere to that schema
        (it is truly a sample);

        The XML Schema is a set of components that can be incorporated
        into any particular XLink-compatible schema, but does not itself
        specify which elements are XLink-compatible;

        The RELAX NG schema validates every document that contains
        XLink-compatible markup.

> Given that schema validation may well be independent of xlink
> recognition, I think we should use the latter formulation.

It's not clear whether the XML Schema is meant to be usable in creating
schemas similar to the DTD, where XLink types are implied by element
names, or ones similar to those detected by the RELAX NG version, in which
XLink types (other than simple) must appear explicitly.  If possible,
the XML Schema should be formulated for use in both kinds of document,
straddling your issue.  If not, then it's necessary to document which
of the two intentions is being catered for.

> I also _believe_ that is the only possible formulation in Relax-NG,
> which doesn't _do_ defaults.

Correct.  The attributes must be present for validation to work at all,
because it is by the presence and content of the attributes that the
validator figures out which of the six main patterns to apply (since there
is no notion of element type and the element names are specified as "*").

> If those two schema language versions work that way, I am inclined to
> change the DTD to require explicit xlink:type (except for the simple
> link case, of course) as well.

Because the DTD is truly a sample, it's still I think reasonable to allow
the element name to imply the XLink type.  What is more, there doesn't
seem to be any way to say "must be present and must have this value"
except to use an enumeration:

        <?ATTLIST extended
            type (extended) #REQUIRED>

which unfortunately changes the infoset.

-- 
But that, he realized, was a foolish            John Cowan
thought; as no one knew better than he          cowan@ccil.org
that the Wall had no other side.                http://www.ccil.org/~cowan
        --Arthur C. Clarke, "The Wall of Darkness"

Received on Monday, 14 July 2008 21:53:36 UTC