Skip to content

Text element order gets changed when doing "xml to json" and "json to xml" #65

@sk8terboi87

Description

@sk8terboi87

x2js is great! But, facing the below issues... can you provide solution for it?

<tree>
    <node1> 
      textTextText 
      <subnode1> text1 </subnode1>
      <subnode2> text2 </subnode2>
    </node1>
</tree>

when doing xml to json

{
  "tree": {
    "node1": {
      "subnode1": "text1",
      "subnode2": "text2",
      "__text": "textTextText"
    }
  }
}
  1. And 'json to xml'
<tree>
	<node1>
		<subnode1>text1</subnode1>
		<subnode2>text2</subnode2>
                textTextText
        </node1>
</tree>

As you can see, the text nodes are pushed to last when reconverting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions