3 var XMLNode, XMLProcessingInstruction,
4 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; },
5 hasProp = {}.hasOwnProperty;
7 XMLNode = require(
'./XMLNode');
9 module.exports = XMLProcessingInstruction = (
function(superClass) {
10 extend(XMLProcessingInstruction, superClass);
12 function XMLProcessingInstruction(parent, target, value) {
13 XMLProcessingInstruction.__super__.constructor.call(
this, parent);
15 throw new Error(
"Missing instruction target");
17 this.target = this.stringify.insTarget(target);
19 this.value = this.stringify.insValue(value);
23 XMLProcessingInstruction.prototype.clone =
function() {
24 return Object.create(
this);
27 XMLProcessingInstruction.prototype.toString =
function(options) {
28 return this.options.writer.set(options).processingInstruction(
this);
31 return XMLProcessingInstruction;