the PHP die() function, HTTP packets, and Mozilla and XML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terence

    the PHP die() function, HTTP packets, and Mozilla and XML

    I'm writing an XML application at the moment and I'm trying to implement
    exception handling - particularly fatal exceptions.

    currently if a fatal exception is raised, I create error data in XML
    format and then send the well-formed XML result document to the user
    agent. I'm also careful to set the mime type to text/xml or
    application/xml (I'm not sure how/if browsers treat them differently)
    Immediately after sending this XML document to the browser, I call the
    die() function to terminate script execution and make sure nothing is
    sent after the end of the XML document. This helps to ensure that the
    document is well-formed when the user agent finishes loading it.

    This works a treat in IE. IE would display errors if it was not well-formed.

    In mozilla (netscape7, firebird, etc.) I get blank (grey) window content
    area. When viewing the source, I see a well-formed XML document. If I
    don't use the die() function, then Mozilla renders it properly. Are
    there any special requirements for how HTTP messages are terminated?
    Could this be what die() is breaking?

Working...