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

Parse XML files without xml declaration #12

Open
wilzbach opened this issue Jan 28, 2018 · 1 comment
Open

Parse XML files without xml declaration #12

wilzbach opened this issue Jan 28, 2018 · 1 comment

Comments

@wilzbach
Copy link
Member

From @Ingrater on November 2, 2016 15:40

First off: Awesome project. Please keep going and get it merged into phobos!

In the wild its quite common to have files which use xml syntax but don't have a xml declaration:

It should be easy to parse such files. My current workaround is to manually stick a xml declaration to the front of the buffer before parsing it.

Copied from original issue: lodo1995/experimental.xml#36

@wilzbach
Copy link
Member Author

From @lodo1995 on November 2, 2016 17:13

Thank you for your appreciation. I'm currently very busy, but I'm trying to find some time to go ahead with this project, because it really deserves to be pushed.

You should be able to set a custom error handler when creating the cursor. Inside this handler, you can decide to ignore errors triggered by missing XML declarations, while throwing an exception (or doing whatever you want) in case of any other problem.

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

1 participant