Origam file format is implemented by certain rules regarding the order or the elements in the file. With each version the rules are changed and files with old format are reformatted when touched by a new version of Origam. This leads to problems with code review and a need for Tool for model normalization.
Another problem is that rule don’t seem to be implemented correctly. Build from today produced file starting with:
The namespace were formatted, they are stored in a single row. The first problem is that the sorting is not correct. I get xmlns:x should be first, but I’d expect the rest to be sorted alphabetically.
To better support the code review process, each namespace should be placed on the dedicated row.
I wish the format would as stable as possible to better facilitate development, when there are multiple persons involved.
It was discussed that at the moment the elements and subelements are sorted by name, which is subject to change. It was proposed to order elements by id, which is guid, and thus improving the stability of the contents.
I have more input after struggles today. I’ve realised that files tend to be quite large reaching 100 kilobytes a file. Alas I’m not sure what would be the impact of splitting files and creating some sort of folder structure.
Another thing is that internal structure of the file seems to be confusing for Git. Different model entities are differentiated by namespace and difference in the namespace is one letter. So adding a new element of a different type, which is store with namespace with one letter difference, git will decide it is a change instead of addition (and will mark it as a conflict).
Attached file contains a file with two version from two branches. Git will declare a conflict on row 1205. After a deeper analysis via different tool I was able to discern that it is actually addition and I was able to merge them.
I have another improvement in case we would somehow implement our own XML formatter. I would move id and name attributes to the same line as the element.
I would still keep grouping the elements by type (so name of the element) and ordering by id’s (instead of names) within the group of elements (e.g. entity fields and entity filters being grouped separately).