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

RE: Simple xs:restriction issue


jimmy monin
Facets are additive: if there is an enumeration and a pattern then the value
must satisfy both. You can achieve what you want with a union type.

Michael Kay
http://www.saxonica.com/

 

> -----Original Message-----
> From: Jimmy Monin [mailto:jm.ais40@w...] 
> Sent: 16 November 2005 16:57
> To: xml-dev@l...
> Subject:  Simple xs:restriction issue
> 
> Hi all,
> 
> I have to deal with the following schema defined as an 
> interface with a 
> proprietary software :
> .
> .
> .
>   <xs:simpleType name="TypeTypeAvion">
>     <xs:restriction base="xs:string">
>       <xs:enumeration value="SEM 3"/>
>       <xs:enumeration value="SEM 4"/>
>       <xs:enumeration value="Rafale F1"/>
>       <xs:enumeration value="M2000D R2"/>
>       <xs:enumeration value="M2000N K2"/>
>       <xs:enumeration value="M2000DA S4-2A"/>
>       <xs:enumeration value="M2000DA S5-2C"/>
>       <xs:enumeration value="M2000-5F SF1-C"/>
>       <xs:enumeration value="F1 CT T2"/>
>       <xs:enumeration value="F1 CR F7"/>
>       <xs:pattern value=".*"/>
>     </xs:restriction>
>   </xs:simpleType>
> .
> .
> .
> The main idea was (I guess) to start defining a list of acceptable 
> value, but still accept any (use of pattern). With Xerces2 
> included in 
> JAXP 1.21, I get an error message (value not valid with 
> respect to its 
> type) with a string that differs from those listed.
> My question is : is this schema definition valid?
> 
> Thanks in advance,
> 
> -- 
> Jimmy Monin
> 
> SCM & Development
> EADS Systems & Defence Electronics
> 
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
> 



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.