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 #36

Open
Ingrater opened this issue Nov 2, 2016 · 2 comments
Open

Parse XML files without xml declaration #36

Ingrater opened this issue Nov 2, 2016 · 2 comments

Comments

@Ingrater
Copy link

Ingrater commented Nov 2, 2016

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.

@lodo1995
Copy link
Owner

lodo1995 commented Nov 2, 2016

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.

@wilzbach
Copy link

This issue was moved to dlang-community/experimental.xml#12

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