Newer
Older
CVSS_3.0_GUI / node_modules / nwjs-builder-phoenix / node_modules / plist / node_modules / xmlbuilder / lib / XMLDocType.js
root on 7 May 2019 3 KB Initial commit
  1. // Generated by CoffeeScript 1.10.0
  2. (function() {
  3. var XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNode, isObject,
  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.  
  7. isObject = require('./Utility').isObject;
  8.  
  9. XMLNode = require('./XMLNode');
  10.  
  11. XMLDTDAttList = require('./XMLDTDAttList');
  12.  
  13. XMLDTDEntity = require('./XMLDTDEntity');
  14.  
  15. XMLDTDElement = require('./XMLDTDElement');
  16.  
  17. XMLDTDNotation = require('./XMLDTDNotation');
  18.  
  19. module.exports = XMLDocType = (function(superClass) {
  20. extend(XMLDocType, superClass);
  21.  
  22. function XMLDocType(parent, pubID, sysID) {
  23. var ref, ref1;
  24. XMLDocType.__super__.constructor.call(this, parent);
  25. this.documentObject = parent;
  26. if (isObject(pubID)) {
  27. ref = pubID, pubID = ref.pubID, sysID = ref.sysID;
  28. }
  29. if (sysID == null) {
  30. ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1];
  31. }
  32. if (pubID != null) {
  33. this.pubID = this.stringify.dtdPubID(pubID);
  34. }
  35. if (sysID != null) {
  36. this.sysID = this.stringify.dtdSysID(sysID);
  37. }
  38. }
  39.  
  40. XMLDocType.prototype.element = function(name, value) {
  41. var child;
  42. child = new XMLDTDElement(this, name, value);
  43. this.children.push(child);
  44. return this;
  45. };
  46.  
  47. XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  48. var child;
  49. child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
  50. this.children.push(child);
  51. return this;
  52. };
  53.  
  54. XMLDocType.prototype.entity = function(name, value) {
  55. var child;
  56. child = new XMLDTDEntity(this, false, name, value);
  57. this.children.push(child);
  58. return this;
  59. };
  60.  
  61. XMLDocType.prototype.pEntity = function(name, value) {
  62. var child;
  63. child = new XMLDTDEntity(this, true, name, value);
  64. this.children.push(child);
  65. return this;
  66. };
  67.  
  68. XMLDocType.prototype.notation = function(name, value) {
  69. var child;
  70. child = new XMLDTDNotation(this, name, value);
  71. this.children.push(child);
  72. return this;
  73. };
  74.  
  75. XMLDocType.prototype.toString = function(options) {
  76. return this.options.writer.set(options).docType(this);
  77. };
  78.  
  79. XMLDocType.prototype.ele = function(name, value) {
  80. return this.element(name, value);
  81. };
  82.  
  83. XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  84. return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
  85. };
  86.  
  87. XMLDocType.prototype.ent = function(name, value) {
  88. return this.entity(name, value);
  89. };
  90.  
  91. XMLDocType.prototype.pent = function(name, value) {
  92. return this.pEntity(name, value);
  93. };
  94.  
  95. XMLDocType.prototype.not = function(name, value) {
  96. return this.notation(name, value);
  97. };
  98.  
  99. XMLDocType.prototype.up = function() {
  100. return this.root() || this.documentObject;
  101. };
  102.  
  103. return XMLDocType;
  104.  
  105. })(XMLNode);
  106.  
  107. }).call(this);
Buy Me A Coffee