enumeration and defaults

Stewart Rubenstein sdr at camsoft.com
Mon Sep 13 23:33:12 BST 1999

It's important to distinguish between empty-value and not-present.

Empty-value for enumerated types is simply not supported.  You have to use a
value like "none" or "unspecified" and use an extra layer of filtering if
your application requires the empty string for these cases internally.  I'd
like to be able to say
  <!ATTLIST foo ( a | b | c | ) "a"> <!-- default is "a", but "" is also
permitted -->
  <!ATTLIST bar ( a | b | c | ) "">  <!-- default is empty, not
not-present -->
but AFAIK I can't express this in a DTD.  I don't think it's what you were

However, not-present *is* supported as the default value, that's exactly
what #IMPLIED gets you.  Not-present is not supported as a non-default

I don't know whether Tim was talking about empty-value support or
not-present as a non-default value.  I would find empty-value support
helpful in making my documents and processing more natural, but I can work
around that problem.  I don't see a need for not-present as a non-default
value, myself.

CTO, CambridgeSoft Corp
> -----Original Message-----
> My original question:
> http://www.lists.ic.ac.uk/hypermail/xml-dev/xml-dev-Sep-1999/0606.html
> (basically, is it legit to use #IMPLIED on the declaration for an
> enumerated attribute type and NOT specify a value in the document.)
> At 05:22 PM 9/10/99 -0400, John Cowan wrote:
> http://www.lists.ic.ac.uk/hypermail/xml-dev/xml-dev-Sep-1999/0636.html
> (basically, yes. XHTML does it.)
> At 02:32 PM 9/10/99 -0700, Tim Bray wrote:
> http://www.lists.ic.ac.uk/hypermail/xml-dev/xml-dev-Sep-1999/0609.html
> (basically, no, but it would be nice to see in schemas.)

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

More information about the Xml-dev mailing list