W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

RE: Whitespace and patterns

From: Priscilla Walmsley <priscilla@walmsley.com>
Date: Wed, 16 Jan 2002 10:16:22 -0500
To: <Mike_Leditschke@nemmco.com.au>, <xmlschema-dev@w3.org>
Message-ID: <009f01c19ea0$cf4a6600$8d2a6420@vitria.ad.vitriacorp.com>
Hi Mike,

It looks to me like a single space should be valid.  Because it is based on
xsd:string, the processor should preserve (not collapse) the space, and the
\s in your pattern should allow the space as a value.

Priscilla
------------------------------------------------------------------
Priscilla Walmsley                          priscilla@walmsley.com
Vitria Technology                            http://www.vitria.com
Author, Definitive XML Schema                  (Prentice Hall PTR)
------------------------------------------------------------------

> -----Original Message-----
> From: xmlschema-dev-request@w3.org
> [mailto:xmlschema-dev-request@w3.org]On Behalf Of
> Mike_Leditschke@nemmco.com.au
> Sent: Monday, January 14, 2002 3:14 AM
> To: xmlschema-dev@w3.org
> Subject: Whitespace and patterns
>
>
> If I have the following type definition
>
>   <xsd:simpleType name="Fred">
>     <xsd:restriction base="xsd:string">
>       <xsd:pattern value="[\p{L}\p{N}\s]{1,30}"/>
>     </xsd:restriction>
>   </xsd:simpleType>
>   <xsd:element name="Fred" type=""Fred"/>
>
>
> Would a single space be legitimate content for
> Fred?, i.e.
>
> <Fred> </Fred>
>
> What I am trying to say is that any mixture of letters,
> numbers and whitespace from 1to 30 characters
> is allowed.
>
> XMLSpy says "the value does not match facet" but
> I'm struggling to see why.
>
> Any help appreciated.
>
>
> Regards
> Michael
>
>
>
>
> ------------------------------------------
> This e-mail is confidential.  If you are not the intended
> recipient, any use, disclosure or copying of this document is
> unauthorised and prohibited.  If you have received this
> document in error, please delete the email and notify me by
> return email or by phoning the NEMMCO Helpdesk on 1300 300 295.
>
>
Received on Wednesday, 16 January 2002 10:16:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT