backend v4 half

This commit is contained in:
2025-07-18 09:20:40 +02:00
parent aba7a506ad
commit 725516ad6c
4183 changed files with 217684 additions and 75056 deletions
+40 -53
View File
@@ -1,17 +1,29 @@
# [fast-xml-parser](https://www.npmjs.com/package/fast-xml-parser)
[![NPM quality][quality-image]][quality-url]
[![Coverage Status](https://coveralls.io/repos/github/NaturalIntelligence/fast-xml-parser/badge.svg?branch=master)](https://coveralls.io/github/NaturalIntelligence/fast-xml-parser?branch=master)
[<img src="https://img.shields.io/badge/Try-me-blue.svg?colorA=FFA500&colorB=0000FF" alt="Try me"/>](https://naturalintelligence.github.io/fast-xml-parser/)
[![NPM total downloads](https://img.shields.io/npm/dt/fast-xml-parser.svg)](https://npm.im/fast-xml-parser)
[![NPM total downloads](https://img.shields.io/npm/dt/fast-xml-parser.svg)](https://npm.im/fast-xml-parser)
Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback.
---
<img align="right" src="static/img/fxp_logo.png" width="180px" alt="FXP logo"/>
<a href="https://www.amazon.in/Power-Glasses-world-imagination-Perspective-ebook/dp/B0CW1CJGNK/"><img align="left" src="https://github.com/NaturalIntelligence/fast-xml-parser/assets/7692328/e7a42bcc-5186-45e3-bfee-de8d8b9a69d4" alt="ads-thePowerGlassesBook"/></a>
I had recently published a book, The Power Glasses. Please have a look. Your feedback would be helpful. You can [mail](githubissues@proton.me) me for a free copy.
<br>
* Validate XML data syntactically. Use [detailed-xml-validator](https://github.com/NaturalIntelligence/detailed-xml-validator/) to verify business rules.
* Parse XML to JS Objectand vice versa
* Common JS, ESM, and browser compatible
* Faster than any other pure JS implementation.
It can handle big files (tested up to 100mb). XML Entities, HTML entities, and DOCTYPE entites are supported. Unpaired tags (Eg `<br>` in HTML), stop nodes (Eg `<script>` in HTML) are supported. It can also preserve Order of tags in JS object
---
# Your Support, Our Motivation
## Try out our New Thoughts
We've recently launched **Flowgger**
<a href="https://github.com/solothought/flowgger"> <img src="static/img/flowgger_h.webp" alt="Flowgger Logging Framework" /></a>
Don't forget to check our new library [Text2Chart](https://solothought.com/text2chart/flow) that constructs flow chart out of simple text. Very helpful in creating or alayzing an algorithm, and documentation purpose.
## Financial Support
Sponsor this project
@@ -21,7 +33,7 @@ Sponsor this project
<a href="https://opencollective.com/fast-xml-parser/donate" target="_blank">
<img src="https://opencollective.com/fast-xml-parser/donate/button@2x.png?color=blue" width=180 />
</a>
<a href="https://paypal.me/naturalintelligence"> <img src="static/img/support_paypal.svg" alt="Stubmatic donate button" width="180"/></a>
<a href="https://paypal.me/naturalintelligence"> <img src="static/img/support_paypal.svg" alt="donate button" width="180"/></a>
<br>
<br>
<br>
@@ -50,7 +62,9 @@ Through OpenCollective
<a href="https://opencollective.com/fast-xml-parser/sponsor/9/website" target="_blank"><img src="https://opencollective.com/fast-xml-parser/sponsor/9/avatar.svg"></a>
-->
![fxp_sponsors](https://github.com/NaturalIntelligence/fast-xml-parser/assets/7692328/c9367497-d67e-410a-90a6-66e3808be929)
![fxp_sponsors](https://raw.githubusercontent.com/NaturalIntelligence/ThankYouBackers/main/assets/NI_sponsors.jpg)
> This is a donation. No goods or services are expected in return. Any requests for refunds for those purposes will be rejected.
## Users
@@ -78,30 +92,7 @@ Through OpenCollective
---
## Main Features
<img align="right" src="static/img/fxp_logo.png" width="180px" alt="FXP logo"/>
* Validate XML data syntactically
* Parse XML to JS Object
* Build XML from JS Object
* Compatible to node js packages, in browser, and in CLI (click try me button above for demo)
* Faster than any other pure JS implementation.
* It can handle big files (tested up to 100mb).
* Controlled parsing using various options
* XML Entities, HTML entities, and DOCTYPE entites are supported.
* unpaired tags (Eg `<br>` in HTML), stop nodes (Eg `<script>` in HTML) are supported.
* You can restore almost same XML from JSON
* Supports comments
* It can preserve Order of tags in JS object
* You can control if a single tag should be parsed into array.
* Supports parsing of PI (Processing Instruction) tags with XML declaration tags
* And many more other features.
## v5
I developed v5 in Apr 2023. And I didn't get the chance to complete all the features. I've ensured that new features don't impact performance. With v5, you have more control on parsing output. Check [docs](./docs/v5) for syntax help and basic understanding.
Please leave a comment in discussion forum for your suggestions and if you really need v5.
# More about this library
## How to use
@@ -152,9 +143,9 @@ Bundle size
| fxp.min.js | 26K |
| fxvalidator.min.js | 5.7K |
### Documents
## Documents
<table>
<tr><td>v3</td><td>v4</td><td>v5</td></tr>
<tr><td>v3</td><td>v4 and v5</td><td>v6</td></tr>
<tr>
<td>
<a href="./docs/v3/docs.md">documents</a>
@@ -169,16 +160,18 @@ Bundle size
<li><a href="./docs/v4/7.PITags.md">PI Tag processing</a></li>
</ol></td>
<td><ol>
<li></li><a href="./docs/v5/1.GettingStarted.md">Getting Started</a></li>
<li><a href="./docs/v5/2.Features.md">Features</a></li>
<li><a href="./docs/v5/3.Options.md">Options</a></li>
<li><a href="./docs/v5/4.OutputBuilders.md">Output Builders</a></li>
<li><a href="./docs/v5/5.ValueParsers.md">Value Parsers</a></li>
<li></li><a href="./docs/v6/1.GettingStarted.md">Getting Started</a></li>
<li><a href="./docs/v6/2.Features.md">Features</a></li>
<li><a href="./docs/v6/3.Options.md">Options</a></li>
<li><a href="./docs/v6/4.OutputBuilders.md">Output Builders</a></li>
<li><a href="./docs/v6/5.ValueParsers.md">Value Parsers</a></li>
</ol></td>
</tr>
</table>
**note**: version 5 is released with version 4 tfor experimental use. Based on it's demand, it'll be developed and the features can be different in final release.
**note**:
- Version 6 is released with version 4 for experimental use. Based on it's demand, it'll be developed and the features can be different in final release.
- Version 5 has the same functionalities as version 4.
## Performance
<small>negative means error</small>
@@ -196,10 +189,9 @@ Bundle size
<img src="./docs/imgs/XMLBuilder_v4.png" width="50%" />
* Y-axis: requests per second
<!-- [![](static/img/ni_ads_ads.gif)](https://github.com/NaturalIntelligence/ads/) -->
---
## Usage Trend
@@ -209,20 +201,15 @@ Bundle size
<img src="https://npm-compare.com/img/npm-trend/THREE_YEARS/fast-xml-parser.png" width="50%" alt="NPM Usage Trend of fast-xml-parser" />
</a>
## Supporters
### Contributors
# Supporters
#### Contributors
This project exists thanks to [all](graphs/contributors) the people who contribute. [[Contribute](docs/CONTRIBUTING.md)].
<!-- <a href="graphs/contributors"><img src="https://opencollective.com/fast-xml-parser/contributors.svg?width=890&button=false" /></a> -->
<!--
### Lead Maintainers
![Amit Gupta](https://avatars1.githubusercontent.com/u/7692328?s=100&v=4)
[![Vohmyanin Sergey Vasilevich](https://avatars3.githubusercontent.com/u/783335?s=100&v=4)](https://github.com/Delagen)
### All Contributors -->
<a href="graphs/contributors"><img src="https://opencollective.com/fast-xml-parser/contributors.svg?width=890&button=false" /></a>
### Backers
#### Backers from Open collective
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/fast-xml-parser#backer)]