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

Order of elements #18

Open
GoogleCodeExporter opened this issue Mar 16, 2015 · 2 comments
Open

Order of elements #18

GoogleCodeExporter opened this issue Mar 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Hi,
didn't find other way to contact you, so I'm posting my request here.

Let assume an XML:
<root>
    <elementA>first</elementA>
    <elementB>second</elementB>
    <elementA>third</elementA>
    <elementC>fourth</elementC>
    <elementA>fifth</elementA>
    <elementB>sixth</elementB>
</root>

Converting to json we get
- root
  - elementA [array] - first, third, fifth
  - elementB [array] - second, sixth
  - elementC - fourth

Now is there a way to get the original order of elements?

Something like property originalIndex attached to each element?
elementA[0].originalIndex == 0 // first
elementA[1].originalIndex == 2 // third
elementA[2].originalIndex == 4 // fifth
elementB[0].originalIndex == 1 // second
elementB[1].originalIndex == 5 // sixth
elementC.originalIndex == 3    // fourth


Thanks for help.

Original issue reported on code.google.com by [email protected] on 11 Dec 2013 at 1:51

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

1 participant