InvalidRegex with unicode xsd:pattern
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andrew_Rapp
Posted On:   Thursday, May 18, 2006 10:02 AM

I'm trying to use Xerces to do schema validation to restrict characters above the ascii range. I want to restrict non-ascii characters and a few others with a xsd:pattern, but allow everything else. I've tried both and I am interpreting the last expression as allow any character below 0x0080, or more specifically only ascii characters. The above expression result in a InvalidRegex SAXParseException. According to the Pattern class documentation, http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html this is a valid regular expression. I'd rather specify the characters I don't want than have to specify all the allowed characters. Any idea   More>>

I'm trying to use Xerces to do schema validation to restrict characters above the ascii range. I want to restrict non-ascii characters and a few others with a xsd:pattern, but allow everything else.


I've tried both
and


I am interpreting the last expression as allow any character below 0x0080, or more specifically only ascii characters.


The above expression result in a InvalidRegex SAXParseException. According to the Pattern class documentation,


http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html


this is a valid regular expression. I'd rather specify the characters I don't want than have to specify all the allowed characters. Any ideas? Thanks.

   <<Less

Re: InvalidRegex with unicode xsd:pattern

Posted By:   Roseanne_Zhang  
Posted On:   Wednesday, May 24, 2006 01:18 PM

The regular expressions are similar, but not exact the same. I mean Java and XMLSchema.


Take a look here, there is no 'u' escape in XMLSchema!!!


XML Schema Reference


As far as I am concerned, I always check the documentation when I write regular expressions, since I don't remember the details, and the detailed differences.



Good luck!

About | Sitemap | Contact