Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
XSL to transform Rosetta collection records for Primo harvesting
<?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
You can’t perform that action at this time.