Newer
Older
CVSS_3.0_GUI / dist / CVSS_3.0_Calc-1.0.0-linux-x64 / node_modules / nwjs-builder-phoenix / node_modules / plist / node_modules / xmlbuilder / lib / XMLDTDElement.js
root on 7 May 2019 1 KB Initial commit
  1. // Generated by CoffeeScript 1.10.0
  2. (function() {
  3. var XMLDTDElement, XMLNode,
  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. XMLNode = require('./XMLNode');
  8.  
  9. module.exports = XMLDTDElement = (function(superClass) {
  10. extend(XMLDTDElement, superClass);
  11.  
  12. function XMLDTDElement(parent, name, value) {
  13. XMLDTDElement.__super__.constructor.call(this, parent);
  14. if (name == null) {
  15. throw new Error("Missing DTD element name");
  16. }
  17. if (!value) {
  18. value = '(#PCDATA)';
  19. }
  20. if (Array.isArray(value)) {
  21. value = '(' + value.join(',') + ')';
  22. }
  23. this.name = this.stringify.eleName(name);
  24. this.value = this.stringify.dtdElementValue(value);
  25. }
  26.  
  27. XMLDTDElement.prototype.toString = function(options) {
  28. return this.options.writer.set(options).dtdElement(this);
  29. };
  30.  
  31. return XMLDTDElement;
  32.  
  33. })(XMLNode);
  34.  
  35. }).call(this);
Buy Me A Coffee