ExCius (ExCius v0.3.2)
View SourceExCius - A library for creating and parsing UBL 2.1 invoices compliant with Croatian e-Invoice (CIUS-2025) specification.
Summary
Functions
Extracts all attachments from the given UBL Invoice XML.
Extracts all attachments from the given UBL Invoice XML.
Checks if the given UBL Invoice XML is digitally signed.
Checks if the given UBL Invoice XML is digitally signed.
Functions
Extracts all attachments from the given UBL Invoice XML.
Returns a list of attachment maps containing:
:id- The document reference ID:type- Either:embeddedor:external:filename- The filename (for embedded attachments):mime_type- The MIME type (for embedded attachments):content- The decoded binary content (for embedded attachments):uri- The external URI (for external references)
Parameters
xml- UBL Invoice XML document as a string
Examples
iex> xml = File.read!("priv/examples/signed_with_pdf.xml")
iex> {:ok, attachments} = ExCius.extract_attachments(xml)
iex> length(attachments)
1
Extracts all attachments from the given UBL Invoice XML.
Returns a list of attachment maps. Raises on error.
Parameters
xml- UBL Invoice XML document as a string
Examples
iex> xml = File.read!("priv/examples/signed_with_pdf.xml")
iex> attachments = ExCius.extract_attachments!(xml)
iex> length(attachments)
1
Checks if the given UBL Invoice XML is digitally signed.
Returns true if signed, false otherwise. Raises on error.
Parameters
xml- UBL Invoice XML document as a string
Examples
iex> xml = File.read!("priv/examples/signed_with_pdf.xml")
iex> ExCius.signed!(xml)
true
Checks if the given UBL Invoice XML is digitally signed.
Returns {:ok, true} if the invoice contains a digital signature,
{:ok, false} otherwise.
Parameters
xml- UBL Invoice XML document as a string
Examples
iex> xml = File.read!("priv/examples/signed_with_pdf.xml")
iex> ExCius.signed?(xml)
{:ok, true}