[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Attribute type NMTOKEN

  • From: "John E. Simpson" <simpson@p...>
  • To: xml-dev@i...
  • Date: Sat, 09 May 1998 10:25:20 -0400

At 09:50 AM 5/8/98 -0400, in a stuporous moment I wrote:
>a type of NMTOKEN would not allow a value such as
>"1ABC," "//ENGLISH," or "  WHITESPACE."

At 04:25 PM 5/8/98 -0400, Chris Maden clarified:
>A possible misunderstanding here: a NMTOKEN itself can't contain
>whitespace, but the attribute value specification, the quoted thing
>after the equals sign, can: so
><my-element my-name-token="  WHITESPACE">
>*is* a valid NMTOKEN attribute specification.  The NMTOKEN in this
>example is only "WHITESPACE", though; the leading (and trailing)
>whitespace is trimmed.

Then at 03:31 PM 5/8/98 -0600, Russ Heithoff further clarified:
>Also, if I remember right, a NMTOKEN can start with Name characters.  This 
>is in contrast to a Name which must start with Name Start characters 
>followed by characters.  In otherwords 1ABC is a legal NMTOKEN but not a 
>legal NAME.

Sheesh -- 2 flubs out of 3 swings at it!

So to summarize: 

(1) The purpose of the NMTOKEN attribute type is to constrain the content
of attribute values by their *form* (rather than by their actual value, as
would be done with an enumeration). (I think this general statement was
true even though I muffed the examples!)

(2) The *form* of an attribute value declared as type NMTOKEN is such that
it may contain only valid NAME characters. The valid name characters are
"letters" (alphabetics as expressed in ASCII Latin, ISO Latin, and so on);
digits (also including ASCII and various international sets); limited
punctuation (full stop (.), hyphen (-), colon (:)); and various combining
and extending characters required for internationalization. Internal
whitespace is not allowed in NMTOKEN-type attribute values. [Constraints in
item (2) established by productions #4, 7, and 84-89 in REC-xml-19900210.]

(3) Leading and trailing whitespace is trimmed/ignored before determining
whether the value is valid for a NMTOKEN-type attribute.

Thanks to Chris (again) and Russ for correcting my examples.

Best regards,			| It's no disgrace t'be poor,
John E. Simpson			| but it might as well be.
simpson@p...		| 		-- "Kin" Hubbard

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.