A complete, bidirectional, JXON library
npm install jxonJXON 
====
A complete, bidirectional, JXON (lossless JavaScript XML Object Notation) library. Packed as UMD.
Implementation of Mozilla's JXON code. Head over to MDN for Documentation.
#### Example:
``js
{name: 'myportal'}
{user: {
username: 'testUser1',
password: 'yolo',
enabled: true
}}
{tag: {
$type: 'regular'
$blacklist: false
_: 'Backbase'
}}
{dogs: {
name: ['Charlie', {$nick: 'yes', _:'Mad Max'}]
}}
`
_Defaults:_
`js`
valueKey: '_',
attrKey: '$',
attrPrefix: '$',
lowerCaseTags: false,
trueIsEmpty: false,
autoDate: false,
ignorePrefixedNodes: false,
parseValues: false,
parserErrorHandler: undefined
js
var myObject = JXON.build(xmlDoc);
`
$3
Converts JS object to XML document. _Alias: JXON.unbuild_
- obj - The JavaScript Object from which you want to create your XML Document.
- namespaceURI - Optional DOMString containing the namespace URI of the document to be created, or null if the document doesn't belong to one.
- qualifiedNameStr - Optional DOMString containing the qualified name, that is an optional prefix and colon plus the local root element name, of the document to be created.
- documentType - Optional DocumentType of the document to be created. It defaults to null.
Example:
`js
var myObject = JXON.unbuild(myObject);
`$3
Wrapper over DOMParser.parseFromString, converts string to XML document.
- xmlString - XML string to convert to XML document$3
Wrapper over XMLSerializer.serializeToString, converts XML document to string.
- xmlObj - XML document to convert to XML string$3
Helper method to iterate node(s).
In case that there is only one children node, JXON will return object. For multiple children it will return array. This method will always iterate nodes as array.
- obj - array or object to iterate
- callback - function to execute for each element
- thisArg - optional. Value to use as this when eecuting callbackExample:
`js
var jx = jxon.stringToJs('foo ');
jxon.each(jx.val, function(val) {
assert(val, 'foo');
});
`CHANGELOG
2.0.0
changes from version 1.x to 2.0 include:
* (breaking) more usefull default settings (see above)
* (breaking) stringify Dates to ISO format instead of GMT
* improved xml namespace handling on node and browsers
* renamed main source file to
jxon.js`