Skip to content

Commit

Permalink
[AG] update package details
Browse files Browse the repository at this point in the history
  • Loading branch information
amitguptagwl committed Nov 24, 2019
1 parent 79abaa5 commit 179fbd2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ var tObj = parser.getTraversalObj(xmlData,options);
var jsonObj = parser.convertToJson(tObj,options);

```
You can pass `true` or validation option as 3rd parameter to validate along with parsing which is same as above example.
As you can notice in above code, validator is not embeded with in the parser and expected to be called separately. However, you can pass `true` or validation options as 3rd parameter to the parser to trigger validator internally. It is same as above example.

```js
try{
Expand All @@ -161,6 +161,18 @@ try{
}
```

Validator reurns the following object in case of error;
```js
{
err: {
code: code,
msg: message,
line: lineNumber,
},
};
```


#### Note: [he](https://www.npmjs.com/package/he) library is used in this example

<details>
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
3.15.0 / 2019-11-23
* validaor: improve error messaging
* validator: add line number in case of error
* validator: add more error scenarios to make it more descriptive

3.14.0 / 2019-10-25
* arrayMode for XML to JS obj parsing

Expand Down
15 changes: 10 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fast-xml-parser",
"version": "3.14.0",
"version": "3.15.0",
"description": "Validate XML or Parse XML to JS/JSON very fast without C/C++ based libraries",
"main": "./src/parser.js",
"scripts": {
Expand Down

0 comments on commit 179fbd2

Please sign in to comment.