()
| 140 | } |
| 141 | |
| 142 | private readAttribute(): { name: string; value: string } { |
| 143 | const name = this.readRequiredName(`Invalid XML attribute at offset ${this.index}.`); |
| 144 | assertSafeXmlAttributeName(name); |
| 145 | this.skipWhitespace(); |
| 146 | if (this.xml[this.index] !== '=') { |
| 147 | throw new Error(`Missing value for XML attribute "${name}".`); |
| 148 | } |
| 149 | this.index += 1; |
| 150 | this.skipWhitespace(); |
| 151 | return { name, value: this.readAttributeValue(name) }; |
| 152 | } |
| 153 | |
| 154 | private pushOpenNode(node: XmlNode): void { |
| 155 | if (this.stack.length >= MAX_XML_NESTING_DEPTH) { |
no test coverage detected