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

Save valid XML #40

Open
Geograph-us opened this issue Mar 30, 2022 · 3 comments
Open

Save valid XML #40

Geograph-us opened this issue Mar 30, 2022 · 3 comments

Comments

@Geograph-us
Copy link

XmlParser can open invalid or broken XML-files.
Is it possible to save it as valid XML-file?

@KirillOsenkov
Copy link
Owner

not currently, I imagine one would need logic to write missing tokens and skip skipped tokens

@michael-hawker
Copy link
Contributor

michael-hawker commented Jan 30, 2024

A while back I was trying to figure out how to use the API for this scenario as well: https://github.com/michael-hawker/XmlSyntaxVisualizerUWP/blob/e8f28aa8487a69627b25c8d76a8230d1f5270e7a/XmlParserHelpers.cs

Didn't realize the tree was immutable at first, so was only getting part of it back; though my approach is working better here than remember. Seems like I may want to look for valid trees within the invalid one to re-attach higher to save more 'valid' content.

@KirillOsenkov any tips/advice for easier APIs/approaches with the existing API set would be great.

@KirillOsenkov
Copy link
Owner

Unfortunately I don't have much to offer you, if you have looked at this you probably already know more than me about this!

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

No branches or pull requests

3 participants