Skip to content

Latest commit

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

varobj=XML2JSON.parse('
<root><withattrid="10"name="5">
text
</withattr><nodes>1</nodes><nodesx="y">2</nodes><nodes><numn="3">3</num></nodes><nodes><numn="3"><i>hello</i></num></nodes><nodes><num>3</num>
hi
</nodes></root>
');console.log(JSON.stringify(obj));/*{"root":  { "withattr": {"@attributes": {"id": "10", "name": "5"}, "@text": "text"}, "nodes": [ "1",  {"@attributes": {"x": "y"}, "@text": "2"},  {"num": {"@attributes": {"n": "3"}, "@text": "3"}}, {"num": {"@attributes": {"n": "3"}, {"i": "hello"}}} {"num": {"@attributes": {"n": "3"}, {"i": "hello"}}, "@text": "hi"} ] }}*/

About

Javascript and Python module to convert xml into a simple json format

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages