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