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

Re: Facets

From: Bryce K. Nielsen <bryce@sysonyx.com>
Date: Tue, 15 Feb 2005 12:35:26 -0700
Message-ID: <002501c51395$80882cb0$fba7fea9@PREZ>
To: <Farid.Mahini@L-3com.com>, <xmlschema-dev@w3.org>

> I have an XML document which contains the list of acceptable values
> or enum) for some elements, in addition to the elements themselves.  I
> to create a schema to validate this XML document. Is there a way to make
> validation process aware of these facets (on the fly, if you will).  I
> the simple XML test file below clarifies my question.

What you will want to do is have a simpleType that is restricted as an
Enumeration. Something like this:

  <xsd:element name="Types">
        <xsd:element name="Name">
            <xsd:restriction base="xsd:string">
              <xsd:enumeration value="Analog"/>
              <xsd:enumeration value="Digital"/>
              <xsd:enumeration value="Bus"/>
              <xsd:enumeration value="Undefined"/>


Bryce K. Nielsen
SysOnyx, Inc. (www.sysonyx.com)
Makers of xmlDraft, the Smart XSD Editor
Received on Tuesday, 15 February 2005 19:35:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:27 UTC