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:
16
facho/fe/data/dian/XSD/__init__.py
Normal file
16
facho/fe/data/dian/XSD/__init__.py
Normal 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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user