loadXML($row[data])) { Throw new Exception(__FILE__." : could not load xml."); } $xp = new DOMXPath($tmp); $nodeList = $xp->query("/gmd:MD_Metadata/gmd:hierarchyLevel/gmd:MD_ScopeCode"); if($nodeList != null AND $nodeList->length >= 1) { $node = $nodeList->item(0); $type = $node->getAttribute("codeListValue"); if(empty($type)) { $type = $node->nodeValue; } unset($node); } unset($tmp,$xp,$nodeList); // GET TYPE END $filename = ""; switch($type) { case "service" : $filename = "metadata_service.json"; break; case "application" : $filename = "metadata_application.json"; break; default : $filename = "metadata_data.json"; } $metadataPrint = new MetadataPrint($row['data'],$pathJson.$filename); // LOAD TEMPLATE CLASS AND SET PATH $template = new Template($pathTemplates); $template->load("indexMetadata.tpl"); $template->params(array( "body" => $metadataPrint->drawHtml() )); echo $template->draw(); exit; } } die("invalid id"); ?>