0

I'm getting errors like

XML error: Undeclared entity error

When using xml_parse.

Is there an option to simply suppress these errors so that the XML parser can chug along?

If you need some example XML, here it is:

<schema id="foo">
    <var id="client_note_list">[CONCAT_OLD],&path_common_config;/pages/client_lists.xml</var>
</schema>

&path_common_config; isn't defined anywhere. I don't have an exhaustive list of entities that might exist either, so I can't prepend <!ENTITY either.

3
  • Not an interface I've used, but in other options (SimpleXML/DOMDocument) you can try libxml_use_internal_errors with true. Commented Aug 8, 2018 at 18:36
  • @NigelRen I think that just suppresses the errors from being outputted, but doesn't allow the XML parser to continue. Commented Aug 8, 2018 at 20:13
  • @NigelRen Can you even do it with SimpleXML? I found this but they're all hacks. Commented Aug 8, 2018 at 20:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.