Re: ID Characters (was: Re: 3.4. Global attributes)

2007/8/1, Henri Sivonen:
>
> On Aug 1, 2007, at 05:05, Jason White wrote:
>
> > On Wed, Aug 01, 2007 at 09:36:37AM +0900, Karl Dubost wrote:
> >> (here I would add a reference to
> >> http://www.w3.org/TR/xml-id/#id-avn )
> >
> > A normative reference?
>
> I think it is worth pointing out that an xml:id Processor, per spec,
> can perform ID assignment even if the value is not an NCName. That
> is, even the xml:id spec implicitly concedes that it is possible to
> continue processing with a value that isn't an NCName.
>
> "The xml:id processor performs ID type assignment on all xml:id
> attributes, even those that do not satisfy the constraints."
>
> > Also, for XML compatibility, shouldn't the "author" section of the
> > proposal
> > require that the id satisfy the XML id syntax?
>
> Why would such "XML compatibility" be needed?
>
> When DTDless XHTML5 is parsed using an XML parser, the id attribute
> doesn't have the type ID. It has the type CDATA and is not subject to
> the ID constraints of the XML 1.0 spec in the XML Processor (aka.
> parser).
>
> If you wish to expose XHTML5 id attributes as IDs to XML tools, you
> need an intermediate ID assignment processing stage analogous to an
> xml:id Processor. I propose calling it an "XHTML id Processor". This
> is what I use to make the XPath id() function work with XHTML5.
>
> As far as I can tell, the Name and NCName restrictions of XML 1.0 and
> xml:id/XSD are completely arbitrary and real software that uses an
> XML API to do stuff with XML tends to just do string equality
> checking on IDs instead of rechecking the Name/NCName matching in
> each stage after the initial parse.

More to the point: AFAIK, XML Schema has no such constraints when you
use xsd:key / xsd:keyref. Any "kind" of value can be used as a key,
not only an xsd:ID.
I suppose RelaxNG has no such constraint either, so it's really only a
problem with XML DTDs (and xml:id, but we're talking about (X)HTML5's
id attributes here, not xml:id).

-- 
Thomas Broyer

Received on Wednesday, 1 August 2007 09:21:45 UTC