(attributeName: string)
| 225 | } |
| 226 | |
| 227 | private readAttributeValue(attributeName: string): string { |
| 228 | const quote = this.xml[this.index]; |
| 229 | if (quote !== '"' && quote !== "'") { |
| 230 | throw new Error(`XML attribute "${attributeName}" must use a quoted value.`); |
| 231 | } |
| 232 | this.index += 1; |
| 233 | const startIndex = this.index; |
| 234 | const endIndex = this.xml.indexOf(quote, startIndex); |
| 235 | if (endIndex === -1) { |
| 236 | throw new Error(`XML attribute "${attributeName}" is not closed.`); |
| 237 | } |
| 238 | this.index = endIndex + 1; |
| 239 | return decodeXmlEntities(this.xml.slice(startIndex, endIndex).trim()); |
| 240 | } |
| 241 | |
| 242 | private skipDeclaration(): void { |
| 243 | const state: DeclarationScanState = { quote: null, bracketDepth: 0 }; |
no test coverage detected