5) {$processor = new XSLTProcessor; $xsl = new DOMDocument;} if($ID_Schema == 1) { if ($version > 5) { $xsl->load('../input/XSLT/en_ABCD1.2_Summary.xslt');} else {$xsl = file_get_contents('../input/XSLT/en_ABCD1.2_Summary_php4.xslt');} } if($ID_Schema == 2) { if ($version > 5) { $xsl->load('../input/XSLT/en_ABCD2.0_Summary.xslt');} else {$xsl = file_get_contents('../input/XSLT/en_ABCD2.0_Summary_php4.xslt');} } if($ID_Schema == 3 OR $ID_Schema == 6) { if ($version > 5) { $xsl->load('../input/XSLT/en_DarwinCore_UnitDetail.xslt');} else {$xsl = file_get_contents('../input/XSLT/en_DarwinCore_UnitDetail.xslt');} } if($ID_Schema == 4) { if ($version > 5) { $xsl->load('../input/XSLT/en_ABCD2.05_Summary.xslt');} else {$xsl = file_get_contents('../input/XSLT/en_ABCD2.05_Summary_php4.xslt');} } $inf = parse_url($Provider); $host = $inf['host']; $path = $inf['path']; if (isset($inf['query'])) $path .= '?'.$inf['query']; if (isset($inf['port'])) $port = $inf['port']; else $port = 80; if($Provider) { error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE); $fp = fsockopen($host, $port, $errno, $error, 5); if(!$fp or !$host) { echo "Connection failed! Please contact your administrator."; } if($fp and $host) { if($searchform != "true") { if($ID_Schema == 3) { $file1 = $Provider.$QueryPart1.$Digir_Resource1.$QueryPart1_1.$Digir_Source1."%3C%2Fdestination%3E%0A%09%09%3Ctype%3Esearch%3C%2Ftype%3E%0A%09%09%3C%2Fheader%3E%0A%09%09%3Csearch%3E%0A%09%09%3Cfilter%3E+%3Cequals%3E+%3Cdarwin%3ACatalogNumberText%3E".$SpecimenNumber."%3C%2Fdarwin%3ACatalogNumberText%3E+%3C%2Fequals%3E+%3C%2Ffilter%3E%0A%09%09%3Crecords++start%3D%220%22+limit%3D%2210%22%3E%0A%09%09%3Cstructure+schemaLocation%3D%22http%3A%2F%2Fsearch.biocase.org%2Feurope%2Fstatic%2FdarwinObis.xsd%22%2F%3E%0A%09%09%3C%2Frecords%3E%0A%09%09%3Ccount%3Efalse%3C%2Fcount%3E%0A%09%09%3C%2Fsearch%3E%0A%09%09%3C%2Frequest%3E"; $file2 = $Provider.$QueryPart1.$Digir_Resource1.$QueryPart1_1.$Digir_Source1."%3C%2Fdestination%3E%0A%09%09%3Ctype%3Esearch%3C%2Ftype%3E%0A%09%09%3C%2Fheader%3E%0A%09%09%3Csearch%3E%0A%09%09%3Cfilter%3E+%3Cequals%3E+%3Cdarwin%3ACatalogNumber%3E".$SpecimenNumber."%3C%2Fdarwin%3ACatalogNumber%3E+%3C%2Fequals%3E+%3C%2Ffilter%3E%0A%09%09%3Crecords++start%3D%220%22+limit%3D%2210%22%3E%0A%09%09%3Cstructure+schemaLocation%3D%22http%3A%2F%2Fsearch.biocase.org%2Feurope%2Fstatic%2FdarwinObis.xsd%22%2F%3E%0A%09%09%3C%2Frecords%3E%0A%09%09%3Ccount%3Efalse%3C%2Fcount%3E%0A%09%09%3C%2Fsearch%3E%0A%09%09%3C%2Frequest%3E"; $xml = new DOMDocument; $xml->load($file1); $CatNoText = $xml->getElementsByTagName('CatalogNumberText'); if($CatNoText->item(0)->nodeValue == $SpecimenNumber) { $processor->setParameter('', 'formSpecimenNumber', $formSpecimenNumber); $processor->importStyleSheet($xsl); $xml1 = new DOMDocument; $xml1->load($file1); $html = $processor->transformToXML($xml1); echo utf8_decode($html); } if($CatNoText->item(0)->nodeValue != $SpecimenNumber) { $processor->setParameter('', 'formSpecimenNumber', $formSpecimenNumber); $processor->importStyleSheet($xsl); $xml2 = new DOMDocument; $xml2->load($file2); $html = $processor->transformToXML($xml2); echo utf8_decode($html); } } if($ID_Schema != 3) { $file = $Provider.$QueryPart1.$Digir_Resource1.$QueryPart1_1.$Digir_Source1.$QueryPart1_2.$SpecimenNumber.$QueryPart2; $processor->setParameter('', 'searchform', ''); $processor->setParameter('', 'formSpecimenNumber', $formSpecimenNumber); $processor->importStyleSheet($xsl); $xml3 = new DOMDocument; $xml3->load($file); $html = $processor->transformToXML($xml3); echo utf8_decode($html); } } //if($searchform != "true") if($searchform == "true") { if($ID_Schema == 3 and $CatalogNoText == "True") { $file = $Provider.$QueryPart1b.$Digir_Resource1.$QueryPart1_1.$Digir_Source1.$QueryPart1_2b."CatalogNumberText%3E".$SourceUnitID."%3C%2Fdarwin%3ACatalogNumberText".$QueryPart3.$SourceInstitutionCode.$QueryPart4.$SourceCode.$QueryPart5; } if($ID_Schema == 3 and $CatalogNoText != "True") { $file = $Provider.$QueryPart1b.$Digir_Resource1.$QueryPart1_1.$Digir_Source1.$QueryPart1_2b."Cata logNumber%3E".$SourceUnitID."%3C%2Fdarwin%3ACatalogNumber".$QueryPart3.$SourceInstitutionCode.$QueryPart4.$SourceCode.$QueryPart5; } else { $file = $Provider.$QueryPart1b.$Digir_Resource1.$QueryPart1_1.$Digir_Source1.$QueryPart1_2b.$SourceUnitID.$QueryPart3.$SourceInstitutionCode.$QueryPart4.$SourceCode.$QueryPart5; $processor->importStyleSheet($xsl); $processor->setParameter('', 'searchform', 'searchform'); $xml3 = new DOMDocument; $xml3->load($file); $html = $processor->transformToXML($xml3); echo utf8_decode($html); } } //if($searchform == "true") } } ?>