Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid XML declarations allowed #641

Open
wt opened this issue Sep 2, 2023 · 3 comments
Open

Invalid XML declarations allowed #641

wt opened this issue Sep 2, 2023 · 3 comments

Comments

@wt
Copy link
Contributor

wt commented Sep 2, 2023

The parser allows XML declarations anywhere in the file. If a declaration exists it should be at the very beginning of the file.

Also, only one declaration should be allowed.

Both of these constraints are not currently enforced.

More info on the validity of xml declarations is here.

@Mingun
Copy link
Collaborator

Mingun commented Sep 2, 2023

I think, this is by desing, but we can have a setting to enforce checks, and definitely should have this checks for serde deserializer

@wt
Copy link
Contributor Author

wt commented Sep 3, 2023

It would also be useful to have a Reader/NSReader capable of enforcing such a thing for when I know there is only one document in a file/str source.

@Mingun
Copy link
Collaborator

Mingun commented Sep 3, 2023

Yeah, I say exactly this -- add a setting to enforce this behavior

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

No branches or pull requests

2 participants