NaturalIntelligence / NaturalIntelligence/fast-xml-validator
Validation of multiple root elements
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Description
The parser accepts inputs that have multiple XML root nodes, without raising an error. This is despite enabling the validator option "-v".
An XML document is expected to have one root element.
Input
<abc/><abc/>
There are two elements at the root level, which I expected to raise an error. The input is saved in a file named example.xml.
Code
./src/cli/cli.js -v example.xml
Output
{ abc: [ '', '' ] }
My question is: Why the XML validator doesn't throw an error?
Please note that xmllint rejects the input example as invalid.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running ./src/cli/cli.js -v example.xml with the two-root-element input described in the issue. Trace how the validator option is handled by the CLI and parser, then verify that multiple root nodes are rejected as invalid while a single-root XML document remains accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100