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.

mpen
  • 272,448
  • 266
  • 850
  • 1,236
  • Not an interface I've used, but in other options (SimpleXML/DOMDocument) you can try [libxml_use_internal_errors](http://php.net/manual/en/function.libxml-use-internal-errors.php) with true. – Nigel Ren Aug 08 '18 at 18:36
  • @NigelRen I think that just suppresses the errors from being outputted, but doesn't allow the XML parser to continue. – mpen Aug 08 '18 at 20:13
  • @NigelRen Can you even do it with SimpleXML? I found [this](https://stackoverflow.com/q/3805050/65387) but they're all hacks. – mpen Aug 08 '18 at 20:32

0 Answers0