Hi, can anyone show me the best way to make this code compatible with DOM in PHP5. The error seems to stem from domxml_xmltree. It worked with PHP4, and i've been trying (with no success) to get it working with PHP5. I even tried a compatiblity wrapper which did nothing. Cheers 
Code:
<?
$file = $_SERVER["DOCUMENT_ROOT"]."/include/regex.xml";
if (!($fp = fopen($file, "r")))
{
die("could not open XML input");
}
$data = fread($fp, filesize($file));
fclose($fp);
$aXMLParams = array();
$oTmp = domxml_xmltree($data);
$aSections = $oTmp->children[0]->children;
foreach ($aSections as $k=>$v)
{
if($v->type == 1)
{
$aXMLParams[$v->attributes[0]->value] = array();
$aItems = $v->children;
foreach ($aItems as $kk=>$vv)
{
if($vv->type == 1)
{
$aItemProps = $vv->children;
foreach ($aItemProps as $kkk=>$vvv)
{
if($vvv->type == 1)
{
if ($vvv->tagname == "name")
{
$name = $vvv->children[0]->content;
}
else
{
$aNewItemProps[$vvv->tagname] = $vvv->children[0]->content;
}
}
}
$aXMLParams[$v->attributes[0]->value][$name] = $aNewItemProps;
}
}
}
}
?>
Bookmarks