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
It would be nice if fast-xml-parser will not exit after the first detected error.
2. Justification
It’s standard default behavior for checkers/linters/validators. I use near 30 checkers/linters/validators, and they all not to exit after the first error.
Users may want to see all errors at once without the need to re-run the validator after correcting a single error.
Unfortunately, fast-xml-parser hasn’t supported glob patterns to run validator recursively for multiple files, so I use fd:
# [NOTE] Running commands from npm packages on Windows:# https://github.com/sharkdp/fd/issues/1474
fd --print0 --extension xml | xargs --null fxparser -V
3.3. Behavior
3.3.1. Desired — xmllint
xmllint exits after validating all files and prints all 6 errors:
D:\SashaDebugging\KiraFastXMLParser>fd --print0 --extension xml | xargs --null xmllint --noout --pedantic
./KiraXMLFirst.xml:3: parser error : Opening and ending tag mismatch: first line 3 and firs
<first>Goddess!</firs>
^
./KiraXMLFirst.xml:4: parser error : Opening and ending tag mismatch: second line 4 and secon
<second>Ideal!</secon>
^
./KiraXMLFirst.xml:5: parser error : Opening and ending tag mismatch: third line 5 and thir
<third>Greatest!</thir>
^
./KiraXMLSecond.xml:3: parser error : Opening and ending tag mismatch: fourth line 3 and fourt
<fourth>Amazing!</fourt>
^
./KiraXMLSecond.xml:4: parser error : Opening and ending tag mismatch: fifth line 4 and fift
<fifth>Unbelievable!</fift>
^
./KiraXMLSecond.xml:5: parser error : Opening and ending tag mismatch: sixth line 5 and sixt
<sixth>Genius!</sixt>
^
3.3.2. Non-desired — fast-xml-parser
fast-xml-parser exits after the first detected error:
D:\SashaDebugging\KiraFastXMLParser>fd--print0--extensionxml|xargs--nullfxparser-V{err: {code: 'InvalidTag',msg: "Expected closing tag 'fourth' (opened in line 3, col 2) instead of closing tag 'fourt'.",line: 3,col: 18}}
Thanks.
The text was updated successfully, but these errors were encountered:
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.
1. Summary
It would be nice if fast-xml-parser will not exit after the first detected error.
2. Justification
It’s standard default behavior for checkers/linters/validators. I use near 30 checkers/linters/validators, and they all not to exit after the first error.
Users may want to see all errors at once without the need to re-run the validator after correcting a single error.
3. MCVE
3.1. Files
KiraXMLFirst.xml
:KiraXMLSecond.xml
:3.2. Command
Unfortunately, fast-xml-parser hasn’t supported glob patterns to run validator recursively for multiple files, so I use fd:
3.3. Behavior
3.3.1. Desired — xmllint
xmllint exits after validating all files and prints all 6 errors:
3.3.2. Non-desired — fast-xml-parser
fast-xml-parser exits after the first detected error:
Thanks.
The text was updated successfully, but these errors were encountered: