fast-xml-parser
fast-xml-parser copied to clipboard
Object doesn't support property or method 'trimStart'
- [ x] Are you running the latest version?
- [ x] Have you included sample input, output, error, and expected output?
- [x ] Have you checked if you are using correct configuration?
- [ x] Did you try online tool?
Description
I have a uwp reactnative app when I run as debug works fine but when I release the application it gives me this error: Object doesn't support property or method 'trimStart'
Input
xml checked online in many xml validation tools and its fine
Code
private parser_options = { ignoreAttributes: false, ignoreDeclaration: true, ignorePiTags: true, parseTagValue: false, trimValues: false, };
constructor(xml_str?: string) { try { const parser = new XMLParser(this.parser_options);
if (xml_str) {
this.xml_object = parser.parse(xml_str) ?? {
'?xml': { '@_version': '1.0', '@_encoding': 'UTF-8' },
};
} else {
this.xml_object = {
'?xml': { '@_version': '1.0', '@_encoding': 'UTF-8' },
};
}
} catch (e) {
console.log({
type: 'exception',
timestamp: new Date(),
xml_str,
error: e.message,
});
}
}
Output
expected data
Would you like to work on this issue?
- [ ] Yes
- [x ] No
Bookmark this repository for further updates. Visit SoloThought to know about recent features.
We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.
Can you please share the sample XML that is causing issue? smaller is preferable.
Closing the issue. Please reopen if problem exist with sample XML and library version.