W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2007

Simple Type definition Language

From: Hedenus, Michael (EXT) <Michael.Hedenus.ext@siemensvdo.com>
Date: Thu, 12 Apr 2007 10:07:46 +0000
Message-Id: <270C9968-1482-46FA-8D98-8AC33ECB6047@siemensvdo.com>
To: <www-xml-schema-comments@w3.org>
Ladies amd Gentlemen,

In part 2 chapter 3 of XML Schema,  "Built-in datatypes", a mechanism  
is described to reference a Schema datatype via am URI.
For example a simple int is referenced via http://www.w3.org/2001/ 
XMLSchema#int.
Facets may be referenced, too, e.g.: http://www.w3.org/2001/ 
XMLSchema#maxInclusive

But nothing is said how this mechanism could be used to defined a  
restricted data type. This problem arises for example if you try to  
define something like typed properties:

<properties>
     <property  name="var1" value="7" type="http://www.w3.org/2001/ 
XMLSchema#int"/>
</properties>

In this case an application can identify the type of the property  
"var1" as an int and check if the value is an integer.
So far so good, but if you want to restrict the int to a interval, a  
new mechanism is needed.

Here is my proposal:

An restriction definition is attached to the URI within squared  
brackets in a XPath-like style, e.g.:
http://www.w3.org/2001/XMLSchema#int[minInclusive=0 and  
maxInclusive=100]
Now the value is restricted to the interval 0..100.

Round brackets could be used for more complex restrictions:
http://www.w3.org/2001/XMLSchema#int[(minInclusive=1 and  
maxExclusive=5) or (minInclusive=10 and maxExclusive=15)]
Now the value may be 1<=x<5 or 10<=x<15.

To define string enumerations one could use commas:
http://www.w3.org/2001/XMLSchema#string 
[enumeration='val1','val2','val3']

These examples should make clear how such a xml-simple-type- 
definition-language could look like.

I hope somebody finds this worth enough to help defining such a  
standard type-definition.


Mit freundlichen Grüßen / Best regards
Michael Hedenus
Received on Wednesday, 25 April 2007 16:36:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:11 GMT