XML parser doesn't flag errors for <?xml ...?> in wrong places
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=5466
Reported by Jonas Wallden jonasw@roxen.com
When the XML parser encounters a directive in unexpected places (i.e. not at the very beginning of the document modulo BOM) it is handled incorrectly:
-
It is accepted in violiation of the spec (§2.6, http://www.w3.org/TR/REC-xml/#sec-pi).
-
The comment in compat_allow_errors() says Pike treats it as a normal PI when using the strictest setting.
-
The parser callback is invoked with the "<?xml" type and not the "<?" type, thus flagging is as a real XML header and failing in the misguided intention to identify it as a PI.