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

RE: pattern facet implementations

From: Michael Kay <mike@saxonica.com>
Date: Sun, 23 Sep 2007 19:55:45 +0100
To: "'Shlomo Yona'" <S.Yona@F5.com>, <xmlschema-dev@w3.org>
Message-ID: <00dc01c7fe13$5945d150$6401a8c0@turtle>
RE: pattern facet implementations
Saxon has an internal API that you could use to test patterns against
strings without creating complete schemas and instance documents.
 
Essentially:
 
import net.sf.saxon.java.JRegularExpression;
 
JRegularExpression regex = new JRegularExpression("[A-Z]", false, 0);
if (regex.matches("A")) ...
 
Internally Saxon is translating the schema-syntax regex into either JDK 1.4
or JDK 1.5 regex syntax, and then using the JDK regex engine underneath. The
translators are derived from code written and published by James Clark,
fairly substantially modified. The 1.4 and 1.5 versions differ because JDK
1.5 changed "." to match a surrogate pair rather than matching each half of
a surrogate pair.
 
This should work in Saxon-B, there's no need to install the schema-aware
product. (That's because the same code is also used to support XPath 2.0
regular expression handling).
 
It's probably also possible, but not quite so easy, to access the
corresponding methods on Saxon's .NET product, which use the Microsoft .NET
regular expression engine as the target. 
 
It's possible that other schema processors are using the combination of
James Clark's translation routines with the JDK regex engine; but there are
still going to be significant differences between the implementations.
 
Michael Kay


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Shlomo Yona
Sent: 23 September 2007 19:15
To: xmlschema-dev@w3.org
Subject: pattern facet implementations



Hello,

 

Are there implementations of xsd:pattern facet available as stand-alone or
as a modular component that can be integrated into a test environment or a
schema processor?

 

I'd like to run tests on a pattern facet implementation and cross reference
the results with other implementations of this schema feature for
functionality and performance.

 

Also, are there XML Schema processors that use the same "engines" for
patterns? I'd rather test against different implementations rather than the
same one.

 

Thanks.

 

Shlomo.
Received on Sunday, 23 September 2007 18:55:54 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.