regis loumont - 2012-08-21 15:53:11
Hello
great package thank you. As I am still using an old web server I found your very usefull work. I am a bit stuck when trying to parse one level of the following file http://www.honda.fr/car/content/data/dms/gamme_fh.xml.
when using this code:
$details = array(); // init array for return values
$sx = new simplexml;
$sx->ignore_level=1;
$feed = $sx->xml_load_file($filename,"array");
foreach ($feed as $modeleinfo)
{if ($modeleinfo[ModelName] == $modele)
{
foreach ($modeleinfo[Version] as $versioninfo)
{
if ($versioninfo[VersionDescription] == $version)
{
foreach ($versioninfo[VersionsRefs][VersionRef] as $versionreference)
{
$minech = $minech.$versionreference[Mine].",";
$mineref = $versionreference[Mine];
}
...
if the level VersionRef contains only one set of elements (MTO and Mine) then the instruction foreach does not return the correct value in $mineref, while it does if there are multiple elements.
I have used your code to display the whole file as you can try in http://www.honda.fr/wshonda/calltest.php
and it works fine.
Any idea?
thank you for your help and the nice work which was very usefull
Regards
Regis