You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2013/03/04 20:32:51 UTC
[47/91] [abbrv] never ever check in node modules. baaad.
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/NOTICE
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/NOTICE b/node_modules/elementtree/NOTICE
deleted file mode 100644
index 28ad70a..0000000
--- a/node_modules/elementtree/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-node-elementtree
-Copyright (c) 2011, Rackspace, Inc.
-
-The ElementTree toolkit is Copyright (c) 1999-2007 by Fredrik Lundh
-
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/README.md
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/README.md b/node_modules/elementtree/README.md
deleted file mode 100644
index 8a7e710..0000000
--- a/node_modules/elementtree/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-node-elementtree
-====================
-
-node-elementtree is a [Node.js](http://nodejs.org) XML parser and serializer based upon the [Python ElementTree v1.3](http://effbot.org/zone/element-index.htm) module.
-
-Installation
-====================
-
- $ npm install elementtree
-
-Using the library
-====================
-
-For the usage refer to the Python ElementTree library documentation - [http://effbot.org/zone/element-index.htm#usage](http://effbot.org/zone/element-index.htm#usage).
-
-Supported XPath expressions in `find`, `findall` and `findtext` methods are listed on [http://effbot.org/zone/element-xpath.htm](http://effbot.org/zone/element-xpath.htm).
-
-Build status
-====================
-
-[![Build Status](https://secure.travis-ci.org/racker/node-elementtree.png)](http://travis-ci.org/racker/node-elementtree)
-
-
-License
-====================
-
-node-elementtree is distributed under the [Apache license](http://www.apache.org/licenses/LICENSE-2.0.html).
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/constants.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/constants.js b/node_modules/elementtree/lib/constants.js
deleted file mode 100644
index b057faf..0000000
--- a/node_modules/elementtree/lib/constants.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var DEFAULT_PARSER = 'sax';
-
-exports.DEFAULT_PARSER = DEFAULT_PARSER;
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/elementpath.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/elementpath.js b/node_modules/elementtree/lib/elementpath.js
deleted file mode 100644
index f913653..0000000
--- a/node_modules/elementtree/lib/elementpath.js
+++ /dev/null
@@ -1,343 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var sprintf = require('./sprintf').sprintf;
-
-var utils = require('./utils');
-var SyntaxError = require('./errors').SyntaxError;
-
-var _cache = {};
-
-var RE = new RegExp(
- "(" +
- "'[^']*'|\"[^\"]*\"|" +
- "::|" +
- "//?|" +
- "\\.\\.|" +
- "\\(\\)|" +
- "[/.*:\\[\\]\\(\\)@=])|" +
- "((?:\\{[^}]+\\})?[^/:\\[\\]\\(\\)@=\\s]+)|" +
- "\\s+", 'g'
-);
-
-var xpath_tokenizer = utils.findall.bind(null, RE);
-
-function prepare_tag(next, token) {
- var tag = token[0];
-
- function select(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
- elem._children.forEach(function(e) {
- if (e.tag === tag) {
- rv.push(e);
- }
- });
- }
-
- return rv;
- }
-
- return select;
-}
-
-function prepare_star(next, token) {
- function select(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
- elem._children.forEach(function(e) {
- rv.push(e);
- });
- }
-
- return rv;
- }
-
- return select;
-}
-
-function prepare_dot(next, token) {
- function select(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
- rv.push(elem);
- }
-
- return rv;
- }
-
- return select;
-}
-
-function prepare_iter(next, token) {
- var tag;
- token = next();
-
- if (token[1] === '*') {
- tag = '*';
- }
- else if (!token[1]) {
- tag = token[0] || '';
- }
- else {
- throw new SyntaxError(token);
- }
-
- function select(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
- elem.iter(tag, function(e) {
- if (e !== elem) {
- rv.push(e);
- }
- });
- }
-
- return rv;
- }
-
- return select;
-}
-
-function prepare_dot_dot(next, token) {
- function select(context, result) {
- var i, len, elem, rv = [], parent_map = context.parent_map;
-
- if (!parent_map) {
- context.parent_map = parent_map = {};
-
- context.root.iter(null, function(p) {
- p._children.forEach(function(e) {
- parent_map[e] = p;
- });
- });
- }
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
-
- if (parent_map.hasOwnProperty(elem)) {
- rv.push(parent_map[elem]);
- }
- }
-
- return rv;
- }
-
- return select;
-}
-
-
-function prepare_predicate(next, token) {
- var tag, key, value, select;
- token = next();
-
- if (token[1] === '@') {
- // attribute
- token = next();
-
- if (token[1]) {
- throw new SyntaxError(token, 'Invalid attribute predicate');
- }
-
- key = token[0];
- token = next();
-
- if (token[1] === ']') {
- select = function(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
-
- if (elem.get(key)) {
- rv.push(elem);
- }
- }
-
- return rv;
- };
- }
- else if (token[1] === '=') {
- value = next()[1];
-
- if (value[0] === '"' || value[value.length - 1] === '\'') {
- value = value.slice(1, value.length - 1);
- }
- else {
- throw new SyntaxError(token, 'Ivalid comparison target');
- }
-
- token = next();
- select = function(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
-
- if (elem.get(key) === value) {
- rv.push(elem);
- }
- }
-
- return rv;
- };
- }
-
- if (token[1] !== ']') {
- throw new SyntaxError(token, 'Invalid attribute predicate');
- }
- }
- else if (!token[1]) {
- tag = token[0] || '';
- token = next();
-
- if (token[1] !== ']') {
- throw new SyntaxError(token, 'Invalid node predicate');
- }
-
- select = function(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
-
- if (elem.find(tag)) {
- rv.push(elem);
- }
- }
-
- return rv;
- };
- }
- else {
- throw new SyntaxError(null, 'Invalid predicate');
- }
-
- return select;
-}
-
-
-
-var ops = {
- "": prepare_tag,
- "*": prepare_star,
- ".": prepare_dot,
- "..": prepare_dot_dot,
- "//": prepare_iter,
- "[": prepare_predicate,
-};
-
-function _SelectorContext(root) {
- this.parent_map = null;
- this.root = root;
-}
-
-function findall(elem, path) {
- var selector, result, i, len, token, value, select, context;
-
- if (_cache.hasOwnProperty(path)) {
- selector = _cache[path];
- }
- else {
- // TODO: Use smarter cache purging approach
- if (Object.keys(_cache).length > 100) {
- _cache = {};
- }
-
- if (path.charAt(0) === '/') {
- throw new SyntaxError(null, 'Cannot use absolute path on element');
- }
-
- result = xpath_tokenizer(path);
- selector = [];
-
- function getToken() {
- return result.shift();
- }
-
- token = getToken();
- while (true) {
- var c = token[1] || '';
- value = ops[c](getToken, token);
-
- if (!value) {
- throw new SyntaxError(null, sprintf('Invalid path: %s', path));
- }
-
- selector.push(value);
- token = getToken();
-
- if (!token) {
- break;
- }
- else if (token[1] === '/') {
- token = getToken();
- }
-
- if (!token) {
- break;
- }
- }
-
- _cache[path] = selector;
- }
-
- // Execute slector pattern
- result = [elem];
- context = new _SelectorContext(elem);
-
- for (i = 0, len = selector.length; i < len; i++) {
- select = selector[i];
- result = select(context, result);
- }
-
- return result || [];
-}
-
-function find(element, path) {
- var resultElement = findall(element, path);
-
- if (resultElement) {
- return resultElement[0];
- }
-
- return null;
-}
-
-function findtext(element, path, defvalue) {
- var resultElements = findall(element, path);
-
- if (resultElements) {
- return resultElements[0].text;
- }
-
- return defvalue;
-}
-
-
-exports.find = find;
-exports.findall = findall;
-exports.findtext = findtext;
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/elementtree.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/elementtree.js b/node_modules/elementtree/lib/elementtree.js
deleted file mode 100644
index b46268c..0000000
--- a/node_modules/elementtree/lib/elementtree.js
+++ /dev/null
@@ -1,598 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var sprintf = require('./sprintf').sprintf;
-
-var utils = require('./utils');
-var ElementPath = require('./elementpath');
-var TreeBuilder = require('./treebuilder').TreeBuilder;
-var get_parser = require('./parser').get_parser;
-var constants = require('./constants');
-
-var element_ids = 0;
-
-function Element(tag, attrib)
-{
- this._id = element_ids++;
- this.tag = tag;
- this.attrib = {};
- this.text = null;
- this.tail = null;
- this._children = [];
-
- if (attrib) {
- this.attrib = utils.merge(this.attrib, attrib);
- }
-}
-
-Element.prototype.toString = function()
-{
- return sprintf("<Element %s at %s>", this.tag, this._id);
-};
-
-Element.prototype.makeelement = function(tag, attrib)
-{
- return new Element(tag, attrib);
-};
-
-Element.prototype.len = function()
-{
- return this._children.length;
-};
-
-Element.prototype.getItem = function(index)
-{
- return this._children[index];
-};
-
-Element.prototype.setItem = function(index, element)
-{
- this._children[index] = element;
-};
-
-Element.prototype.delItem = function(index)
-{
- this._children.splice(index, 1);
-};
-
-Element.prototype.getSlice = function(start, stop)
-{
- return this._children.slice(start, stop);
-};
-
-Element.prototype.setSlice = function(start, stop, elements)
-{
- var i;
- var k = 0;
- for (i = start; i < stop; i++, k++) {
- this._children[i] = elements[k];
- }
-};
-
-Element.prototype.delSlice = function(start, stop)
-{
- this._children.splice(start, stop - start);
-};
-
-Element.prototype.append = function(element)
-{
- this._children.push(element);
-};
-
-Element.prototype.extend = function(elements)
-{
- this._children.concat(elements);
-};
-
-Element.prototype.insert = function(index, element)
-{
- this._children[index] = element;
-};
-
-Element.prototype.remove = function(index, element)
-{
- this._children = this._children.filter(function(e) {
- /* TODO: is this the right way to do this? */
- if (e._id === element._id) {
- return false;
- }
- return true;
- });
-};
-
-Element.prototype.getchildren = function() {
- return this._children;
-};
-
-Element.prototype.find = function(path)
-{
- return ElementPath.find(this, path);
-};
-
-Element.prototype.findtext = function(path, defvalue)
-{
- return ElementPath.findtext(this, path, defvalue);
-};
-
-Element.prototype.findall = function(path, defvalue)
-{
- return ElementPath.findall(this, path, defvalue);
-};
-
-Element.prototype.clear = function()
-{
- this.attrib = {};
- this._children = [];
- this.text = null;
- this.tail = null;
-};
-
-Element.prototype.get = function(key, defvalue)
-{
- if (this.attrib[key] !== undefined) {
- return this.attrib[key];
- }
- else {
- return defvalue;
- }
-};
-
-Element.prototype.set = function(key, value)
-{
- this.attrib[key] = value;
-};
-
-Element.prototype.keys = function()
-{
- return Object.keys(this.attrib);
-};
-
-Element.prototype.items = function()
-{
- return utils.items(this.attrib);
-};
-
-/*
- * In python this uses a generator, but in v8 we don't have em,
- * so we use a callback instead.
- **/
-Element.prototype.iter = function(tag, callback)
-{
- var self = this;
- var i, child;
-
- if (tag === "*") {
- tag = null;
- }
-
- if (tag === null || this.tag === tag) {
- callback(self);
- }
-
- for (i = 0; i < this._children.length; i++) {
- child = this._children[i];
- child.iter(tag, function(e) {
- callback(e);
- });
- }
-};
-
-Element.prototype.itertext = function(callback)
-{
- this.iter(null, function(e) {
- if (e.text) {
- callback(e.text);
- }
-
- if (e.tail) {
- callback(e.tail);
- }
- });
-};
-
-
-function SubElement(parent, tag, attrib) {
- var element = parent.makeelement(tag, attrib);
- parent.append(element);
- return element;
-}
-
-function Comment(text) {
- var element = new Element(Comment);
- if (text) {
- element.text = text;
- }
- return element;
-}
-
-function ProcessingInstruction(target, text)
-{
- var element = new Element(ProcessingInstruction);
- element.text = target;
- if (text) {
- element.text = element.text + " " + text;
- }
- return element;
-}
-
-function QName(text_or_uri, tag)
-{
- if (tag) {
- text_or_uri = sprintf("{%s}%s", text_or_uri, tag);
- }
- this.text = text_or_uri;
-}
-
-QName.prototype.toString = function() {
- return this.text;
-};
-
-function ElementTree(element)
-{
- this._root = element;
-}
-
-ElementTree.prototype.getroot = function() {
- return this._root;
-};
-
-ElementTree.prototype._setroot = function(element) {
- this._root = element;
-};
-
-ElementTree.prototype.parse = function(source, parser) {
- if (!parser) {
- parser = get_parser(constants.DEFAULT_PARSER);
- parser = new parser.XMLParser(new TreeBuilder());
- }
-
- parser.feed(source);
- this._root = parser.close();
- return this._root;
-};
-
-ElementTree.prototype.iter = function(tag, callback) {
- this._root.iter(tag, callback);
-};
-
-ElementTree.prototype.find = function(path) {
- return this._root.find(path);
-};
-
-ElementTree.prototype.findtext = function(path, defvalue) {
- return this._root.findtext(path, defvalue);
-};
-
-ElementTree.prototype.findall = function(path) {
- return this._root.findall(path);
-};
-
-/**
- * Unlike ElementTree, we don't write to a file, we return you a string.
- */
-ElementTree.prototype.write = function(options) {
- var sb = [];
- options = utils.merge({
- encoding: 'utf-8',
- xml_declaration: null,
- default_namespace: null,
- method: 'xml'}, options);
-
- if (options.xml_declaration !== false) {
- sb.push("<?xml version='1.0' encoding='"+options.encoding +"'?>\n");
- }
-
- if (options.method === "text") {
- _serialize_text(sb, self._root, encoding);
- }
- else {
- var qnames, namespaces, indent, indent_string;
- var x = _namespaces(this._root, options.encoding, options.default_namespace);
- qnames = x[0];
- namespaces = x[1];
-
- if (options.hasOwnProperty('indent')) {
- indent = 0;
- indent_string = new Array(options.indent + 1).join(' ');
- }
- else {
- indent = false;
- }
-
- if (options.method === "xml") {
- _serialize_xml(function(data) {
- sb.push(data);
- }, this._root, options.encoding, qnames, namespaces, indent, indent_string);
- }
- else {
- /* TODO: html */
- throw new Error("unknown serialization method "+ options.method);
- }
- }
-
- return sb.join("");
-};
-
-var _namespace_map = {
- /* "well-known" namespace prefixes */
- "http://www.w3.org/XML/1998/namespace": "xml",
- "http://www.w3.org/1999/xhtml": "html",
- "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
- "http://schemas.xmlsoap.org/wsdl/": "wsdl",
- /* xml schema */
- "http://www.w3.org/2001/XMLSchema": "xs",
- "http://www.w3.org/2001/XMLSchema-instance": "xsi",
- /* dublic core */
- "http://purl.org/dc/elements/1.1/": "dc",
-};
-
-function register_namespace(prefix, uri) {
- if (/ns\d+$/.test(prefix)) {
- throw new Error('Prefix format reserved for internal use');
- }
-
- if (_namespace_map.hasOwnProperty(uri) && _namespace_map[uri] === prefix) {
- delete _namespace_map[uri];
- }
-
- _namespace_map[uri] = prefix;
-}
-
-
-function _escape(text, encoding, isAttribute, isText) {
- if (text) {
- text = text.toString();
- text = text.replace(/&/g, '&');
- text = text.replace(/</g, '<');
- text = text.replace(/>/g, '>');
- if (!isText) {
- text = text.replace(/\n/g, '
');
- text = text.replace(/\r/g, '
');
- }
- if (isAttribute) {
- text = text.replace(/"/g, '"');
- }
- }
- return text;
-}
-
-/* TODO: benchmark single regex */
-function _escape_attrib(text, encoding) {
- return _escape(text, encoding, true);
-}
-
-function _escape_cdata(text, encoding) {
- return _escape(text, encoding, false);
-}
-
-function _escape_text(text, encoding) {
- return _escape(text, encoding, false, true);
-}
-
-function _namespaces(elem, encoding, default_namespace) {
- var qnames = {};
- var namespaces = {};
-
- if (default_namespace) {
- namespaces[default_namespace] = "";
- }
-
- function encode(text) {
- return text;
- }
-
- function add_qname(qname) {
- if (qname[0] === "{") {
- var tmp = qname.substring(1).split("}", 2);
- var uri = tmp[0];
- var tag = tmp[1];
- var prefix = namespaces[uri];
-
- if (prefix === undefined) {
- prefix = _namespace_map[uri];
- if (prefix === undefined) {
- prefix = "ns" + Object.keys(namespaces).length;
- }
- if (prefix !== "xml") {
- namespaces[uri] = prefix;
- }
- }
-
- if (prefix) {
- qnames[qname] = sprintf("%s:%s", prefix, tag);
- }
- else {
- qnames[qname] = tag;
- }
- }
- else {
- if (default_namespace) {
- throw new Error('cannot use non-qualified names with default_namespace option');
- }
-
- qnames[qname] = qname;
- }
- }
-
-
- elem.iter(null, function(e) {
- var i;
- var tag = e.tag;
- var text = e.text;
- var items = e.items();
-
- if (tag instanceof QName && qnames[tag.text] === undefined) {
- add_qname(tag.text);
- }
- else if (typeof(tag) === "string") {
- add_qname(tag);
- }
- else if (tag !== null && tag !== Comment && tag !== ProcessingInstruction) {
- throw new Error('Invalid tag type for serialization: '+ tag);
- }
-
- if (text instanceof QName && qnames[text.text] === undefined) {
- add_qname(text.text);
- }
-
- items.forEach(function(item) {
- var key = item[0],
- value = item[1];
- if (key instanceof QName) {
- key = key.text;
- }
-
- if (qnames[key] === undefined) {
- add_qname(key);
- }
-
- if (value instanceof QName && qnames[value.text] === undefined) {
- add_qname(value.text);
- }
- });
- });
- return [qnames, namespaces];
-}
-
-function _serialize_xml(write, elem, encoding, qnames, namespaces, indent, indent_string) {
- var tag = elem.tag;
- var text = elem.text;
- var items;
- var i;
-
- var newlines = indent || (indent === 0);
- write(Array(indent + 1).join(indent_string));
-
- if (tag === Comment) {
- write(sprintf("<!--%s-->", _escape_cdata(text, encoding)));
- }
- else if (tag === ProcessingInstruction) {
- write(sprintf("<?%s?>", _escape_cdata(text, encoding)));
- }
- else {
- tag = qnames[tag];
- if (tag === undefined) {
- if (text) {
- write(_escape_text(text, encoding));
- }
- elem.iter(function(e) {
- _serialize_xml(write, e, encoding, qnames, null, newlines ? indent + 1 : false, indent_string);
- });
- }
- else {
- write("<" + tag);
- items = elem.items();
-
- if (items || namespaces) {
- items.sort(); // lexical order
-
- items.forEach(function(item) {
- var k = item[0],
- v = item[1];
-
- if (k instanceof QName) {
- k = k.text;
- }
-
- if (v instanceof QName) {
- v = qnames[v.text];
- }
- else {
- v = _escape_attrib(v, encoding);
- }
- write(sprintf(" %s=\"%s\"", qnames[k], v));
- });
-
- if (namespaces) {
- items = utils.items(namespaces);
- items.sort(function(a, b) { return a[1] < b[1]; });
-
- items.forEach(function(item) {
- var k = item[1],
- v = item[0];
-
- if (k) {
- k = ':' + k;
- }
-
- write(sprintf(" xmlns%s=\"%s\"", k, _escape_attrib(v, encoding)));
- });
- }
- }
-
- if (text || elem.len()) {
- if (text && text.toString().match(/^\s*$/)) {
- text = null;
- }
-
- write(">");
- if (!text && newlines) {
- write("\n");
- }
-
- if (text) {
- write(_escape_text(text, encoding));
- }
- elem._children.forEach(function(e) {
- _serialize_xml(write, e, encoding, qnames, null, newlines ? indent + 1 : false, indent_string);
- });
-
- if (!text && indent) {
- write(Array(indent + 1).join(indent_string));
- }
- write("</" + tag + ">");
- }
- else {
- write(" />");
- }
- }
- }
-
- if (newlines) {
- write("\n");
- }
-}
-
-function parse(source, parser) {
- var tree = new ElementTree();
- tree.parse(source, parser);
- return tree;
-}
-
-function tostring(element, options) {
- return new ElementTree(element).write(options);
-}
-
-exports.PI = ProcessingInstruction;
-exports.Comment = Comment;
-exports.ProcessingInstruction = ProcessingInstruction;
-exports.SubElement = SubElement;
-exports.QName = QName;
-exports.ElementTree = ElementTree;
-exports.ElementPath = ElementPath;
-exports.Element = function(tag, attrib) {
- return new Element(tag, attrib);
-};
-
-exports.XML = function(data) {
- var et = new ElementTree();
- return et.parse(data);
-};
-
-exports.parse = parse;
-exports.register_namespace = register_namespace;
-exports.tostring = tostring;
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/errors.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/errors.js b/node_modules/elementtree/lib/errors.js
deleted file mode 100644
index e8742be..0000000
--- a/node_modules/elementtree/lib/errors.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var util = require('util');
-
-var sprintf = require('./sprintf').sprintf;
-
-function SyntaxError(token, msg) {
- msg = msg || sprintf('Syntax Error at token %s', token.toString());
- this.token = token;
- this.message = msg;
- Error.call(this, msg);
-}
-
-util.inherits(SyntaxError, Error);
-
-exports.SyntaxError = SyntaxError;
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/parser.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/parser.js b/node_modules/elementtree/lib/parser.js
deleted file mode 100644
index 7307ee4..0000000
--- a/node_modules/elementtree/lib/parser.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* TODO: support node-expat C++ module optionally */
-
-var util = require('util');
-var parsers = require('./parsers/index');
-
-function get_parser(name) {
- if (name === 'sax') {
- return parsers.sax;
- }
- else {
- throw new Error('Invalid parser: ' + name);
- }
-}
-
-
-exports.get_parser = get_parser;
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/parsers/index.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/parsers/index.js b/node_modules/elementtree/lib/parsers/index.js
deleted file mode 100644
index 5eac5c8..0000000
--- a/node_modules/elementtree/lib/parsers/index.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.sax = require('./sax');
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/parsers/sax.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/parsers/sax.js b/node_modules/elementtree/lib/parsers/sax.js
deleted file mode 100644
index 69b0a59..0000000
--- a/node_modules/elementtree/lib/parsers/sax.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var util = require('util');
-
-var sax = require('sax');
-
-var TreeBuilder = require('./../treebuilder').TreeBuilder;
-
-function XMLParser(target) {
- this.parser = sax.parser(true);
-
- this.target = (target) ? target : new TreeBuilder();
-
- this.parser.onopentag = this._handleOpenTag.bind(this);
- this.parser.ontext = this._handleText.bind(this);
- this.parser.oncdata = this._handleCdata.bind(this);
- this.parser.ondoctype = this._handleDoctype.bind(this);
- this.parser.oncomment = this._handleComment.bind(this);
- this.parser.onclosetag = this._handleCloseTag.bind(this);
- this.parser.onerror = this._handleError.bind(this);
-}
-
-XMLParser.prototype._handleOpenTag = function(tag) {
- this.target.start(tag.name, tag.attributes);
-};
-
-XMLParser.prototype._handleText = function(text) {
- this.target.data(text);
-};
-
-XMLParser.prototype._handleCdata = function(text) {
- this.target.data(text);
-};
-
-XMLParser.prototype._handleDoctype = function(text) {
-};
-
-XMLParser.prototype._handleComment = function(comment) {
-};
-
-XMLParser.prototype._handleCloseTag = function(tag) {
- this.target.end(tag);
-};
-
-XMLParser.prototype._handleError = function(err) {
- throw err;
-};
-
-XMLParser.prototype.feed = function(chunk) {
- this.parser.write(chunk);
-};
-
-XMLParser.prototype.close = function() {
- this.parser.close();
- return this.target.close();
-};
-
-exports.XMLParser = XMLParser;
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/sprintf.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/sprintf.js b/node_modules/elementtree/lib/sprintf.js
deleted file mode 100644
index f802c1b..0000000
--- a/node_modules/elementtree/lib/sprintf.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var cache = {};
-
-
-// Do any others need escaping?
-var TO_ESCAPE = {
- '\'': '\\\'',
- '\n': '\\n'
-};
-
-
-function populate(formatter) {
- var i, type,
- key = formatter,
- prev = 0,
- arg = 1,
- builder = 'return \'';
-
- for (i = 0; i < formatter.length; i++) {
- if (formatter[i] === '%') {
- type = formatter[i + 1];
-
- switch (type) {
- case 's':
- builder += formatter.slice(prev, i) + '\' + arguments[' + arg + '] + \'';
- prev = i + 2;
- arg++;
- break;
- case 'j':
- builder += formatter.slice(prev, i) + '\' + JSON.stringify(arguments[' + arg + ']) + \'';
- prev = i + 2;
- arg++;
- break;
- case '%':
- builder += formatter.slice(prev, i + 1);
- prev = i + 2;
- i++;
- break;
- }
-
-
- } else if (TO_ESCAPE[formatter[i]]) {
- builder += formatter.slice(prev, i) + TO_ESCAPE[formatter[i]];
- prev = i + 1;
- }
- }
-
- builder += formatter.slice(prev) + '\';';
- cache[key] = new Function(builder);
-}
-
-
-/**
- * A fast version of sprintf(), which currently only supports the %s and %j.
- * This caches a formatting function for each format string that is used, so
- * you should only use this sprintf() will be called many times with a single
- * format string and a limited number of format strings will ever be used (in
- * general this means that format strings should be string literals).
- *
- * @param {String} formatter A format string.
- * @param {...String} var_args Values that will be formatted by %s and %j.
- * @return {String} The formatted output.
- */
-exports.sprintf = function(formatter, var_args) {
- if (!cache[formatter]) {
- populate(formatter);
- }
-
- return cache[formatter].apply(null, arguments);
-};
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/treebuilder.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/treebuilder.js b/node_modules/elementtree/lib/treebuilder.js
deleted file mode 100644
index 393a98f..0000000
--- a/node_modules/elementtree/lib/treebuilder.js
+++ /dev/null
@@ -1,60 +0,0 @@
-function TreeBuilder(element_factory) {
- this._data = [];
- this._elem = [];
- this._last = null;
- this._tail = null;
- if (!element_factory) {
- /* evil circular dep */
- element_factory = require('./elementtree').Element;
- }
- this._factory = element_factory;
-}
-
-TreeBuilder.prototype.close = function() {
- return this._last;
-};
-
-TreeBuilder.prototype._flush = function() {
- if (this._data) {
- if (this._last !== null) {
- var text = this._data.join("");
- if (this._tail) {
- this._last.tail = text;
- }
- else {
- this._last.text = text;
- }
- }
- this._data = [];
- }
-};
-
-TreeBuilder.prototype.data = function(data) {
- this._data.push(data);
-};
-
-TreeBuilder.prototype.start = function(tag, attrs) {
- this._flush();
- var elem = this._factory(tag, attrs);
- this._last = elem;
-
- if (this._elem.length) {
- this._elem[this._elem.length - 1].append(elem);
- }
-
- this._elem.push(elem);
-
- this._tail = null;
-};
-
-TreeBuilder.prototype.end = function(tag) {
- this._flush();
- this._last = this._elem.pop();
- if (this._last.tag !== tag) {
- throw new Error("end tag mismatch");
- }
- this._tail = 1;
- return this._last;
-};
-
-exports.TreeBuilder = TreeBuilder;
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/lib/utils.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/utils.js b/node_modules/elementtree/lib/utils.js
deleted file mode 100644
index b08a670..0000000
--- a/node_modules/elementtree/lib/utils.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * @param {Object} hash.
- * @param {Array} ignored.
- */
-function items(hash, ignored) {
- ignored = ignored || null;
- var k, rv = [];
-
- function is_ignored(key) {
- if (!ignored || ignored.length === 0) {
- return false;
- }
-
- return ignored.indexOf(key);
- }
-
- for (k in hash) {
- if (hash.hasOwnProperty(k) && !(is_ignored(ignored))) {
- rv.push([k, hash[k]]);
- }
- }
-
- return rv;
-}
-
-
-function findall(re, str) {
- var match, matches = [];
-
- while ((match = re.exec(str))) {
- matches.push(match);
- }
-
- return matches;
-}
-
-function merge(a, b) {
- var c = {}, attrname;
-
- for (attrname in a) {
- if (a.hasOwnProperty(attrname)) {
- c[attrname] = a[attrname];
- }
- }
- for (attrname in b) {
- if (b.hasOwnProperty(attrname)) {
- c[attrname] = b[attrname];
- }
- }
- return c;
-}
-
-exports.items = items;
-exports.findall = findall;
-exports.merge = merge;
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/node_modules/sax/AUTHORS
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/node_modules/sax/AUTHORS b/node_modules/elementtree/node_modules/sax/AUTHORS
deleted file mode 100644
index 26d8659..0000000
--- a/node_modules/elementtree/node_modules/sax/AUTHORS
+++ /dev/null
@@ -1,9 +0,0 @@
-# contributors sorted by whether or not they're me.
-Isaac Z. Schlueter <i...@izs.me>
-Stein Martin Hustad <st...@hustad.com>
-Mikeal Rogers <mi...@gmail.com>
-Laurie Harper <la...@holoweb.net>
-Jann Horn <ja...@Jann-PC.fritz.box>
-Elijah Insua <tm...@gmail.com>
-Henry Rawas <he...@schakra.com>
-Justin Makeig <jm...@makeig.com>
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/node_modules/sax/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/node_modules/sax/LICENSE b/node_modules/elementtree/node_modules/sax/LICENSE
deleted file mode 100644
index 05a4010..0000000
--- a/node_modules/elementtree/node_modules/sax/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/19cf42ee/node_modules/elementtree/node_modules/sax/README.md
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/node_modules/sax/README.md b/node_modules/elementtree/node_modules/sax/README.md
deleted file mode 100644
index 9c63dc4..0000000
--- a/node_modules/elementtree/node_modules/sax/README.md
+++ /dev/null
@@ -1,213 +0,0 @@
-# sax js
-
-A sax-style parser for XML and HTML.
-
-Designed with [node](http://nodejs.org/) in mind, but should work fine in
-the browser or other CommonJS implementations.
-
-## What This Is
-
-* A very simple tool to parse through an XML string.
-* A stepping stone to a streaming HTML parser.
-* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML
- docs.
-
-## What This Is (probably) Not
-
-* An HTML Parser - That's a fine goal, but this isn't it. It's just
- XML.
-* A DOM Builder - You can use it to build an object model out of XML,
- but it doesn't do that out of the box.
-* XSLT - No DOM = no querying.
-* 100% Compliant with (some other SAX implementation) - Most SAX
- implementations are in Java and do a lot more than this does.
-* An XML Validator - It does a little validation when in strict mode, but
- not much.
-* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic
- masochism.
-* A DTD-aware Thing - Fetching DTDs is a much bigger job.
-
-## Regarding `<!DOCTYPE`s and `<!ENTITY`s
-
-The parser will handle the basic XML entities in text nodes and attribute
-values: `& < > ' "`. It's possible to define additional
-entities in XML by putting them in the DTD. This parser doesn't do anything
-with that. If you want to listen to the `ondoctype` event, and then fetch
-the doctypes, and read the entities and add them to `parser.ENTITIES`, then
-be my guest.
-
-Unknown entities will fail in strict mode, and in loose mode, will pass
-through unmolested.
-
-## Usage
-
- var sax = require("./lib/sax"),
- strict = true, // set to false for html-mode
- parser = sax.parser(strict);
-
- parser.onerror = function (e) {
- // an error happened.
- };
- parser.ontext = function (t) {
- // got some text. t is the string of text.
- };
- parser.onopentag = function (node) {
- // opened a tag. node has "name" and "attributes"
- };
- parser.onattribute = function (attr) {
- // an attribute. attr has "name" and "value"
- };
- parser.onend = function () {
- // parser stream is done, and ready to have more stuff written to it.
- };
-
- parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
-
- // stream usage
- // takes the same options as the parser
- var saxStream = require("sax").createStream(strict, options)
- saxStream.on("error", function (e) {
- // unhandled errors will throw, since this is a proper node
- // event emitter.
- console.error("error!", e)
- // clear the error
- this._parser.error = null
- this._parser.resume()
- })
- saxStream.on("opentag", function (node) {
- // same object as above
- })
- // pipe is supported, and it's readable/writable
- // same chunks coming in also go out.
- fs.createReadStream("file.xml")
- .pipe(saxStream)
- .pipe(fs.createReadStream("file-copy.xml"))
-
-
-
-## Arguments
-
-Pass the following arguments to the parser function. All are optional.
-
-`strict` - Boolean. Whether or not to be a jerk. Default: `false`.
-
-`opt` - Object bag of settings regarding string formatting. All default to `false`.
-
-Settings supported:
-
-* `trim` - Boolean. Whether or not to trim text and comment nodes.
-* `normalize` - Boolean. If true, then turn any whitespace into a single
- space.
-* `lowercasetags` - Boolean. If true, then lowercase tags in loose mode,
- rather than uppercasing them.
-* `xmlns` - Boolean. If true, then namespaces are supported.
-
-## Methods
-
-`write` - Write bytes onto the stream. You don't have to do this all at
-once. You can keep writing as much as you want.
-
-`close` - Close the stream. Once closed, no more data may be written until
-it is done processing the buffer, which is signaled by the `end` event.
-
-`resume` - To gracefully handle errors, assign a listener to the `error`
-event. Then, when the error is taken care of, you can call `resume` to
-continue parsing. Otherwise, the parser will not continue while in an error
-state.
-
-## Members
-
-At all times, the parser object will have the following members:
-
-`line`, `column`, `position` - Indications of the position in the XML
-document where the parser currently is looking.
-
-`startTagPosition` - Indicates the position where the current tag starts.
-
-`closed` - Boolean indicating whether or not the parser can be written to.
-If it's `true`, then wait for the `ready` event to write again.
-
-`strict` - Boolean indicating whether or not the parser is a jerk.
-
-`opt` - Any options passed into the constructor.
-
-`tag` - The current tag being dealt with.
-
-And a bunch of other stuff that you probably shouldn't touch.
-
-## Events
-
-All events emit with a single argument. To listen to an event, assign a
-function to `on<eventname>`. Functions get executed in the this-context of
-the parser object. The list of supported events are also in the exported
-`EVENTS` array.
-
-When using the stream interface, assign handlers using the EventEmitter
-`on` function in the normal fashion.
-
-`error` - Indication that something bad happened. The error will be hanging
-out on `parser.error`, and must be deleted before parsing can continue. By
-listening to this event, you can keep an eye on that kind of stuff. Note:
-this happens *much* more in strict mode. Argument: instance of `Error`.
-
-`text` - Text node. Argument: string of text.
-
-`doctype` - The `<!DOCTYPE` declaration. Argument: doctype string.
-
-`processinginstruction` - Stuff like `<?xml foo="blerg" ?>`. Argument:
-object with `name` and `body` members. Attributes are not parsed, as
-processing instructions have implementation dependent semantics.
-
-`sgmldeclaration` - Random SGML declarations. Stuff like `<!ENTITY p>`
-would trigger this kind of event. This is a weird thing to support, so it
-might go away at some point. SAX isn't intended to be used to parse SGML,
-after all.
-
-`opentag` - An opening tag. Argument: object with `name` and `attributes`.
-In non-strict mode, tag names are uppercased, unless the `lowercasetags`
-option is set. If the `xmlns` option is set, then it will contain
-namespace binding information on the `ns` member, and will have a
-`local`, `prefix`, and `uri` member.
-
-`closetag` - A closing tag. In loose mode, tags are auto-closed if their
-parent closes. In strict mode, well-formedness is enforced. Note that
-self-closing tags will have `closeTag` emitted immediately after `openTag`.
-Argument: tag name.
-
-`attribute` - An attribute node. Argument: object with `name` and `value`,
-and also namespace information if the `xmlns` option flag is set.
-
-`comment` - A comment node. Argument: the string of the comment.
-
-`opencdata` - The opening tag of a `<![CDATA[` block.
-
-`cdata` - The text of a `<![CDATA[` block. Since `<![CDATA[` blocks can get
-quite large, this event may fire multiple times for a single block, if it
-is broken up into multiple `write()`s. Argument: the string of random
-character data.
-
-`closecdata` - The closing tag (`]]>`) of a `<![CDATA[` block.
-
-`opennamespace` - If the `xmlns` option is set, then this event will
-signal the start of a new namespace binding.
-
-`closenamespace` - If the `xmlns` option is set, then this event will
-signal the end of a namespace binding.
-
-`end` - Indication that the closed stream has ended.
-
-`ready` - Indication that the stream has reset, and is ready to be written
-to.
-
-`noscript` - In non-strict mode, `<script>` tags trigger a `"script"`
-event, and their contents are not checked for special xml characters.
-If you pass `noscript: true`, then this behavior is suppressed.
-
-## Reporting Problems
-
-It's best to write a failing test if you find an issue. I will always
-accept pull requests with failing tests if they demonstrate intended
-behavior, but it is very hard to figure out what issue you're describing
-without a test. Writing a test is also the best way for you yourself
-to figure out if you really understand the issue you think you have with
-sax-js.