diff --git a/index.php b/index.php index 31985da..a20fc4c 100644 --- a/index.php +++ b/index.php @@ -108,7 +108,7 @@ $oai2 = new OAI2Server( 'ListMetadataFormats' => function($identifier = '') { global $config, $records; - if (!empty($identifier) { + if (!empty($identifier)) { $formats = array(); foreach($records as $format => $record) { if (!empty($record[$identifier])) { diff --git a/oai2transform.xsl b/oai2transform.xsl index f268889..0180e6e 100644 --- a/oai2transform.xsl +++ b/oai2transform.xsl @@ -252,7 +252,7 @@ p.intro { ListIdentifiers --> - + @@ -265,7 +265,7 @@ p.intro {

This is a list of metadata formats available for the record "". Use these links to view the metadata:

-

This is a list of metadata formats available from this repository. Click on a format's prefix to get all available records' identifier.

+

This is a list of metadata formats available from this repository. Click on a format's prefix to get all available records' identifiers.

diff --git a/oai2xml.php b/oai2xml.php index 1f13789..e12e282 100644 --- a/oai2xml.php +++ b/oai2xml.php @@ -25,9 +25,13 @@ class OAI2XMLResponse { public $doc; // DOMDocument. Handle of current XML Document object public function __construct($uri, $verb, $request_args) { + if (substr($uri, -1, 1) == '/') { + $stylesheet = $uri.'oai2transform.xsl'; + } else { + $stylesheet = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://' : 'http://'; + $stylesheet .= $_SERVER['HTTP_HOST'].pathinfo(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), PATHINFO_DIRNAME).'/oai2transform.xsl'; + } $this->verb = $verb; - $stylesheet = $_SERVER['HTTP_HOST'].pathinfo(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), PATHINFO_DIRNAME).'/oai2transform.xsl'; - $stylesheet = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://'.$stylesheet : 'http://'.$stylesheet; $this->doc = new DOMDocument('1.0', 'UTF-8'); $this->doc->appendChild($this->doc->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="'.$stylesheet.'"')); $oai_node = $this->doc->createElement('OAI-PMH');