| 64 | } as XmlEvent); |
| 65 | }, |
| 66 | onStartElement( |
| 67 | name, |
| 68 | colonIndex, |
| 69 | uri, |
| 70 | attributes: XmlAttributeIterator, |
| 71 | selfClosing, |
| 72 | line, |
| 73 | column, |
| 74 | offset, |
| 75 | ) { |
| 76 | const attrs: Array<{ name: XmlName; value: string }> = []; |
| 77 | for (let i = 0; i < attributes.count; i++) { |
| 78 | const attrName = attributes.getName(i); |
| 79 | const attrColonIndex = attributes.getColonIndex(i); |
| 80 | const attrUri = attributes.getUri(i); |
| 81 | attrs.push({ |
| 82 | name: parseName(attrName, attrColonIndex, attrUri), |
| 83 | value: attributes.getValue(i), |
| 84 | }); |
| 85 | } |
| 86 | events.push({ |
| 87 | type: "start_element", |
| 88 | name: parseName(name, colonIndex, uri), |
| 89 | attributes: attrs, |
| 90 | selfClosing, |
| 91 | line, |
| 92 | column, |
| 93 | offset, |
| 94 | }); |
| 95 | }, |
| 96 | onEndElement(name, colonIndex, uri, line, column, offset) { |
| 97 | events.push({ |
| 98 | type: "end_element", |