Model parser and validator for XML FA(2) KSeF structure.
FakturaSerializerserializer = newFakturaSerializer();
Fakturainvoice = serializer.fromFile(newFile("src/test/resources/fa.xml"), true);FakturaSerializerfakturaSerializer = newFakturaSerializer();
Fakturainvoice = fakturaSerializer.create();
Faktura.Podmiot1podmiot1 = newFaktura.Podmiot1();
TAdresaddress = newTAdres();
address.setAdresL1("ul. Kolejowa 123");
address.setAdresL2("05-092 Łomianki");
podmiot1.setAdres(address);
invoice.setPodmiot1(podmiot1);
valstr = fakturaSerializer.toString(invoice, false);
System.out.println(str);valerrors = newLinkedList<SAXParseException>();
valfeatures = Set.of(newXMLValidator.SchemaFactoryFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false));
// We need disable secure processing because the schema has restrictions to more than 1000 elements in a sequence// which is completely ridiculous, but what we can do...URLurl = newURL("http://crd.gov.pl/wzor/2023/06/29/12648/schemat.xsd");
valschema = newStreamSource(url.openStream());
valresult = XMLValidator.validate(newFileReader("src/test/resources/fa.xml"), schema, errors, features);Stable project attracts are available in Maven Central, just add dependency to your project:
<dependency>
<groupId>io.alapierre.ksef.fa</groupId>
<artifactId>ksef-fa-xml-model</artifactId>
<version>3.0.0</version>
</dependency>- gobl.java Java GOBL implementation
- gobl.java.ksef GOBL to FA(2) Converter
The project can be built on JDK17+.
Building the API client library requires:
- Java 17+
- Maven