nuevo comando validate-invoice para validacion de factura xml usando XSD Version 1.8 de la dian

FossilOrigin-Name: bed8f5d737e2c2ee4507553d6de8aa788526242ce390ef630ba16578c30c7ff9
This commit is contained in:
2020-06-13 01:37:18 +00:00
parent 30fb9eec9f
commit 7cc8bc3cdf
28 changed files with 52148 additions and 13 deletions

View File

@@ -0,0 +1,16 @@
import os.path
import xmlschema
def path_for_xsd(dirname, xsdname):
data_dir = os.path.dirname(os.path.abspath(__file__))
return os.path.join(data_dir, dirname, xsdname)
UBLInvoice= xmlschema.XMLSchema(path_for_xsd('maindoc', 'UBL-Invoice-2.1.xsd'))
def validate(xml, schema):
schema.validate(xml)