Re: NMTOKEN elements?

In section 3.3.4,  where NMTOKEN is defined, the Datatypes spec says
"For compatibility (see Terminolgy (1.4)) NMTOKEN should be used only
in attributes."  If you go to 1.4, it defines "compatibility" as
compatibilty
with the XML 1.0 spec.

This means that you are free to use NMTOKEN as an element value but
your instance documents will not conform to the XML 1.0 spec.

All the best, Ashok


"DuCharme, Robert" <Robert.DuCharme@moodys.com>@w3.org on 06/23/2000
10:16:05 AM

Sent by:  www-xml-schema-comments-request@w3.org


To:   "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
cc:
Subject:  NMTOKEN elements?



I was thinking about how XML schemas allow the specification of types for
both elements and attributes, and how the old attribute types are retained
for backward compatibility, and I realized that this allowed for the
possibility of NMTOKEN elements (not to mention NMTOKENS elements).

The bottom of the first table in 2.3 of the schema primer
(http://www.w3.org/TR/xmlschema-0/#CreatDt) tells us that "to retain
compatibility between XML Schema and XML 1.0 DTDs, the simple types ID,
IDREF, IDREFS, ENTITY, ENTITIES, NOTATION, NMTOKEN, NMTOKENS should only be
used in attributes." The normative spec doesn't mention this; in fact, an
example there actually uses it: in section 4.3.3 of Part 1 of the spec, the
definition of a complexType called "length2" includes a subelement ("unit")
declared as being of type NMTOKEN.

Section 3.3.3 of the XML spec (http://www.w3.org/TR/REC-xml#AVNormalize)
describes specific responsibilities of an XML parser for, among other
things, normalizing the space included with a non-CDATA attribute value.
Without this normalization, there's not much point in using NMTOKEN. Have a
parser's responsibilities regarding NMTOKEN  element types been addressed
anywhere?

Bob DuCharme          www.snee.com/bob           <bob@
snee.com>  "The elements be kind to thee, and make thy
spirits all of comfort!" Anthony and Cleopatra, III ii

Received on Friday, 23 June 2000 10:37:50 UTC