You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/v4/2.XMLparseOptions.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -477,6 +477,62 @@ Output
477
477
}
478
478
```
479
479
480
+
## maxNestedTags
481
+
Though it is not recommended to use deeply nested XML, but if you are using it then you can set `maxNestedTags` option to limit the nesting depth.
482
+
483
+
Eg
484
+
```js
485
+
constxmlDataStr=`
486
+
<root>
487
+
<a>
488
+
<b>
489
+
<c>
490
+
<d>
491
+
<e>
492
+
<f>
493
+
<g>
494
+
<h>
495
+
<i>
496
+
<j>
497
+
<k>
498
+
<l>
499
+
<m>
500
+
<n>
501
+
<o>
502
+
<p>
503
+
<q>
504
+
<r>
505
+
<s/>
506
+
</r>
507
+
</q>
508
+
</p>
509
+
</o>
510
+
</n>
511
+
</m>
512
+
</l>
513
+
</k>
514
+
</j>
515
+
</i>
516
+
</h>
517
+
</g>
518
+
</f>
519
+
</e>
520
+
</d>
521
+
</c>
522
+
</b>
523
+
</a>
524
+
</root>`;
525
+
526
+
constoptions= {
527
+
maxNestedTags:10//default is 100
528
+
};
529
+
constparser=newXMLParser(options);
530
+
constoutput=parser.parse(xmlDataStr);
531
+
```
532
+
Output
533
+
```bash
534
+
Error: Maximum nested tags exceeded
535
+
```
480
536
481
537
## numberParseOptions
482
538
FXP uses [strnum](https://github.com/NaturalIntelligence/strnum) library to parse string into numbers. This property allows you to set configuration for strnum package.
0 commit comments