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

Allow to suppress '<' validation for attribute values when error suppression is enabled #6

Closed
kasthack opened this issue Jul 30, 2019 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@kasthack
Copy link
Contributor

kasthack commented Jul 30, 2019

New Feature Proposal

Description

Allow to bypass opening bracket validation when XmlParserOptions.IsSuppressingErrors is set to true. Just a single-line change

Background

Provide any additional background for the feature. e.g., user scenarios.

Parsing technically malformed XML-elements that contain opening diamond brackets in attributes.

  • This is a somewhat known issue
  • '<' handling is buried deep in .net's built-in System.Xml.XmlReader, so invalid documents can't be parsed without writing a substantial amount of code.
  • Correcting the input on the fly basically requires writing an own tokenizer which seems quite excessive for something as simple as ignoring an opening bracket that should be escaped.
  • Documentation for XmlParserOptions.IsSuppressingErrors explicitly states, that enabling this option may break the document and it's disabled by default anyway, so changing this behavior won't be an unpleasant surprise for the users.

Currently, trying to parse <condition value="a < b" /> would raise an exception even if error suppression is enabled. Proposed change would allow to successfully parse it.

@FlorianRappl FlorianRappl added enhancement New feature or request good first issue Good for newcomers labels Jul 31, 2019
@FlorianRappl FlorianRappl added this to the v0.13 milestone Jul 31, 2019
@FlorianRappl
Copy link
Contributor

Sounds great. Could you make the PR @kasthack ? Then we could fit it in 0.13!

Thanks a lot 🍻!

@FlorianRappl
Copy link
Contributor

Landed in devel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants