This is my XML file:
<?xml version="1.0" encoding="utf-8"?>
<sets>
<set name="default">
<phpClass name="ArrayIterator" />
</set>
<set name="production" basedOn="default">
<phpVersion>
<min>5.3.0</min>
</phpVersion>
</set>
</sets>
I have to get all items(set) and assign for example phpClass from default (or another) from XML, where sets are connected with basedOn. There is much more main sets (set with diffarent name) and a lot of sets with basedOn. This must be dynamically on more websites, I do not know all names and basedOn-s, so it will be dynamically script.
This is PHP what I have now (for testing):
$this->xml = simplexml_load_file($file);
print_r($this->xml->xpath("//sets/set[contains(name, 'default')]"));
But I get this: Array ( )
Any ideas? Maybe I am not much clear, so ask when you don't understand something.