MCPcopy Create free account
hub / github.com/denoland/std / onStartElement

Function onStartElement

xml/_parser_test.ts:66–95  ·  view source on GitHub ↗
(
      name,
      colonIndex,
      uri,
      attributes: XmlAttributeIterator,
      selfClosing,
      line,
      column,
      offset,
    )

Source from the content-addressed store, hash-verified

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",

Callers

nothing calls this directly

Calls 6

parseNameFunction · 0.70
getNameMethod · 0.65
getColonIndexMethod · 0.65
getUriMethod · 0.65
getValueMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected