MCPcopy Create free account
hub / github.com/TruthHun/BookStack / XMLDTDAttList

Function XMLDTDAttList

static/word2md/mammoth.browser.js:30289–30317  ·  view source on GitHub ↗
(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue)

Source from the content-addressed store, hash-verified

30287 extend(XMLDTDAttList, superClass);
30288
30289 function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
30290 XMLDTDAttList.__super__.constructor.call(this, parent);
30291 if (elementName == null) {
30292 throw new Error("Missing DTD element name. " + this.debugInfo());
30293 }
30294 if (attributeName == null) {
30295 throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName));
30296 }
30297 if (!attributeType) {
30298 throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName));
30299 }
30300 if (!defaultValueType) {
30301 throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName));
30302 }
30303 if (defaultValueType.indexOf('#') !== 0) {
30304 defaultValueType = '#' + defaultValueType;
30305 }
30306 if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
30307 throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName));
30308 }
30309 if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
30310 throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName));
30311 }
30312 this.elementName = this.stringify.eleName(elementName);
30313 this.attributeName = this.stringify.attName(attributeName);
30314 this.attributeType = this.stringify.dtdAttType(attributeType);
30315 this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
30316 this.defaultValueType = defaultValueType;
30317 }
30318
30319 XMLDTDAttList.prototype.toString = function(options) {
30320 return this.options.writer.set(options).dtdAttList(this);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected