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

XML parser reverses attribute order #94

Open
biswanaths opened this issue Jul 20, 2015 · 0 comments
Open

XML parser reverses attribute order #94

biswanaths opened this issue Jul 20, 2015 · 0 comments

Comments

@biswanaths
Copy link
Owner

When parsing XML and then writing it out again, the order of attributes is reversed.

This prevents certain use cases where one wants to modify an XML file and have a minimal amount of changes. E.g. adding a new element to a file causes all existing attributes to get reversed.

The cause is here:

https://github.com/scala/scala/blob/81e3121eb09010375783d13e8c4c853686a34ffd/src/library/scala/xml/parsing/MarkupParser.scala#L302

aMap: MetaData is built by prepending new attributes to the linked list, causing the reversal.

The attached patch adds a failing test case. (It failed when I wrote it originally, now I can't test it because the build fails).

Imported from : SI-6341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant