-
Notifications
You must be signed in to change notification settings - Fork 78
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
Ignore XML validation errors on read #141
Comments
Hi @petri4kov . I'm not 100% sure if this is possible. Of course I would first recommend to try to fix the source xml, instead of the reader. Strict = good =) Can you tell me more about the error you're getting? |
Hi @evert, Unfortunately for me fixing the xml file is not an option - we've got an internal system that reads this specific form of invalid xml, and will throw another kind of errors if I try my hand at fixing it :/ Otherwise, in the opening tag of the document, I've got an attribute called My viable option here is to somehow tell the Reader class to ignore the validity of the xml file if possible. Best, |
As an alternative, could you manually change the first line before parsing it?
…On July 3, 2018 10:13:55 AM PDT, Kostadin Petrichkov ***@***.***> wrote:
Hi @evert,
Unfortunately for me fixing the xml file is not an option - we've got
an internal system that reads this specific form of invalid xml, and
will throw another kind of errors if I try my hand at fixing it :/
Otherwise, in the opening tag of the document, I've got an attribute
called
`ss:disableBackButton="1"`
Sabre XML says that `ss` has not been defined as a namespace, and is
correct. But this is the way the internal system was tailored to work
and I can't change it.
My viable option here is to somehow tell the Reader class to ignore the
validity of the xml file if possible.
Either way, I had a look at the Reader class in the sabrexml source,
but if I override it now, with the next update it will go back to its
original state.
Best,
Kostadin
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#141 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Um, do you mean the first line of the xml file? This is how the start of the xml looks:
|
Hi guys!
I was thinking of using the sabre xml parser for a project, and downloaded it and included it in the project, but when I tried parsing my xml file, it turned out validation errors are stopping it of getting it parsed.
Now, my xml file is a custom one, and I'm aware it works, and even if it's not valid by standard I need it looking that exact way.
So my question is, can I give the Service class a parameter to ignore errors, as I would in SimpleXML? Like that:
simplexml_load_file(file, "SimpleXMLElement", LIBXML_NOERROR | LIBXML_ERR_NONE);
Sorry if the question is dumb :)
Thank you in advance for the help!
Best,
Kostadin
The text was updated successfully, but these errors were encountered: