W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2001

how to constraint sinmpleTypes

From: Ayalew Kassahun <A.Kassahun@InfoRay.NL>
Date: Tue, 30 Jan 2001 11:17:34 +0100
Message-ID: <7FAFD1931B62D411B2890050BAB19FB137E02E@ms1.inforay.nl>
To: xmlschema-dev@w3.org
Hi List:


I have (what seams to me) a simple question but I difficulty expressing it
in my schema. I want to constraint users of my schema to use only a subset
of the simpleTypes: xsd:int, xsd:double and xsd:string. How can I specify
that in my schema?

For example in the following document I want the element <age
type="xsd:short">23</age> be reported as 'invalid' because its content is of
type short.

<?xml version="1.0"?>
<purchaseOrder orderDate="1999-10-20">
    <shipTo country="US">
        <name>Alice Smith</name>
        <age type="xsd:short">23</age>
        <city>Mill Valley</city>
        <state>CA</state>
        <zip>90952</zip>
    </shipTo>
    <billTo country="US">
        <name>Robert Smith</name>
        <street>8 Oak Avenue</street>
        <city>Old Town</city>
        <state>PA</state>
        <zip>95819</zip>
    </billTo>
</purchaseOrder>

any suggestion is welcome.

regards
Ayalew
Received on Tuesday, 30 January 2001 05:05:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:19 GMT