MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / _parseDom

Method _parseDom

packages/alphatab/src/importer/CapellaParser.ts:219–250  ·  view source on GitHub ↗
(dom: XmlDocument)

Source from the content-addressed store, hash-verified

217 }
218
219 private _parseDom(dom: XmlDocument): void {
220 const root: XmlNode | null = dom.firstElement;
221 if (!root) {
222 throw new UnsupportedFormatError('No valid XML');
223 }
224 if (root.localName === 'score') {
225 this.score = new Score();
226 // parse all children
227 for (const n of root.childElements()) {
228 switch (n.localName) {
229 case 'info':
230 this._parseInfo(n);
231 break;
232 case 'layout':
233 this._parseLayout(n);
234 break;
235 case 'gallery':
236 this._parseGallery(n);
237 break;
238 case 'pageObjects':
239 this._parsePageObjects(n);
240 break;
241 // barCount ignored
242 case 'systems':
243 this._parseSystems(n);
244 break;
245 }
246 }
247 } else {
248 throw new UnsupportedFormatError('Root node of XML was not "score"');
249 }
250 }
251
252 private _staffLookup: Map<number, Staff> = new Map();
253 private _parseLayout(element: XmlNode) {

Callers 1

parseXmlMethod · 0.95

Calls 6

_parseInfoMethod · 0.95
_parseLayoutMethod · 0.95
_parseGalleryMethod · 0.95
_parsePageObjectsMethod · 0.95
_parseSystemsMethod · 0.95
childElementsMethod · 0.80

Tested by

no test coverage detected