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

RE: Validate regular expressions

From: Michael Kay <mike@saxonica.com>
Date: Thu, 6 Dec 2007 23:37:20 -0000
To: "'Sascha Mantscheff'" <922492@gmx.de>, <xmlschema-dev@w3.org>
Message-ID: <028701c83860$f25f5910$6501a8c0@turtle>
RE: Validate regular expressions

I don't think it's possible to define a regular expression that matches all
regular expressions (and only regular expressions) - that view is based on
some long-forgotten computer-science theory concerned with different classes
of grammar, which others can correct me on if I've got it wrong. (It's
similar to another problem that comes up quite often, verifying that an
attribute holds a valid XPath expression).

XML Schema 1.1 allows assertions on complex types; my hope is that we will
also see them defined for simple types. That doesn't provide the whole
answer because the assertion language (XPath) isn't actually powerful enough
to describe such constraints. But XPath has well-defined extensibility
mechanisms that allow you to escape to procedural languages, and I believe
that this will in time enable you to define arbitrary constraints of this
kind provided the WG is brave enough to allow this power to be unleashed. 

At present, however, it has to be said that there's a strong sentiment
against allowing things that are quite so open-ended and lacking in
interoperability. These arguments are not without merit - if schemas were
computationally complete, would you be able to trust them? My own view,
however, is that we should give users the power they need to handle this
kind of requirement.

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

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Sascha Mantscheff
> Sent: 06 December 2007 20:37
> To: xmlschema-dev@w3.org
> Subject: Validate regular expressions
> 
> 
> Is there a method to validate in a schema that an element's 
> or attribute's content is a valid regular expression? (I do 
> not want to test if the content *matches* a regular 
> expression, but if it *is* one.
> Maybe this boils down to a regular expression for regular 
> expressions, but is there another method?)
> 
> Any help welcome.
> s.m.
> 
> 
> 
Received on Thursday, 6 December 2007 23:37:39 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.