From: Eric van der Vlist (vdv@dyomedea.com)
Date: 27/05/2004 - 09:12
On Thu, 2004-05-27 at 10:52, mercano wrote:
> Merci! ça m'a permis de trouver...
> le simpleType valide est le suivant:
>
> <xs:simpleType name="monType">
> <xs:union>
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:pattern value="[0-9]{2}/[0-9]{2}/[0-9]{4}"/>
> </xs:restriction>
> </xs:simpleType>
> <xs:simpleType>
> <xs:restriction base="xs:string"/>
> </xs:simpleType>
> </xs:union>
> </xs:simpleType>
Hmmm... là vous ne restreignez plus rien et acceptez n'importe quelle
valeur.
De plus, je conseille fortement d'utiliser systématiquement xs:token à
la place de xs:string sauf cas particulier très peu fréquent en XML où
l'on souhaite conserver tous les caractères blancs dans une valeur.
Puisque vous utilisez déjà un pattern, vous pouvez tout simplement
écrire :
<xs:simpleType name="monType">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:pattern value="[0-9]{2}/[0-9]{2}/[0-9]{4}"/>
<xs:pattern value=""/>
</xs:restriction>
</xs:simpleType>
Cordialement,
Eric van der Vlist
--
Rendez-vous à Paris (Web Services Convention).
http://masl.to?C12E25728
Upcoming XML schema languages tutorial:
- Portland -half day- (27/07/2004) http://masl.to/?E6ED13728
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Archive générée par hypermail 2.1.3 le 28/06/2004 - 11:06 UTC
webmaster@xmlfr.org
|