Hello all,
I am trying to parse an XML posted to a website. The xml data is posted via a hidden input field.
I observed a strange behaviour of the php xml parser. If the XML contains:
<?xml version="1.0"?>
<!DOCTYPE chapter SYSTEM "/just/a/test.dtd" [
<!ENTITY plainEntity "FOO entity">
<!ENTITY systemEntity SYSTEM "xmltest2.xml">
]>
The parser throws error "XML error: syntax error at line 1". If the same xml is read from a file (with the xml and doctype tags), the parser works fine.
Can anyone tell me how to get rid of this error when we pass the xml through an input field.