| 104 | } |
| 105 | |
| 106 | public get innerText(): string { |
| 107 | if (this.nodeType === XmlNodeType.Element || this.nodeType === XmlNodeType.Document) { |
| 108 | if (this.firstElement && this.firstElement.nodeType === XmlNodeType.CDATA) { |
| 109 | return this.firstElement.innerText; |
| 110 | } |
| 111 | let txt: string = ''; |
| 112 | for (const c of this.childNodes) { |
| 113 | txt += c.innerText?.toString(); |
| 114 | } |
| 115 | const s: string = txt; |
| 116 | return s.trim(); |
| 117 | } |
| 118 | return this.value ?? ''; |
| 119 | } |
| 120 | |
| 121 | public set innerText(value: string) { |
| 122 | const textNode = new XmlNode(); |