Socket
Socket
Sign inDemoInstall

xmlbuilder

Package Overview
Dependencies
Maintainers
0
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xmlbuilder - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

6

lib/XMLBuilder.js

@@ -12,3 +12,3 @@ (function() {

XMLFragment = require('./XMLFragment');
XMLBuilder = function() {
XMLBuilder = (function() {
__extends(XMLBuilder, XMLFragment);

@@ -18,3 +18,3 @@ function XMLBuilder() {

}
XMLBuilder.prototype.begin = function(name, xmldec, doctype) {
XMLBuilder.prototype.begin = function(name, xmldec, doctype, options) {
var att, child, root;

@@ -81,4 +81,4 @@ if (!name) {

return XMLBuilder;
}();
})();
module.exports = XMLBuilder;
}).call(this);
(function() {
var XMLFragment;
XMLFragment = function() {
XMLFragment = (function() {
function XMLFragment(parent, name, attributes, text) {

@@ -34,3 +34,3 @@ this.parent = parent;

}
if (!String(value).match("^" + this.val.EntityValue + "$") && !String(value).match(this.val.CDATA)) {
if (!String(value).match("^" + this.val.CharData + "$") && !String(value).match(this.val.CDATA)) {
throw new Error("Invalid element text: " + value);

@@ -42,2 +42,17 @@ }

};
XMLFragment.prototype.comment = function(value) {
var child;
if (this.value) {
throw new Error("Text nodes cannot have child nodes");
}
if (!(value != null)) {
throw new Error("Missing comment text");
}
if (!String(value).match("^" + this.val.CommentContent + "$")) {
throw new Error("Invalid comment text: " + value);
}
child = new XMLFragment(this, '', {}, '<!-- ' + value + ' -->');
this.children.push(child);
return this;
};
XMLFragment.prototype.up = function() {

@@ -129,2 +144,5 @@ if (!(this.parent != null)) {

};
XMLFragment.prototype.com = function(name, value) {
return this.comment(name, value);
};
XMLFragment.prototype.e = function(name, attributes) {

@@ -139,2 +157,5 @@ return this.element(name, attributes);

};
XMLFragment.prototype.c = function(name, value) {
return this.comment(name, value);
};
XMLFragment.prototype.u = function() {

@@ -144,3 +165,3 @@ return this.up;

return XMLFragment;
}();
})();
XMLFragment.prototype.val = {};

@@ -164,3 +185,4 @@ XMLFragment.prototype.val.Space = "(?:\u0020|\u0009|\u000D|\u000A)+";

XMLFragment.prototype.val.CommentChar = '(?!-)' + '(?:' + XMLFragment.prototype.val.Char + ')';
XMLFragment.prototype.val.Comment = '<!--' + '(?:' + XMLFragment.prototype.val.CommentChar + '|' + '-' + XMLFragment.prototype.val.CommentChar + ')*' + '-->';
XMLFragment.prototype.val.CommentContent = '(?:' + XMLFragment.prototype.val.CommentChar + '|' + '-' + XMLFragment.prototype.val.CommentChar + ')*';
XMLFragment.prototype.val.Comment = '<!--' + XMLFragment.prototype.val.CommentContent + '-->';
XMLFragment.prototype.val.VersionNum = '1\.[0-9]+';

@@ -167,0 +189,0 @@ XMLFragment.prototype.val.EncName = '[A-Za-z](?:[A-Za-z0-9\._]|-)*';

{
"name" : "xmlbuilder",
"version": "0.0.5",
"version": "0.0.6",
"description": "An XML builder for node.js",

@@ -5,0 +5,0 @@ "author": "Ozgur Ozcitak <oozcitak@gmail.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc