Skip to content

Validation of multiple root elements #3

Description

@bendrissou

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions