GNOME Bugzilla – Bug 339121
XML Schema validation: facet pattern \(.*\)
Last modified: 2006-04-20 09:38:44 UTC
Please describe the problem: A libxml2 2.6.23 compiled under solaris 5.9 has some difficulties with a pattern which contains "\(.*\)": [facet 'pattern'] The value '(a)' is not accepted by the pattern '\(.*\)'. Steps to reproduce: 1. test.xsd: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:simpleType name="rootType"> <xs:restriction base="xs:string"> <xs:pattern value="\(.*\)"/> </xs:restriction> </xs:simpleType> <xs:element name="root" type="rootType" /> </xs:schema> 2. test.xml: <?xml version="1.0"?> <root>(a)</root> 3. xmllint --schema test.xsd test.xml Actual results: <?xml version="1.0"?> <root>(a)</root> test.xml:2: element root: Schemas validity error : Element 'root': [facet 'pattern'] The value '(a)' is not accepted by the pattern '\(.*\)'. test.xml:2: element root: Schemas validity error : Element 'root': '(a)' is not a valid value of the atomic type 'rootType'. test.xml fails to validate Expected results: <?xml version="1.0"?> <root>(a)</root> test.xml validates Does this happen every time? Yes Other information:
'.*X' is not equivalent to '[^\n\r]*X': The value 'aX' is not accepted by the pattern '.*X'.
This bug was already fixed (see bug 327167). The fix is currently only in CVS and will be released with Libxml2 2.6.24.
*** This bug has been marked as a duplicate of 327167 ***