-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UBL 2.1 unused namespace #25
Comments
@phax, I tried this, but it didn't work:
Also this:
|
links to #10 |
Try MapBasedNamespaceContext context = UBL21NamespaceContext.getInstance().getClone();
context.removeMapping("cec");
writer.setNamespaceContext(context); |
Thanks @phax
I tried to use
|
Okay, I can now reproduce the internal error - I will look at this one separately. The system adds the |
Thanks @phax for the support. The file doesn't contain the ns2. You can see the file here:
In my example generated there is no cec. I see that your code (
But cec is not removed when not present. |
That is indeed weird. Well the underlying XML "text" is created by JAXB and we only have limited control over it. So if you remove the "cec" mapping, but JAXB creates the "ns2" namespace prefix, I don't know why: var writer = UBL21Writer.invoice();
MapBasedNamespaceContext context = UBL21NamespaceContext.getInstance().getClone();
context.removeMapping("cec");
writer.setNamespaceContext(context);
var status = writer.write(ublInvoice, file); Ah you are using Java 10 or newer??? Are you including JAXB 2.3.x in your code? |
#17 is still open. Can you explain to be if UBL.PE still requires UBL 2.0 or whether everything is on UBL 2.1 now? My spanish is a bit poor ;-) |
Sorry @phax, I meant phax/ph-commons#17. My Spanish is also poor. But I think I could help if you give more details. :-) |
Ah okay - no release for that one yet. |
Hi @phax, if I use the getClone() as I added in previous message, we get this exception:
That is why I asked about the release. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am nevertheless closing this issue now. Please re-open, if you see the need for that. |
Dear,
First of all, thanks for your library.
I'm generating one invoice, but I noticed that one namespace is added without being used in the xml:
The
xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
is added as namespace, but there is no reference ofcec
in the xml.I'm saving the file using these lines:
Is that a bug?
I'm using: JAVA 11 with ph-ubl 6.2.0
Thank you
The text was updated successfully, but these errors were encountered: