W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2008

RE: Specifying an empty string as a simpleType restriction option

From: Michael Kay <mike@saxonica.com>
Date: Fri, 18 Apr 2008 23:31:27 +0100
To: "'Glen Mazza'" <glen.mazza@gmail.com>, <xmlschema-dev@w3.org>
Message-ID: <8E2AA6722CF04C0DAC4BB68901F8C394@Sealion>

This regex is legal according to the spec. However, many implementations of
XML Schema have taken shortcuts by using a regular expression library that
implements a different regex dialect (and XMLSpy is not the top scorer in
the conformance league table). You might find that value="(abc|bcd)?" is
more widely supported.

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

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Glen Mazza
> Sent: 18 April 2008 18:54
> To: xmlschema-dev@w3.org
> Subject: Specifying an empty string as a simpleType restriction option
> 
> 
> Hello,
> 
> I think I'm making a mistake below--XMLSpy isn't accepting 
> this simpleType.
> 
> For the following simpleType, I'm trying to say that 
> widgetType may have any of the three possible values:
> 
> 1.) abc
> 2.) bcd
> 3.) ( an empty string )
> 
> <xs:simpleType name="widgetType">
>     <xs:restriction base="xs:string">
>        <xs:pattern value="abc|bcd|" />
>     </xs:restriction>
> </xs:simpleType>
> 
> Apparently, though, the second bar to the ending quote is not 
> an acceptable way to specify the empty string.  Does anyone 
> know what I'm missing here--how I can specify an empty string 
> as one of the three acceptable options?
> 
> Thanks,
> Glen
> 
> 
Received on Friday, 18 April 2008 22:32:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 16 March 2009 11:13:41 GMT