Hi Paul,

gea...@ieee.org wrote on 02/21/2009 12:50:59 PM:

> On Sat, Feb 21, 2009 at 10:00 AM, Michael Glavassevich
> <mrgla...@ca.ibm.com> wrote:
>
> <snip/>
>
> > RegularExpression isn't part of the public API. It's an internal class.
See
> > more discussion on this here [1].
>
> <snip/>
>
> > [1] http://markmail.org/message/kbjnorykcn2kwcby
>
> OK, but I specifically needed an XPath compliant regex, and not the
> java.util.regex implementation. I need an implementation of regex in
> SPARQL [2], which is defined as XPath fn:matches, and trying to
> shoehorn java.util.regex into position, or writing my own
> implementation is inappropriate. So is fn:matches available through a
> public API? After searching through xercesImpl I figured that
> RegularExpression was the way to do it (or REUtil, which just seems to
> be a simple wrapper around RegularExpression).

I'm not sure what qualifies as an XPath compliant regex but the regex
support in Xerces exists for the XML Schema validator which is only
concerned with the grammar defined in the XML Schema specification [3].
There are other processing modes supported by this code but Xerces never
uses them and we haven't made an effort to maintain them. It's also very
old code (at least April, 2000 [4] and probably even older than that) so
would be surprised if it conformed to another spec that didn't exist yet at
the time it was originally written. I have no idea why it's in a
sub-package of org.apache.xerces.impl.xpath (a question to ask one of the
original developers) but has nothing to do with Xerces' XPath support (also
for the XML Schema validator and only supports the subset required for
identity constraints).

> I've never done more than basic stuff with xerces, so I don't even
> really know what constitutes the "public" API. (any tips there?)

A starting point is here [5]. The docs for the classes which aren't part of
the public APIs explicitly say that they're internal.

> Regards,
> Paul Gearon
>
> [2] http://www.w3.org/TR/rdf-sparql-query/#funcex-regex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org

Thanks.

[3] http://www.w3.org/TR/xmlschema-2/#regexs
[4]
http://svn.apache.org/viewvc/xerces/java/branches/xerces_j_1/src/org/apache/xerces/utils/regex/RegularExpression.java?revision=315394&view=markup
[5] http://xerces.apache.org/xerces2-j/api.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to