Skip to content
Browse files

Merge pull request #17 from svenvarkel/master

  • Loading branch information...
2 parents 89a99b1 + bf704ce commit e4fdad70ddd0b4761b07c60610cf50ef55f0f777 @touv touv committed
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/xml-writer.js
View
14 lib/xml-writer.js
@@ -12,7 +12,7 @@ function strval(s) {
}
else if (typeof s == 'function') {
return s();
- }
+ }
else if (s instanceof XMLWriter) {
return s.toString();
}
@@ -82,7 +82,7 @@ XMLWriter.prototype = {
startDocument : function (version, encoding, standalone) {
if (this.tags || this.attributes) return this;
-
+
this.startPI('xml');
this.startAttribute('version');
this.text(typeof version == "string" ? version : "1.0");
@@ -91,7 +91,7 @@ XMLWriter.prototype = {
this.startAttribute('encoding');
this.text(encoding);
this.endAttribute();
- writer_encoding = encoding;
+ this.writer_encoding = encoding;
}
if (standalone) {
this.startAttribute('standalone');
@@ -130,7 +130,7 @@ XMLWriter.prototype = {
this.texts = 0;
if (this.stack.length > 0)
this.stack[this.stack.length-1].containsTag = true;
-
+
this.stack.push({
name: name,
tags: this.tags
@@ -152,7 +152,7 @@ XMLWriter.prototype = {
this.texts = 0;
if (this.stack.length > 0)
this.stack[this.stack.length-1].containsTag = true;
-
+
this.stack.push({
name: prefix + ':' + name,
tags: this.tags
@@ -265,7 +265,7 @@ XMLWriter.prototype = {
return this;
} else if (this.attributes && !this.attribute) {
this.endAttributes();
- }
+ }
if (this.comment || this.cdata) {
this.write(content);
}
@@ -377,7 +377,7 @@ XMLWriter.prototype = {
return this;
},
- writeRaw : function(content) {
+ writeRaw : function(content) {
content = strval(content);
if (!this.tags && !this.comment && !this.pi && !this.cdata) return this;
if (this.attributes && this.attribute) {

0 comments on commit e4fdad7

Please sign in to comment.
Something went wrong with that request. Please try again.