1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var error_1 = require("../error");
- var validate_1 = require("../validate");
- var XmlEntityRef = (function () {
- function XmlEntityRef(parent, validation, options) {
- this._validation = validation;
- this._parent = parent;
- this.name = options.name;
- }
- Object.defineProperty(XmlEntityRef.prototype, "name", {
-
- get: function () {
- return this._name;
- },
-
- set: function (name) {
- if (this._validation && !(0, validate_1.validateName)(name)) {
- throw new Error((0, error_1.getContext)(this.up()) + ": entity reference name"
- + (" \"" + name + "\" should not contain characters not")
- + " allowed in XML names");
- }
- this._name = name;
- },
- enumerable: false,
- configurable: true
- });
-
- XmlEntityRef.prototype.toString = function () {
- return "&" + this._name + ";";
- };
-
- XmlEntityRef.prototype.up = function () {
- return this._parent;
- };
- return XmlEntityRef;
- }());
- exports.default = XmlEntityRef;
|