buglabs/node-xml2json — pull request #15 by huned (2012-02-01 03:58:04+00:00)
Title: add `attributes` and `textNodeName` options to xml parser

I added a couple options (and tests) for xml2json.js that I needed and that others may find useful:

* a `textNodeKey` option to override the default `$t` -- because I need to generate JSON that I can feed into mongodb. mongodb does not like '$' in JSON key names. When not specified, the `textNodeKey` option defaults to '$t'

* an `attributes` option to specify whether or not the xml's nodes' attributes are converted to the JSON. The default is `attributes: true` which preserves the usual behavior of allowing attributes into the generated JSON.