OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Question on using xs:pattern to restrict xs:dateTime

[ Lists Home | Date Index | Thread Index ]

"Dare Obasanjo" <kpako@yahoo.com> writes:

> [ht] wrote:

> > I don't think so -- \d is not a valid W3C XML Schema pattern regexp
> > component, on my reading of the REC.
> 
> Interesting I though it was part of
> 
> http://www.w3.org/TR/xmlschema-2/#nt-MultiCharEsc
> 
> [37]    MultiCharEsc    ::=    '.' | ('\' [sSiIcCdDwW])

Doh!  I'm sorry, I read too quickly, you're right.

> > > and if so why? If not, is there any validating parser that will give an
> error
> > > message on validating it.
> >
> > Sorry, XSV doesn't touch the pattern facet at all
> >
> Why not?

Because XSV is a two-person effort whose original goal was to check
the basic design decisions of the W3C XML Schema effort.  Grinding out
the code to check and implement facets has just never gotten done.
The code is public, contributions welcome!

> From what I've seen the pattern facet can easily be made to create
> illegal restrictions which none of the validating parsers I have
> tried warns about.

Um, now I'm confused -- how does your example's use of pattern create
'illegal restrictions'?

> > > <xsd:simpleType name="myTimeType">
> > >       <xsd:restriction base="xsd:dateTime">
> > >         <xsd:pattern value="\d\d:\d\d(:\d\d)?" />
> > >          <xsd:whiteSpace value="collapse" />
> > >       </xsd:restriction>
> > > </xsd:simpleType>

It's true there are no valid instances of this type, but that's not
illegal, just useless.  It's open to processors to issue warnings when
a type has no members, but they're not required to.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS