00001
00002 (function() {
00003 var XMLCData, XMLNode,
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 = XMLCData = (function(superClass) {
00010 extend(XMLCData, superClass);
00011
00012 function XMLCData(parent, text) {
00013 XMLCData.__super__.constructor.call(this, parent);
00014 if (text == null) {
00015 throw new Error("Missing CDATA text");
00016 }
00017 this.text = this.stringify.cdata(text);
00018 }
00019
00020 XMLCData.prototype.clone = function() {
00021 return Object.create(this);
00022 };
00023
00024 XMLCData.prototype.toString = function(options) {
00025 return this.options.writer.set(options).cdata(this);
00026 };
00027
00028 return XMLCData;
00029
00030 })(XMLNode);
00031
00032 }).call(this);