00001
00002 (function() {
00003 var XMLNode, XMLText,
00004 extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
00005 hasProp = {}.hasOwnProperty;
00006
00007 XMLNode = require('./XMLNode');
00008
00009 module.exports = XMLText = (function(superClass) {
00010 extend(XMLText, superClass);
00011
00012 function XMLText(parent, text) {
00013 XMLText.__super__.constructor.call(this, parent);
00014 if (text == null) {
00015 throw new Error("Missing element text");
00016 }
00017 this.value = this.stringify.eleText(text);
00018 }
00019
00020 XMLText.prototype.clone = function() {
00021 return Object.create(this);
00022 };
00023
00024 XMLText.prototype.toString = function(options) {
00025 return this.options.writer.set(options).text(this);
00026 };
00027
00028 return XMLText;
00029
00030 })(XMLNode);
00031
00032 }).call(this);