Re: 4. ID assignment and the empty string

/ Ian Hickson <ian@hixie.ch> was heard to say:
| On Wed, 26 Jan 2005, Norman Walsh wrote:
|> 
|> We don't want to make the empty string magic.
|> We want xml:id="" to behave analogously to
|> how id="" (where id is declared ID) behaves.
|
| I agree.
|
| I have nothing against the xml:id attribute always being of type ID. I 
| merely request that the xml:id specification not imply that an attribute 
| of type ID that has no value beyond the empty string assign the empty 
| string to the element as its ID.

ID assignment "is often achieved by promoting the type of an untyped
element or attribute value to a value of type ID". Attributes named
xml:id are going to be turned into attributes of type ID. This is
done without regard to the validity of the attribute value, per
the Infoset:

From 2.3 Attribute Information Items

6. [attribute type] An indication of the type declared for this
   attribute in the DTD. Legitimate values are ID, IDREF, IDREFS,
   ENTITY, ENTITIES, NMTOKEN, NMTOKENS, NOTATION, CDATA, and
   ENUMERATION. If there is no declaration for the attribute, this
   property has no value. If no declaration has been read, but the
   [all declarations processed] property of the document information
   item is false (so there may be an unread declaration), then the
   value of this property is unknown. Applications should treat no
   value and unknown as equivalent to a value of CDATA. The value of
   this property is not affected by the validity of the attribute
   value.

The empty string is not treated as a special case and I do not believe
we should complicate the meaning of ID assignment. One of our goals
has been that the result of xml:id processing should be the same as if
an appropriate declaration has been seen and used by the processor.

In this document:

<!DOCTYPE doc [
<!ATTLIST doc xml:id ID #IMPLIED>
]>
<doc xml:id=""/>

The 'doc' element has an 'id' attribute with an [attribute type] of ID
and a [normalized value] of "". The xml:id specification will provide
identical semantics for this document:

<doc xml:id=""/>

which is the entire point of the specification.

I observe that (1) no existing documents legitimately use xml:id
attributes, (2) there is not now, nor does the xml:id specification
provide, any authorized interpretation of xml:id attributes as
anything other than an ID. It follows that no one should ever use
xml:id="" in a document because it is manifestly wrong.

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@Sun.COM / XML Standards Architect / Sun Microsystems, Inc.
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.

Received on Thursday, 27 January 2005 16:54:06 UTC