| 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('<'); |
| 101 | break; |
| 102 | case '>': |
| 103 | this._result.push('>'); |
| 104 | break; |
| 105 | case '&': |
| 106 | this._result.push('&'); |
| 107 | break; |
| 108 | case "'": |
| 109 | this._result.push('''); |
| 110 | break; |
| 111 | case '"': |
| 112 | this._result.push('"'); |
| 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); |