Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

XMLDocType.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Generated by CoffeeScript 1.12.7
  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. isObject = require('./Utility').isObject;
  7. XMLNode = require('./XMLNode');
  8. XMLDTDAttList = require('./XMLDTDAttList');
  9. XMLDTDEntity = require('./XMLDTDEntity');
  10. XMLDTDElement = require('./XMLDTDElement');
  11. XMLDTDNotation = require('./XMLDTDNotation');
  12. module.exports = XMLDocType = (function(superClass) {
  13. extend(XMLDocType, superClass);
  14. function XMLDocType(parent, pubID, sysID) {
  15. var ref, ref1;
  16. XMLDocType.__super__.constructor.call(this, parent);
  17. this.documentObject = parent;
  18. if (isObject(pubID)) {
  19. ref = pubID, pubID = ref.pubID, sysID = ref.sysID;
  20. }
  21. if (sysID == null) {
  22. ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1];
  23. }
  24. if (pubID != null) {
  25. this.pubID = this.stringify.dtdPubID(pubID);
  26. }
  27. if (sysID != null) {
  28. this.sysID = this.stringify.dtdSysID(sysID);
  29. }
  30. }
  31. XMLDocType.prototype.element = function(name, value) {
  32. var child;
  33. child = new XMLDTDElement(this, name, value);
  34. this.children.push(child);
  35. return this;
  36. };
  37. XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  38. var child;
  39. child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
  40. this.children.push(child);
  41. return this;
  42. };
  43. XMLDocType.prototype.entity = function(name, value) {
  44. var child;
  45. child = new XMLDTDEntity(this, false, name, value);
  46. this.children.push(child);
  47. return this;
  48. };
  49. XMLDocType.prototype.pEntity = function(name, value) {
  50. var child;
  51. child = new XMLDTDEntity(this, true, name, value);
  52. this.children.push(child);
  53. return this;
  54. };
  55. XMLDocType.prototype.notation = function(name, value) {
  56. var child;
  57. child = new XMLDTDNotation(this, name, value);
  58. this.children.push(child);
  59. return this;
  60. };
  61. XMLDocType.prototype.toString = function(options) {
  62. return this.options.writer.set(options).docType(this);
  63. };
  64. XMLDocType.prototype.ele = function(name, value) {
  65. return this.element(name, value);
  66. };
  67. XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  68. return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
  69. };
  70. XMLDocType.prototype.ent = function(name, value) {
  71. return this.entity(name, value);
  72. };
  73. XMLDocType.prototype.pent = function(name, value) {
  74. return this.pEntity(name, value);
  75. };
  76. XMLDocType.prototype.not = function(name, value) {
  77. return this.notation(name, value);
  78. };
  79. XMLDocType.prototype.up = function() {
  80. return this.root() || this.documentObject;
  81. };
  82. return XMLDocType;
  83. })(XMLNode);
  84. }).call(this);