This solution transforms a DTE (Electronic Tax Document) XML into a HTML format using XSLT and embeds a PDF417 barcode extracted from the TED node. It is compliant with Chilean SII (Servicio de Impuestos Internos) document structure.
It includes:
- Minimal API for converting DTE XML to HTML
- XSLT template loading from Azure Blob Storage
- HTML output encoded in UTF-8 for full compatibility
This repository has no relationship with the government entity SII, only for educational purposes.
Package Reference | Version |
---|---|
Azure.Storage.Blobs | 12.24.0 |
Microsoft.Extensions.Azure | 1.7.6 |
Pdf417EncoderLibrary | latest |
Once the app is running, you can convert XML DTEs via:
curl -X POST http://localhost:5230/api/dte/genera-html/ \
-H "Content-Type: application/xml" \
-H "Accept: text/html" \
<?xml version="1.0" encoding="iso-8859-1"?>
<DTE version="1.0" xmlns="http://www.sii.cl/SiiDte">
...
</DTE>
The response will be HTML output with the DTE information rendered, including a PDF417 barcode and optional resolution metadata.
Use appsettings.json
or environment variables to configure the XSLT template source:
{
"StorageConnection": "UseDevelopmentStorage=true",
"StorageConnection:ContainerName": "templates",
"StorageConnection:BlobName": "Documento.xlst"
}
You may also define these as Azure App Settings if you're deploying the API to the cloud.
Feel free to file a new issue with a respective title and description on the Sii.ConvertirXmlDte/issues repository.
If this tool was useful, consider contributing with ideas or improving it further.
This repository is released under the GNU General Public License v3.0.