An XSLT file which converts OAI-PMH to XHTML has been developed as part of the EPrints project. This may be useful to OAI implementers not using the EPrints software.
What it does
It makes an OAI-PMH XML viewed in a modern web browser appear as a nice HTML page, not just raw XML. You can still view the source to see the original XML.
How it works
You add a single line to the top of the OAI-PMH XML, just after the XML declaration. This tells the web browser to use the XSLT style sheet.
<?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type='text/xsl' href='/oai2.xsl' ?>
Warning: The XSL file must be on the same domain as the OAI request is served from (you can't just link to our copy). This is due to the security model (I think), but is slightly annoying.
It even creates useful links to common OAI queries, such as Identify, ListIdentifiers etc. Also, oai identifiers have a button next to them to call the GetRecord method etc.
What does it look like?
For a live example have a look at the Cogprints OAI-PMH v2.0 interface.
How do I add it to EPrints?
Remember, it can be used in other OAI tools tool.
Easy option; just wait for the next version of eprints...
To use it in the current version of eprints:
- Save the file to /opt/eprints2/archives/myarchiveid/cfg/static/general/oai2.xsl
- Run generate_static myarchiveid
- Edit /opt/eprints2/cgi/oai2 and add the xml-stylesheet directive shown above to the bit where it prints the xml version="1.0"
Where can I get it?
Download the latest xsl file from http://software.eprints.org/files/xslt/
We suggest you rename the file to remove the version number, as if we later provide a new version to add features or fix bugs, it should be copied over the old.
I don't like your style! Can I change it?
If you want to modify the XSL file, go ahead, it's provided under the GPL. If you want to include it in some software under a license other than the GPL please contact us.





