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

RE: Schema Regular Expression which subtracts characters

  • From: Priscilla Walmsley <priscilla@w...>
  • To: "'Roger L. Costello'" <costello@m...>, xml-dev@l...
  • Date: Mon, 02 Jul 2001 15:36:28 -0400

xml schema regular expression subtraction
Roger,

You have to put the subtraction inside the character class expression.  Try:

[a-zA-Z-[ol]]+



Hope that helps,

Priscilla Walmsley
Vitria Technology

-----Original Message-----
From: Roger L. Costello [mailto:costello@m...]
Sent: Monday, July 02, 2001 3:02 PM
To: xml-dev@l...
Cc: costello@m...
Subject: Schema Regular Expression which subtracts characters



Problem: create an XML Schema regular expression which produces strings
with the characters a-z, A-Z minus the two characters o ("oh") and l
("el").

Examples.
   The regular expression should accept these strings:

         quick, hum, trade

   It should reject these strings:

         john, family  (john contains "o", and
                        family contains "l")

Below is my regular expression.  It uses the "character class
substraction" capability from the XML Datatype's spec to subtract-out
the two undesired characters.  Here is the regular expression:

    ([a-zA-Z]+)-[ol]

"All the characters a-z and A-Z, one or more times, minus the two
characters o, and l."

Is this correct?  I tried it out with xerces 1.4.1 and also with XML Spy
1.4b and both bombed.  Here's an error message from xerces:

[Error] test.xml:6:26: Datatype error: Value 'quick' does not match
regular expression facet '([a-xA-Z]+)-[ol]'

Perhaps I am using the "character class substraction" capability
incorrectly?  Can someone tell me where I err?   /Roger


------------------------------------------------------------------
The xml-dev list is sponsored by XML.org, an initiative of OASIS
<http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To unsubscribe from this elist send a message with the single word
"unsubscribe" in the body to: xml-dev-request@l...


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.