Closed osvalr closed 5 years ago
I have never tried it with custom document types, and there it will most likely not be supported. You should use JAXBWriterBuilder
with a custom IJAXBDocumentType
since you are basically leaving the UBL arena and use "any other" XSD that just re-uses UBL document types.
In that case the best way is to come up with a custom Maven configuration that converts your XSD to Java code re-using the types from ph-ubl. See e.g. theph-ubltr
subproject pom.xml (https://github.com/phax/ph-ubl/blob/master/ph-ubltr/pom.xml) that does exactly that. It's a quite tricky Maven configuration with plugins, bindings and catalogues referencing Maven artefacts.
hth
Did you manage to progress here?
Still I haven't tried yet just because I tried the marshaller from jaxb as easy-to-do for UBL-based documents. IMHO I will give a this on this but it sounds quite tricky.
FTR: I did something like the proposed here https://stackoverflow.com/a/1983172
It seems fair to me to close this, any other advance on this I will be posting in here
This is what I do internally as well. Can you point me to the XSD you are using, so I can potentially help you
That is the official Peru UBL version? I could create an "official" subproject if that helps....
I found https://github.com/FrameworkPeru/openinvoiceperudocs - is that official?
I compared the XML Schemas and found out the following:
minOccurs="1"
and maxOccurs="1"
were removed in the UBLPE definition because they are redundant (XSD defines min=1 by default and max=1 by default).
I am trying to use
UBL20WriterBuilder
with a customized definition based on UBL like this way:When trying to instantiate I get the following stacktrace:
Is there no option here? I suppose it is failing due there is not similar document supported.