I'm parsing an xml document using simplexml and I'm receiving an error which I just can't find solution to despite a lot of searching and reading.
These are the first few line of my xml document
<?xml version="1.0" encoding="utf-8"?>
<MD_Metadata xmlns="http://www.isotc211.org/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd">
<fileIdentifier>
<gcoCharacterString>beemsa5e1453e-8f0f-429c-85b3-e307cc4a065d</gcoCharacterString>
</fileIdentifier>
All I am trying to do to start with is echo out the beemsa5e1453e-8f0f-429c-85b3-e307cc4a065d in the gcoCharacterString
My code so far has been
$importxml = simplexml_load_string($xml_file);
echo $fileIdentifier = $importxml->MD_Metadata->fileIdentifier->gcoCharacterString;
But this gives the error
Notice: Trying to get property of non-object in C:\Program Files\Apache Group\Apache2\htdocs\display_xml.php on line 14
Thanks for any help and suggestions.