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.

XMLRaw.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Generated by CoffeeScript 2.4.1
  2. (function() {
  3. var NodeType, XMLNode, XMLRaw;
  4. NodeType = require('./NodeType');
  5. XMLNode = require('./XMLNode');
  6. // Represents a raw node
  7. module.exports = XMLRaw = class XMLRaw extends XMLNode {
  8. // Initializes a new instance of `XMLRaw`
  9. // `text` raw text
  10. constructor(parent, text) {
  11. super(parent);
  12. if (text == null) {
  13. throw new Error("Missing raw text. " + this.debugInfo());
  14. }
  15. this.type = NodeType.Raw;
  16. this.value = this.stringify.raw(text);
  17. }
  18. // Creates and returns a deep clone of `this`
  19. clone() {
  20. return Object.create(this);
  21. }
  22. // Converts the XML fragment to string
  23. // `options.pretty` pretty prints the result
  24. // `options.indent` indentation for pretty print
  25. // `options.offset` how many indentations to add to every line for pretty print
  26. // `options.newline` newline sequence for pretty print
  27. toString(options) {
  28. return this.options.writer.raw(this, this.options.writer.filterOptions(options));
  29. }
  30. };
  31. }).call(this);