0.1.2 • Published 9 years ago

ecjson v0.1.2

Weekly downloads
5
License
ISC
Repository
github
Last release
9 years ago

A combination of parser and Json Converter to get Json objects from XML. It is similar to xml2js but its simple.

Install:

npm install ecjson

Example:

var ecjson=require('ecjson');

 ecjson.XmlToJson("<root>Hello</root>", function (JsonData) {
                  console.log(JsonData);
              });

Convert Complex XML to Json easily. All the Attributes of any element will be given as the data-members in json.

For Example, the xml:

<messages>
	<note ID="501">
		<to sendAs="email">Maxwell</to>
		<from>Annabelle</from>
		<heading style="Font:'Calibri'">Reminder</heading>
		<body>Don't forget me this weekend!</body>
	</note>
</messages>

will be converted as,

{"messages":
	{"note":
		{
		"ID":"501",
		"to":
			{"sendAs":"email",
			"value":"Maxwell"},
		"from":
			{"value":"Annabelle"},
		"heading":
			{"style":"Font:'Calibri'",
			"value":"Reminder"},
		"body":
			{"value":"Don't forget me this weekend!"}
		}
	}
}
0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago