Multi-valued attributes

Marcus Carr mrc at
Tue Mar 16 22:14:51 GMT 1999

John Cowan wrote:

> Marcus Carr wrote:
> > I have used
> > ENTITIES quite often to emulate allowing multiple tokens from a token list. NAMES is too loose
> > and I may need more than one value, so a token list is out. By declaring entities and
> > assigning a notation that reflects their meaning, I get the best of both worlds.
> I don't understand what you mean by "token" and "token list".  Can
> you give a more concrete example?  Thanks.

Given the following attlist declaration:

<!ATTLIST sometime days (Mon | Tues | Wed | Thur | Fri) #IMPLIED>

the token list is the collection of available values (tokens).

In the event that I wanted an occurrence of the element to contain multiple days, such as the

<sometime days="Mon Wed Fri">

I could not do it because of the restriction that I can only use one day. If the declared content
was NAMES, I couldn't prevent the insertion of Monday, Wednesday, etc or Sat, Sun. If the declared
content is ENTITIES, then I can declare just the five that I want, case sensitively and get the
desired results. There is a danger that entities designed for one element will get mixed up with
another, but OmniMark (my tool of choice) provides access to the notation associated with the
entity, so you could differentiate the notations and perform a semantic check while parsing. I
believe that this is as close as you can get to allowing multiple well-defined tokens to be
available in an attribute value - nearly on par for rigidity with IDREFS. :-)


Marcus Carr                      email:  mrc at
Allette Systems (Australia)      www:
"Everything should be made as simple as possible, but not simpler."
       - Einstein

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list