OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   XML Schemas and the Enumeration Facet

[ Lists Home | Date Index | Thread Index ]
  • From: Daniel Potter <dpotter@mitre.org>
  • To: xml-dev@ic.ac.uk, www-xml-schema-comments@w3c.org
  • Date: Mon, 03 Jan 2000 16:51:14 -0500

I have some questions about using the enumeration facet along with other
facets which I hope someone can explain.

The enumeration facet is defined as "constrain[ing] the value space of
the datatype to the specified list" which I take to mean intuitively
that the "instances" of data which are to be checked against the
datatype with the enumeration must be in the list.

An enumeration could be as follows:

<datatype name="example" source="string">
   <enumeration value="first value">
   <enumeration value="another">
   <enumeration value="third">
</datatype>

This would mean that any elements corresponding to the example datatype
must be either "first value", "another" or "third".  So
<example>third</example> is OK, but <example>ABC</example> is wrong. 
(Assuming example is of type example, of course :)

HOWEVER, suppose that instead:

<datatype name="example" source="string">
   <enumeration value="first value">
   <enumeration value="another">
   <enumeration value="third">
   <maxlength value="7">
</datatype>

This would be OK, except that "first value" has a length of eleven,
meaning that it does not fit in the datatype where the maximum length is
seven.  However, it is specified to belong by enumeration.  Which takes
precendence?  The first to appear?  The last?

Can enumeration be used to add values which would otherwise be illegal? 
And what happens when enumeration is used with other facets?  Apparently
this is legal.  And if a user-defined datatype specifies facets over a
datatype with enumerated values, what happens if the new facets render
some of the enumerated values invalid?  (Or what if it enumerates values
which are illegal by the underlying datatype it's generated over?)

Finally, a quick question about the float/double datatype.  Should the
default exponent *really* be one?  Shouldn't it be zero?  According to
the spec, if Exx is not specified, it defaults to one.  Isn't 1E1 = 10? 
So wouldn't that multiply all values by ten compared to what the author
most likely intended?  (If I wrote <float>3.14159</float>, wouldn't it
be read as 31.4159?)  Just curious if this is a typo, or if I'm
misunderstanding something, or if it is intended the way I understand
it.

Thanks for any help on these questions.


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






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS