parse xml to json object and json object to xml
npm install nodexmlnodexml
=======
Parse xml to json object and json object to xml.
Version
----
1.0
Support
----
element innertext, attribute, cdata section.
Sample
----
``
`
//parse xml to object
var xmlobj = require('nodexml').xml2obj("
//xmlobj = { test : "aaa" }
//parse object to xml
var xmlstring = require('nodexml').obj2xml({ test: "test" },"root");//the second param is root element name
//xmlstring = "
`
This module keeps xml and object in the same structure.Sometimes structures are not clearly, developers should normalize it.
Ex:
`
`
If dog is multiple, structure will be array.If is single, structure will be single object.
``
Use dogs.dog = [].concat(dogs.dog) to ensure dog is an array.
Demo:
----
https://docs.google.com/a/ischool.com.tw/file/d/0B6dPaNMUqN32NDY4ODNkYVhDWFU/edit?usp=drive_web
License
----
MIT