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



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.

http://www.w3.org/TR/2000/WD-xmlschema-2-20000407/#dt-poschargroup 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.

Regards,

Andrew

--
Andrew Tosh
Objective Systems, Inc.
REAL WORLD ASN.1 AND XML SOLUTIONS
Tel: +1 (484) 875-9841
Fax: +1 (484) 875-9830
Toll-free: (877) 307-6855 (USA only)
http://www.obj-sys.com
<?xml version="1.0" encoding="utf-8"?>
<testElem xmlns="http://obj-sys.com/mySchema";>value</testElem>

Attachment: regex.xsd
Description: application/xml



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