NaturalIntelligence / fast-xml-parser

Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.
https://naturalintelligence.github.io/fast-xml-parser/
MIT License
2.58k stars 309 forks source link

fxparser is not defined ( html browser, CDN ) #696

Open hoogw opened 3 days ago

hoogw commented 3 days ago

Please help, I get error

fxparser is not defined

Screenshot 2024-11-18 at 9 49 12 AM

HTML tag

<script src="https://cdnjs.cloudflare.com/ajax/libs/fast-xml-parser/4.5.0/fxparser.min.js" integrity="sha512-q1u77EjD05HQWHgQEOkFWpMXXJQZLHNNgMVxp0K+LvtStBVHcgbm+u18TFTPpZ48fcjX4NZJlljQM4mNkUeifA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

JS const parser = new fxparser.XMLParser(); let getCapabilities_Obj = parser.parse(getCapabilities);

I am not sure, why fxparser was comment out in min.js file see

Screenshot 2024-11-18 at 9 52 50 AM

Do I also need to add https://cdnjs.cloudflare.com/ajax/libs/fast-xml-parser/4.5.0/fxparser.min.js.map to html ?

github-actions[bot] commented 3 days ago

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.

hoogw commented 3 days ago

ok, I change code to const parser = new XMLParser();

No error, but result is empty,

here is my xml document Screenshot 2024-11-18 at 10 26 15 AM

Here is console, parse result object is empty. Screenshot 2024-11-18 at 10 26 56 AM

amitguptagwl commented 2 days ago
const parser = new fxp.XMLParser(config);
result = parser.parse(xmlData);

FYR: https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/index.html