XMLProcessingInstruction.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Generated by CoffeeScript 1.12.7
  2. (function() {
  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;
  6. XMLNode = require('./XMLNode');
  7. module.exports = XMLProcessingInstruction = (function(superClass) {
  8. extend(XMLProcessingInstruction, superClass);
  9. function XMLProcessingInstruction(parent, target, value) {
  10. XMLProcessingInstruction.__super__.constructor.call(this, parent);
  11. if (target == null) {
  12. throw new Error("Missing instruction target. " + this.debugInfo());
  13. }
  14. this.target = this.stringify.insTarget(target);
  15. if (value) {
  16. this.value = this.stringify.insValue(value);
  17. }
  18. }
  19. XMLProcessingInstruction.prototype.clone = function() {
  20. return Object.create(this);
  21. };
  22. XMLProcessingInstruction.prototype.toString = function(options) {
  23. return this.options.writer.set(options).processingInstruction(this);
  24. };
  25. return XMLProcessingInstruction;
  26. })(XMLNode);
  27. }).call(this);