Skip to content

Solución en .NET para transformar DTE del SII (Chile) desde XML a HTML. Utiliza una plantilla XSLT almacenada en Azure Blob Storage e incorpora un código de barras PDF417.

License

Notifications You must be signed in to change notification settings

sergioocode/Sii.ConvertirXmlDte

Repository files navigation

.NET GitHub commit activity GitHub contributors GitHub code size in bytes

Convertir XML DTE a HTML

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.


📦 Details

Package Reference Version
Azure.Storage.Blobs 12.24.0
Microsoft.Extensions.Azure 1.7.6
Pdf417EncoderLibrary latest

🚀 Usage

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.

⚙️ Configuration

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.


📣 Have a question? Found a Bug?

Feel free to file a new issue with a respective title and description on the Sii.ConvertirXmlDte/issues repository.


💖 Community and Contributions

If this tool was useful, consider contributing with ideas or improving it further.

Donate


📘 License

This repository is released under the GNU General Public License v3.0.

About

Solución en .NET para transformar DTE del SII (Chile) desde XML a HTML. Utiliza una plantilla XSLT almacenada en Azure Blob Storage e incorpora un código de barras PDF417.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages