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

Method _writeAttributeValue

packages/alphatab/src/xml/XmlWriter.ts:95–119  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

93 }
94
95 private _writeAttributeValue(value: string) {
96 for (let i = 0; i < value.length; i++) {
97 const c = value.charAt(i);
98 switch (c) {
99 case '<':
100 this._result.push('&lt;');
101 break;
102 case '>':
103 this._result.push('&gt;');
104 break;
105 case '&':
106 this._result.push('&amp;');
107 break;
108 case "'":
109 this._result.push('&apos;');
110 break;
111 case '"':
112 this._result.push('&quot;');
113 break;
114 default:
115 this._result.push(c);
116 break;
117 }
118 }
119 }
120
121 public static write(xml: XmlNode, indention: string, xmlHeader: boolean): string {
122 const writer = new XmlWriter(indention, xmlHeader);

Callers 1

writeNodeMethod · 0.95

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected