You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the edi_xml_oca module uses xmlschema for the validation of XML documents. This is a pure Python library, and is can be really slow, especially with complex schemas, which are unfortunately numerous in the EDI world.
We propose to replace the implementation with lxml, with is libxml2 backed (or to use lxml if it is available, and fall back to xmlschema in case lxml is unavailable) to get a faster implementation.
The text was updated successfully, but these errors were encountered:
hanks for taking time to write this down!
I had this in mind since a while, indeed.
That lib sucks perf wise.
Feel free to move on w/ that.
The only drawback is that that lib has been used to load data as well (likely just in some tests). To be checked.
I opted to use the xmltodict library to convert the xml_content into a dictionary, replacing the previous approach that used the to_dict method from xmlschema. Additionally, @gurneyalex discovered this Stack Overflow discussion featuring an intriguing raw Python implementation. Do you have any preferences on this choice, @simahawk?
One open question remains: how should we handle the import and usage of this new dependency to maintain backward compatibility? Any thoughts or preferences, @simahawk?
Issue
the
edi_xml_oca
module usesxmlschema
for the validation of XML documents. This is a pure Python library, and is can be really slow, especially with complex schemas, which are unfortunately numerous in the EDI world.We propose to replace the implementation with
lxml
, with islibxml2
backed (or to uselxml
if it is available, and fall back toxmlschema
in caselxml
is unavailable) to get a faster implementation.The text was updated successfully, but these errors were encountered: