Created
January 21, 2016 10:54
-
-
Save exlcodeshare/fa778913c375efae7b2c to your computer and use it in GitHub Desktop.
XSL to transform Rosetta collection records for Primo harvesting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:mets="http://www.loc.gov/METS/" xmlns:dnx="http://www.exlibrisgroup.com/dps/dnx" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml" omit-xml-declaration="yes" indent="no"/> | |
<xsl:template match="/"> | |
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> | |
<xsl:if test="//dc:record"> | |
<xsl:copy-of select="//dc:record/*/."/> | |
</xsl:if> | |
<dc:type>collection</dc:type> | |
<xsl:if test="//dnx:section[@id='Collection']/dnx:record/dnx:key[@id='collectionParentId']"> | |
<dcterms:isPartOf xsi:type="collection"> | |
<xsl:value-of select="//dnx:section[@id='Collection']/dnx:record/dnx:key[@id='collectionParentId']"/> | |
</dcterms:isPartOf> | |
</xsl:if> | |
</oai_dc:dc> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment