-
Notifications
You must be signed in to change notification settings - Fork 10
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
Loop if XSD is recursive #9
Comments
Instead of the ZIP you might obtain the XSD from https://github.com/ConnectingEurope/eInvoicing-EN16931/tree/master/cii/schema/D16B%20SCRDM%20(Subset) The recursion can be found here: |
Hi I've you want/could create a PR for it, it would be much appreciated. |
Hi yoep, I did so now: #10 PS: Please be gentle, when I might renamed a few things. For instance, using now oldNode and newNode (dropping the sometimes used prefix "original" in favor of "old"). In the end these are just names and perhaps personal taste, you could start changing things back, but perhaps have a quick chat ahead to understand the intentions ;-) |
The European e-Invoice standard uses OASIS UBL XML and UN/CEFACT CII XML, the latter is being used form its second 2016 release (D16B), you may find the XSD here: https://unece.org/DAM/cefact/xml_schemas/D16B_SCRDM__Subset__CII.zip
There is something nasty in, an element that can contain itself:
The trick to solve it was that the constructor is only called, when the element does not already exist.
For this reason I added a Map <String, XsdElement> at the document root
public Map<String, XsdElement> allElements = new HashMap<>();
and exchanged the two constructor with two statical factory methods - a final tweak was to move the recursive init() out of the constructor (otherwise the case above will still loop) :-)
Now the compare method is still looping - likely for similar reason - and
I will check tomorrow. I plan to provide a patch if you like to (just answer) otherwise I might save the time..
The text was updated successfully, but these errors were encountered: