Ejemplo n.º 1
0
     header('Content-type: text/xml');
     echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">' . "\n" . '<responseDate>' . $date_respons . '</responseDate>' . "\n";
     switch ($oai_verb) {
         case 'ListSets':
             echo $oai_respon_handlers->ListSets();
             break;
         case 'ListIdentifiers':
             $metadataPrefix = isset($_GET['metadataPrefix']) ? $dbs->escape_string(trim($_GET['metadataPrefix'])) : 'oai_dc';
             echo $oai_respon_handlers->ListIdentifiers($metadataPrefix);
             break;
         case 'ListMetadataFormats':
             echo $oai_respon_handlers->ListMetadataFormats();
             break;
         case 'ListRecords':
             $metadataPrefix = isset($_GET['metadataPrefix']) ? $dbs->escape_string(trim($_GET['metadataPrefix'])) : 'oai_dc';
             echo $oai_respon_handlers->ListRecords($metadataPrefix);
             break;
         case 'GetRecord':
             $identifier = isset($_GET['identifier']) ? $dbs->escape_string(trim($_GET['identifier'])) : '0';
             $metadataPrefix = $dbs->escape_string(trim($_GET['metadataPrefix']));
             echo $oai_respon_handlers->GetRecord($identifier, $metadataPrefix);
             break;
         default:
             echo $oai_respon_handlers->Identify();
             break;
     }
     echo '</OAI-PMH>';
 } else {
     // mulai output XML
     header('Content-type: text/xml');
     echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">' . "\n" . '<responseDate>' . $date_respons . '</responseDate>' . "\n";
Ejemplo n.º 2
0
     header('Content-type: text/xml');
     echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">' . "\n" . '<responseDate>' . $date_respons . '</responseDate>' . "\n";
     switch ($oai_verb) {
         case 'ListSets':
             echo $oai_respon_handlers->ListSets();
             break;
         case 'ListIdentifiers':
             $metadataPrefix = isset($_GET['metadataPrefix']) ? $dbs->escape_string(trim($_GET['metadataPrefix'])) : 'oai_dc';
             echo $oai_respon_handlers->ListIdentifiers($metadataPrefix);
             break;
         case 'ListMetadataFormats':
             echo $oai_respon_handlers->ListMetadataFormats();
             break;
         case 'ListRecords':
             $metadataPrefix = isset($_GET['metadataPrefix']) ? $dbs->escape_string(trim($_GET['metadataPrefix'])) : 'oai_dc';
             echo $oai_respon_handlers->ListRecords($_GET['metadataPrefix']);
             break;
         case 'GetRecord':
             $identifier = isset($_GET['identifier']) ? $dbs->escape_string(trim($_GET['identifier'])) : '0';
             $metadataPrefix = $dbs->escape_string(trim($_GET['metadataPrefix']));
             echo $oai_respon_handlers->GetRecord($identifier, $metadataPrefix);
             break;
         default:
             echo $oai_respon_handlers->Identify();
             break;
     }
     echo '</OAI-PMH>';
 } else {
     // mulai output XML
     header('Content-type: text/xml');
     echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">' . "\n" . '<responseDate>' . $date_respons . '</responseDate>' . "\n";