This pattern validates in xmllint from libxml2

<xs:pattern 
value="[€ȘșȚț\p{IsBasicLatin}\p{IsLatin-1Supplement}\p{IsLatinExtended-A}-[\p{C}]]+"/>

It seems to do the same  evaluation, although does not 'fix' the bug.

Paul

-----Original Message-----
From: Stefan Behnel <[email protected]> 
Sent: 16 December 2021 06:37
To: [email protected]
Subject: [lxml] Re: ISO-20022 validation not possible with new xsd schema

Salut Jean!

Am December 15, 2021 9:46:25 PM UTC schrieb Jean de Bosset:
>The payment schema for ISO-20022
>
>lxml.etree.XMLSchemaParseError: Element
>'{http://www.w3.org/2001/XMLSchema}pattern': The value 
>'[\p{IsBasicLatin}\p{IsLatin-1Supplement}\p{IsLatinExtended-A}€ȘșȚț-[\p{C}]]+'
>of the facet 'pattern' is not a valid regular expression., line 1434
>
>Here is the XSD part
>  <xs:simpleType name="SPSText">
>    <xs:restriction base="xs:string">
><xs:pattern
>value="[\p{IsBasicLatin}\p{IsLatin-1Supplement}\p{IsLatinExtended-A}€ȘșȚț-[\p{C}]]+"/>
>    </xs:restriction>
>  </xs:simpleType>

Am I interpreting your message (and specifically the word "new" in the subject) 
correctly as meaning that the latest lxml release, 4.7, behaves differently 
from the previous one, 4.6.5, for you with respect to the specific XML Schema 
construct that you provided?

lxml 4.7 uses the latest version 2.9.12 of libxml2 (which implements the XML 
Schema support, lxml does not do that itself). 4.6 still uses the older 2.9.10 
(and actually 2.9.4 on Windows). You may be able to stick with that.

Sadly, libxml2 is currently not maintained, so a fix (assuming that this really 
is a bug) is unlikely to happen on their side any time soon.

Stefan

_______________________________________________
lxml - The Python XML Toolkit mailing list -- [email protected] To unsubscribe 
send an email to [email protected] 
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: [email protected]
_______________________________________________
lxml - The Python XML Toolkit mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: [email protected]

Reply via email to