ExCius.InvoiceXmlParserFixed (ExCius v0.3.2)

View Source

Fixed version of the InvoiceXmlParser that uses local-name() xpath approach to avoid namespace issues with SweetXML.

This parser extracts invoice data from UBL 2.1 Invoice XML documents without relying on namespace prefixes, making it more robust.

Summary

Functions

Parses UBL 2.1 Invoice XML content and extracts invoice data.

Functions

parse(xml_content)

Parses UBL 2.1 Invoice XML content and extracts invoice data.

Uses local-name() xpath functions to avoid namespace issues.

Parameters

  • xml_content - UBL Invoice XML document as a string

Returns

  • {:ok, invoice_data} - Successfully parsed invoice data as a map
  • {:error, reason} - Parsing failed with error description

Examples

iex> xml = "<?xml version=\"1.0\"?>..."
iex> {:ok, data} = ExCius.InvoiceXmlParserFixed.parse(xml)
iex> data.id
"INV-001"