Skip to content

Commit a08f5fc

Browse files
authored
Update README.md
1 parent e339cf7 commit a08f5fc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# [fast-xml-parser](https://www.npmjs.com/package/fast-xml-parser)
22
Validate XML or Parse XML to JS/JSON very fast without C/C++ based libraries and no callback
33

4+
<p style="color:red;"> **Note**: If you are using v3, your code may start failing in parsing and validation both. I apologize for the breaking changes. But code was supposed to be changed to support large files and many other options. Please refer the code example below for more detail.</p>
45
You can use this library online (press try me button above), or as command from CLI, or in your website, or in npm repo.
56

67
* This library let you validate the XML data syntactically.
@@ -73,7 +74,7 @@ if(fastXmlParser.validate(xmlData)=== true){//optional
7374

7475
//Intermediate obj
7576
var tObj = fastXmlParser.getTraversalObj(xmlData,options);
76-
var jsonObj = fastXmlParser.convertToJson(tObj);
77+
var jsonObj = fastXmlParser.convertToJson(tObj,options);
7778

7879
```
7980
**OPTIONS** :
@@ -102,7 +103,8 @@ To use it **on webpage**
102103

103104
1. Download and include [parser.js](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/lib/parser.js)
104105
```js
105-
var isValid = parser.validate(xmlData);
106+
var result = parser.validate(xmlData);
107+
if(result !== true) cnosole.log(result.err);
106108
var jsonObj = parser.parse(xmlData);
107109
```
108110

@@ -141,7 +143,7 @@ Installation of such libraries fails on some OS. You may require to install miss
141143

142144
# Changes from v3
143145

144-
* It can handle big file now. Performance report is given above.
146+
* It can handle big file now (I have tested up to 98mb). Performance report is given above.
145147
* Meaningful error messages from validator
146148

147149
```
@@ -154,8 +156,9 @@ Installation of such libraries fails on some OS. You may require to install miss
154156
* Updated options : check snippet aboove
155157
* Parse boolean values as well. E.g. `"true"` to `true`
156158
* You can set pasrer not to *trim* whitespaces from attribute or tag /node value.
157-
* Tag / node and attribute value is by default HTML decoded. However CDATA value will not be decoded.
159+
* You can set pasrer to HTML decode Tag / node and attribute values. However CDATA value will not be HTML decoded.
158160
* Tag / node value will not be parsed if CDATA presents.
161+
* You can set validator and parser to allow boolean values.
159162
* Few validation and parsing bugs are also fixed
160163

161164

0 commit comments

Comments
 (0)