Skip to content

Order of elements #18

@GoogleCodeExporter

Description

@GoogleCodeExporter
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 martin.p...@gmail.com on 11 Dec 2013 at 1:51

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions