Re: [xml] Pattern contstraints in XML Schema (escaping period in character groups)

Hi All,

Does anyone have any input on this?  I've used several other regular _expression_ engines, and they treat '.' within a character group as representing a literal '.' character, not "all characters".

The XML Schema specification states ( that a posCharGroup is:

[14]    posCharGroup    ::=    ( charRange | charClassEsc )+

'.' is a valid charRange.  Shouldn't it be considered a charRange rather than a charClassEsc since it matches on charRange and the rest of the posCharGroup parses successfully?



Andrew Tosh wrote:
Hi All,

I am using libxml2's regular _expression_ engine to validate XML Schema instances against pattern constraints.

I have run into a situation where either the W3C specification seems ambiguous, or libxml2 is doing something wrong.  My schema has a pattern constraint "[^.:/]+", meaning one or more characters which is not a period, colon, or slash.  XSV validates the attached document, but libxml2 considers '.' to represent the multi-character escape for all characters except newline. defines the meaning of a character group in an XML Schema regular _expression_.  The '.' character is both a member of R (defined as any XML character that is not '[', ']', or '\' and that doesn't create a range) and E, where it represents any character.  I would think R appearing before E in the table means an application should try and match against the rules for R first, and that '.' should not have to be escaped within a character group.

Please let me know what you think, and if there is some consensus, I will submit a patch.



<?xml version="1.0" encoding="utf-8"?> <testElem xmlns="">value</testElem>

_______________________________________________ xml mailing list, project page xml gnome org

Andrew Tosh
Objective Systems, Inc.
Tel: +1 (484) 875-9841
Fax: +1 (484) 875-9830
Toll-free: (877) 307-6855 (USA only) 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]