xmlbuilder
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -16,3 +16,3 @@ // Generated by CoffeeScript 1.6.1 | ||
XMLNode.prototype.element = function(name, attributes, text) { | ||
var attKey, attVal, item, key, lastChild, val, _i, _len, _ref; | ||
var attKey, attVal, item, key, lastChild, piKey, piVal, val, _i, _len, _ref; | ||
lastChild = null; | ||
@@ -56,2 +56,10 @@ if (attributes == null) { | ||
} | ||
for (piKey in name) { | ||
if (!__hasProp.call(name, piKey)) continue; | ||
piVal = name[piKey]; | ||
if (this.stringify.convertPIKey && piKey.indexOf(this.stringify.convertPIKey) === 0) { | ||
this.instruction(piKey.substr(this.stringify.convertPIKey.length), piVal); | ||
delete name[piKey]; | ||
} | ||
} | ||
for (key in name) { | ||
@@ -58,0 +66,0 @@ if (!__hasProp.call(name, key)) continue; |
@@ -105,2 +105,4 @@ // Generated by CoffeeScript 1.6.1 | ||
XMLStringifier.prototype.convertPIKey = '!'; | ||
XMLStringifier.prototype.convertTextKey = '#text'; | ||
@@ -107,0 +109,0 @@ |
{ | ||
"name": "xmlbuilder", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"keywords": [ "xml", "xmlbuilder" ], | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/oozcitak/xmlbuilder-js", |
@@ -39,2 +39,18 @@ # xmlbuilder-js | ||
It is also possible to convert objects into nodes: | ||
``` js | ||
builder.create({ | ||
root: { | ||
xmlbuilder: { | ||
'@for': 'node-js', // attributes start with @ | ||
repo: { | ||
'@type': 'git', | ||
'#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // #text denotes element text | ||
} | ||
} | ||
} | ||
}); | ||
``` | ||
If you need to do some processing: | ||
@@ -67,3 +83,3 @@ | ||
See the [Usage](https://github.com/oozcitak/xmlbuilder-js/wiki/Usage) page in the wiki for more detailed instructions. | ||
See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details. | ||
@@ -70,0 +86,0 @@ ### License: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
87
0
34525
17
870