You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

XMLDOMConfiguration.js 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Generated by CoffeeScript 2.4.1
  2. (function() {
  3. var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
  4. XMLDOMErrorHandler = require('./XMLDOMErrorHandler');
  5. XMLDOMStringList = require('./XMLDOMStringList');
  6. // Implements the DOMConfiguration interface
  7. module.exports = XMLDOMConfiguration = (function() {
  8. class XMLDOMConfiguration {
  9. constructor() {
  10. var clonedSelf;
  11. this.defaultParams = {
  12. "canonical-form": false,
  13. "cdata-sections": false,
  14. "comments": false,
  15. "datatype-normalization": false,
  16. "element-content-whitespace": true,
  17. "entities": true,
  18. "error-handler": new XMLDOMErrorHandler(),
  19. "infoset": true,
  20. "validate-if-schema": false,
  21. "namespaces": true,
  22. "namespace-declarations": true,
  23. "normalize-characters": false,
  24. "schema-location": '',
  25. "schema-type": '',
  26. "split-cdata-sections": true,
  27. "validate": false,
  28. "well-formed": true
  29. };
  30. this.params = clonedSelf = Object.create(this.defaultParams);
  31. }
  32. // Gets the value of a parameter.
  33. // `name` name of the parameter
  34. getParameter(name) {
  35. if (this.params.hasOwnProperty(name)) {
  36. return this.params[name];
  37. } else {
  38. return null;
  39. }
  40. }
  41. // Checks if setting a parameter to a specific value is supported.
  42. // `name` name of the parameter
  43. // `value` parameter value
  44. canSetParameter(name, value) {
  45. return true;
  46. }
  47. // Sets the value of a parameter.
  48. // `name` name of the parameter
  49. // `value` new value or null if the user wishes to unset the parameter
  50. setParameter(name, value) {
  51. if (value != null) {
  52. return this.params[name] = value;
  53. } else {
  54. return delete this.params[name];
  55. }
  56. }
  57. };
  58. // Returns the list of parameter names
  59. Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', {
  60. get: function() {
  61. return new XMLDOMStringList(Object.keys(this.defaultParams));
  62. }
  63. });
  64. return XMLDOMConfiguration;
  65. }).call(this);
  66. }).call(this);