LaRynk
LaRynk2y ago

✅ – Rinkusu – 14-53 Apr 4

Hi, I'm in vanilla JS and trying to use fast-xml-parser. I imported the script with a script tag:
<scri
integrity="sha512-XRps..."
src="https://cdnjs.cloudflare.com/ajax/libs/fast-xml-parser/4.1.3/fxparser.min.js"
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<scri
integrity="sha512-XRps..."
src="https://cdnjs.cloudflare.com/ajax/libs/fast-xml-parser/4.1.3/fxparser.min.js"
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
But when trying to parse an actual xml file the output is an empty object. Any idea please ?
const parser = new XMLParser()

console.log(parser.parse(require`../tiled/${filePath}.tmx`))
const parser = new XMLParser()

console.log(parser.parse(require`../tiled/${filePath}.tmx`))
4 Replies
ScriptyChris
ScriptyChris2y ago
@Rinkusu what's the output of
console.log(
'required tmx file:',
require`../tiled/${filePath}.tmx`
);
console.log(
'required tmx file:',
require`../tiled/${filePath}.tmx`
);
?
LaRynk
LaRynkOP2y ago
nvm I made a php script, thx anyway
reactibot
reactibot2y ago
This question has an answer! Thank you for helping 😄 If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1092824198528901191
reactibot
reactibot2y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1092824198528901191 Question not getting answered? Maybe it's hard to answer, or maybe you asked at a slow time. Check out these resources for help asking a good question: https://stackoverflow.com/help/how-to-ask http://wp.me/p2oIwo-26