W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

Restriction of Data Type

From: Autumn Cuellar <a.cuellar@auckland.ac.nz>
Date: Thu, 31 Jan 2002 20:07:21 -0500 (EST)
Message-ID: <3C59EA30.7F2EEBA6@auckland.ac.nz>
To: xmlschema-dev@w3.org
Here's a snippet from an XML Schema I'm coding up:

    <xsd:attribute ref="cellml:name" use="required" />
        <xsd:restriction base="cellml:CellMLidentifier">
          <xsd:pattern value="^(ampere)^(becquerel)" />

In explanation (should you need one), the cellml:name attribute is a
global att. with type="cellml:CellMLidentifier" (which restricts the
string datatype to just letters, digits, and underscores).  In this
instance I want to further restrict the value so that it cannot be
certain words, e.g. the value of the name attribute cannot be "ampere"
nor "becquerel".  Two questions:
1)Is this a valid way to further restrict the type of the global
2)Is using the <pattern> element the way I've used it valid, and does it
convey what I intended?  (ok, maybe that was 3 questions...)

Autumn A. Cuellar
Bioengineering Institute
The University of Auckland
New Zealand
Received on Friday, 1 February 2002 11:19:57 UTC

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