I try to figure out, how to extract an dropdownlist of the following xml data via simplexml.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reference:reference xmlns:resource="http://services.mobile.de/schema/resource" xmlns:ad="http://services.mobile.de/schema/ad" xmlns:seller="http://services.mobile.de/schema/seller" xmlns:financing="http://services.mobile.de/schema/common/financing-1.0" xmlns:reference="http://services.mobile.de/schema/reference">
<reference:item key="ABARTH" url="http://services.mobile.de/1.0.0/refdata/classes/Car/makes/ABARTH">
<resource:local-description xml-lang="en">Abarth</resource:local-description>
</reference:item>
<reference:item key="AC" url="http://services.mobile.de/1.0.0/refdata/classes/Car/makes/AC">
<resource:local-description xml-lang="en">AC</resource:local-description>
</reference:item>
I need the HTML like this:
<select>
<option value=„reference:item->key“>resource:local-description</option>
</select>
Everything I try ends up in a fatal php error. My suggestion is, that the - in local-description prevents the code to run correctly.
i. e. this code:
$properties = $content->children('reference', TRUE)->item->children('resource', TRUE);
echo $properties->local-description;
Has somebody some hints for me?