Skip to content
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

Feature Request: XML input module generate Schema attributes in same order as input file #253

Open
bevanweiss opened this issue Dec 26, 2019 · 1 comment

Comments

@bevanweiss
Copy link

Hi,
I'm currently attempting to generate a toolkit to work with some proprietary software which can export files in an XML format. No public schema has been released for it however.

Whilst the software is XML compliant, and doesn't care about the ordering of attributes / elements (unless explicitly ordered), when attempting to perform diffs between files generated by the proprietary software package and my own toolkit it would be nicest if the entries were in the same order.

It appears that attributes within the output schema are currently sorted alphabetically.

Regards,
Bevan Weiss

@bevanweiss
Copy link
Author

So I found the change required. I'm just unsure what the current purpose of it is, I was expecting that it was going to perform pair-wise comparisons between elements to confirm they were 'equivalent', but as far as I can tell this done in a different fashion.
So line 322 of mod/convert-from-xml/src/main/com/thaiopensource/relaxng/input/xml/Inferrer.java is where the sort takes place, removing this appears to have done the job for my requirement right now.
Without passing an option all the way through to selectively sort / not sort I can't see a nice way to expose this via command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants