XML Builder :: Lib

XML Builder Library

Лицензия

Лицензия

Группа

Группа

io.github.project-openubl
Идентификатор

Идентификатор

xml-builder-lib
Последняя версия

Последняя версия

1.0.1.Final
Дата

Дата

Тип

Тип

jar
Описание

Описание

XML Builder :: Lib
XML Builder Library
Ссылка на сайт

Ссылка на сайт

https://project-openubl.github.io/
Система контроля версий

Система контроля версий

https://github.com/project-openubl/xml-builder-lib

Скачать xml-builder-lib

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/io.github.project-openubl/xml-builder-lib/ -->
<dependency>
    <groupId>io.github.project-openubl</groupId>
    <artifactId>xml-builder-lib</artifactId>
    <version>1.0.1.Final</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.project-openubl/xml-builder-lib/
implementation 'io.github.project-openubl:xml-builder-lib:1.0.1.Final'
// https://jarcasting.com/artifacts/io.github.project-openubl/xml-builder-lib/
implementation ("io.github.project-openubl:xml-builder-lib:1.0.1.Final")
'io.github.project-openubl:xml-builder-lib:jar:1.0.1.Final'
<dependency org="io.github.project-openubl" name="xml-builder-lib" rev="1.0.1.Final">
  <artifact name="xml-builder-lib" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.project-openubl', module='xml-builder-lib', version='1.0.1.Final')
)
libraryDependencies += "io.github.project-openubl" % "xml-builder-lib" % "1.0.1.Final"
[io.github.project-openubl/xml-builder-lib "1.0.1.Final"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.freemarker : freemarker jar 2.3.28
org.hibernate : hibernate-validator jar 6.1.4.Final
org.glassfish : jakarta.el jar 3.0.3

test (5)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-engine jar 5.6.2
org.mockito : mockito-core jar 3.3.3
org.xmlunit : xmlunit-core jar 2.6.4
org.xmlunit : xmlunit-matchers jar 2.6.4
io.github.project-openubl : xml-sender-ws jar 2.1.1.Final

Модули Проекта

Данный проект не имеет модулей.

CI Quality Gate Status

XBuilder

Java library for creating and signing XML files based on UBL standards.

XBuilder can be found in Maven Central

Installation

Maven

Open your pom.xml file and add:

<dependency>
    <groupId>io.github.project-openubl</groupId>
    <artifactId>xbuilder</artifactId>
    <version>1.1.0.Final</version>
</dependency>

Gradle

Open your build.gradle file and add:

compile group: 'io.github.project-openubl', name: 'xbuilder', version: '1.1.0.Final'

Supported countries

  • Perú

If you want support for your country please create an issue.

Getting started

XML files can be created from Input Models; for instance:

InvoiceInputModel input = InvoiceInputModel.Builder.anInvoiceInputModel()
                .withSerie("F001")
                .withNumero(1)
                .withProveedor(ProveedorInputModel.Builder.aProveedorInputModel()
                        .withRuc("12345678912")
                        .withRazonSocial("Softgreen S.A.C.")
                        .build()
                )
                .withCliente(ClienteInputModel.Builder.aClienteInputModel()
                        .withNombre("Carlos Feria")
                        .withNumeroDocumentoIdentidad("12121212121")
                        .withTipoDocumentoIdentidad(Catalog6.RUC.toString())
                        .build()
                )
                .withDetalle(Arrays.asList(
                        DocumentLineInputModel.Builder.aDocumentLineInputModel()
                                .withDescripcion("Item1")
                                .withCantidad(new BigDecimal(10))
                                .withPrecioUnitario(new BigDecimal(100))
                                .withUnidadMedida("KGM")
                                .build(),
                        DocumentLineInputModel.Builder.aDocumentLineInputModel()
                                .withDescripcion("Item2")
                                .withCantidad(new BigDecimal(10))
                                .withPrecioUnitario(new BigDecimal(100))
                                .withUnidadMedida("KGM")
                                .build())
                )
                .build();

// Process Input and get XML
DocumentWrapper<InvoiceOutputModel> result = DocumentFacade.createXML(input, config, systemClock);
InvoiceOutputModel output = result.getOutput();
String xml = result.getXml();

Sign XMLs

After you created the xml file you can now sign it:

String xml;
String signID = "mySignID";

// Get your certificate using the method of your preference
X509Certificate certificate;
PrivateKey privateKey;

Document signedXML = XMLSigner.signXML(xml, signID, certificate, privateKey);
io.github.project-openubl

Project OpenUBL

Open source para facturación electrónica Perú

Версии библиотеки

Версия
1.0.1.Final
1.0.0.Final
1.0.0.Beta4
1.0.0.Beta3
1.0.0.Beta2
1.0.0.Beta1