Posted by Janwillem Borleffs on 07/18/07 20:17
bleen wrote:
> I'm trying to use SimpleXML but I've run into a conundrum. Every day
> an XML file is generated that this script grabs and manipulates. How
> can I check that the XML has no problems before creating my
> SimpleXMLelement object.
>
SimpleXMLElement throws an exception when the XML is invalid:
try {
$xml = new SimpleXMLElement(.....);
} catch (Exception $e) {
// Unparseable XML
}
JW
[Back to original message]
|