[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Facets

From: <Farid.Mahini@L-3com.com>
Date: Tue, 15 Feb 2005 15:28:22 -0500
Message-ID: <F00F0521BE28134DA357DC1DF7475B9901AAA725@texchg.te.l-3com.com>
To: bryce@sysonyx.com, xmlschema-dev@w3.org
xsd enum

Thanx you Bryce.  

This method only works if I had previous knowledge of the enumerated values.
In my case users create their own set of Types (not a subset of  acceptable
values by my schema, but literally using their own naming conventions).  For
instance, depending on the hardware under test, the user will compose a
totally different measurement Types. 

-Farid

> -----Original Message-----
> From: Bryce K. Nielsen [mailto:bryce@sysonyx.com]
> Sent: Tuesday, February 15, 2005 2:35 PM
> To: Farid.Mahini@L-3com.com; xmlschema-dev@w3.org
> Subject: Re: Facets
> 
> 
> > I have an XML document which contains the list of acceptable values
> (strings
> > or enum) for some elements, in addition to the elements 
> themselves.  I
> need
> > to create a schema to validate this XML document. Is there 
> a way to make
> the
> > validation process aware of these facets (on the fly, if 
> you will).  I
> hope
> > 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:complexType>
>       <xsd:sequence>
>         <xsd:element name="Name">
>           <xsd:simpleType>
>             <xsd:restriction base="xsd:string">
>               <xsd:enumeration value="Analog"/>
>               <xsd:enumeration value="Digital"/>
>               <xsd:enumeration value="Bus"/>
>               <xsd:enumeration value="Undefined"/>
>             </xsd:restriction>
>           </xsd:simpleType>
>         </xsd:element>
>       </xsd:sequence>
>     </xsd:complexType>
>   </xsd:element>
> 
> HTH,
> 
> Bryce K. Nielsen
> SysOnyx, Inc. (www.sysonyx.com)
> Makers of xmlDraft, the Smart XSD Editor
> http://www.sysonyx.com/products/xmldraft
> 
> 
> 


>From E-mail Administrator
ATTENTION PLEASE: Do you have our new e-mail addresses?
The current L-3 standard is First.Last @ L-3com.com
E-mail addressed to First.Last @ te.L-3com.com will no longer be delivered.
Please update your address book using the "From" address on this email.
Received on Tuesday, 15 February 2005 20:28:49 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.