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

missing support for sorted attributes #14

Closed
JeffreySarnoff opened this issue Jun 11, 2023 · 3 comments
Closed

missing support for sorted attributes #14

JeffreySarnoff opened this issue Jun 11, 2023 · 3 comments

Comments

@JeffreySarnoff
Copy link

JeffreySarnoff commented Jun 11, 2023

This request and its solution are presented here, in discourse.
Using an ordered dictionary (preferably Dictionary) would maintain the order of attributes.

The use case:

  • Suppose I have an XML tag:
    • The x, y, and z attributes are ordered; this helps when editing point data.
julia> using XML
julia> xyz  = XML.Element("point", x=1, y=2, z=3)
  Node Element <point x="1" z="3" y="2">

xyz does not remain x, y, z ordered

@joshday
Copy link
Member

joshday commented Jun 12, 2023

Thanks for the issue. I do plan on making attributes ordered!

I will likely add a type parameter and default to OrderedDict.

@AhmedSalih3d
Copy link

Thanks for the issue. I do plan on making attributes ordered!

I will likely add a type parameter and default to OrderedDict.

Thank you! That sounds really great, looking forward to try that when it goes into live :)

@joshday
Copy link
Member

joshday commented Jun 14, 2023

The type parameter added too much complexity for my taste. Instead OrderedDict is now baked in.

@joshday joshday closed this as completed Jun 14, 2023
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

3 participants