Multiple roots support for XML parsing#796
Open
Vatsalsoni13 wants to merge 3 commits intoNaturalIntelligence:masterfrom
Open
Multiple roots support for XML parsing#796Vatsalsoni13 wants to merge 3 commits intoNaturalIntelligence:masterfrom
Vatsalsoni13 wants to merge 3 commits intoNaturalIntelligence:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose / Goal
Multiple roots parsing support
Summary
Added a validation check in the XML parser to detect the presence of multiple root elements (i.e., more than one top-level node). If multiple roots are found, the parser reports the names of those root elements.
Changes Introduced
Observations(Not related to above changes directly)
The existing validate function in validator.js already attempts to detect multiple roots. However, it does not cover all cases:
<ABC/><TEST/>is not caught by validate<ABC/><TEST>is caught under multiple rootsI have added the check in the parser only and not in validate function. This can also be added but i understand that the validate function isn't taking any options.
Fixes #754
Test results
Before
After
Type
Please mention the type of PR
Note : Please ensure that you've read contribution guidelines before raising this PR. If your PR is in progress, please prepend
[WIP]in PR title. Your PR will be reviewed when[WIP]will be removed from the PR title.Bookmark this repository for further updates.