| 320 | private _errors!: ParseError[]; |
| 321 | |
| 322 | convert(message: string, url: string) { |
| 323 | const xmlIcu = new XmlParser().parse(message, url, {tokenizeExpansionForms: true}); |
| 324 | this._errors = xmlIcu.errors; |
| 325 | |
| 326 | const i18nNodes = |
| 327 | this._errors.length > 0 || xmlIcu.rootNodes.length == 0 |
| 328 | ? [] |
| 329 | : [].concat(...ml.visitAll(this, xmlIcu.rootNodes)); |
| 330 | |
| 331 | return { |
| 332 | i18nNodes: i18nNodes, |
| 333 | errors: this._errors, |
| 334 | }; |
| 335 | } |
| 336 | |
| 337 | visitText(text: ml.Text, context: any) { |
| 338 | return new i18n.Text(text.value, text.sourceSpan); |