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>
    <billTo country="US">
        <name>Robert Smith</name>
        <street>8 Oak Avenue</street>
        <city>Old Town</city>

any suggestion is welcome.

Received on Tuesday, 30 January 2001 05:05:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:49 UTC