xmlconv: XML conversion by convention
npm install xmlconv
Powered by libxmljs
,
see the libxmljs
API documentation for help implementing other conventions.
Example
Convert a pretty simple document according to the Parker convention:
var xmlconv = ;var xml = '<?xml version="1.0" ?>' '<note>' ' <to>The W3C</to>' ' <from>Chris</from>' ' <subject>XML</subject>' ' <body>I just wish XML was drier.</body>' '</note>';var obj = ;console;
This will print the following JSON output:
Supported conventions
Convention | Email example | Media example |
---|---|---|
XML | media | |
parker | media | |
castle | media | |
boids | media | |
dom | (not pure JSON) |
TODO
Implement additional conventions:
- Spark
- Badgerfish and at sklar's site
- GData
- Abdera
- JsonML
- oData
Testing
Continuous integration:
Running tests locally:
npm test
See node-tap
documentation for the implications of the various testing verbs (e.g., equal
vs. equivalent
vs. similar
).
License
Copyright © 2013 Christopher Brown. MIT Licensed.