@@ -25,7 +25,7 @@ window.Processing = require('./src/')(Browser);
2525},{"./src/":27}],2:[function(require,module,exports){
2626module.exports={
2727 "name": "Processing.js",
28- "version": "1.4.9 ",
28+ "version": "1.4.10 ",
2929 "dependencies": {
3030 "argv": "~0.0.2",
3131 "browserify": "~2.18.1",
@@ -5919,11 +5919,11 @@ module.exports = function(options, undef) {
59195919 toString: function() {
59205920 // shortcut for text and cdata nodes
59215921 if (this.type === "TEXT") {
5922- return this.content;
5922+ return this.content || "" ;
59235923 }
59245924
59255925 if (this.type === "CDATA") {
5926- return this.cdata;
5926+ return this.cdata || "" ;
59275927 }
59285928
59295929 // real XMLElements
@@ -5939,7 +5939,7 @@ module.exports = function(options, undef) {
59395939
59405940 // serialize all children to XML string
59415941 if (this.children.length === 0) {
5942- if (this.content==="" ) {
5942+ if (this.content === "" || this.content === null || this.content === undefined ) {
59435943 xmlstring += "/>";
59445944 } else {
59455945 xmlstring += ">" + this.content + "</"+tagstring+">";
@@ -7698,8 +7698,8 @@ module.exports = function setupParser(Processing, options) {
76987698 "noCursor", "noFill", "noise", "noiseDetail", "noiseSeed", "noLights",
76997699 "noLoop", "norm", "normal", "noSmooth", "noStroke", "noTint", "ortho",
77007700 "param", "parseBoolean", "parseByte", "parseChar", "parseFloat",
7701- "parseInt", "peg ", "perspective ", "PImage ", "pixels ", "PMatrix2D ",
7702- "PMatrix3D", "PMatrixStack", "pmouseX", "pmouseY", "point",
7701+ "parseInt", "parseXML ", "peg ", "perspective ", "PImage ", "pixels ",
7702+ "PMatrix2D", " PMatrix3D", "PMatrixStack", "pmouseX", "pmouseY", "point",
77037703 "pointLight", "popMatrix", "popStyle", "pow", "print", "printCamera",
77047704 "println", "printMatrix", "printProjection", "PShape", "PShapeSVG",
77057705 "pushMatrix", "pushStyle", "quad", "radians", "random", "randomGaussian",
@@ -10644,6 +10644,18 @@ module.exports = function setupParser(Processing, options) {
1064410644 return new XML(p, uri);
1064510645 };
1064610646
10647+ /**
10648+ * Processing 2.0 function for creating XML elements from string
10649+ *
10650+ * @param {String} xml the XML source code
10651+ *
10652+ * @return {XML} An XML object representation of the input XML markup.
10653+ */
10654+ p.parseXML = function(xmlstring) {
10655+ var element = new XML();
10656+ element.parse(xmlstring);
10657+ return element;
10658+ };
1064710659
1064810660 ////////////////////////////////////////////////////////////////////////////
1064910661 // 2D Matrix
0 commit comments