Skip to content

Instantly share code, notes, and snippets.

@exlcodeshare
Created January 21, 2016 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exlcodeshare/7446154deeca4c19c330 to your computer and use it in GitHub Desktop.
Save exlcodeshare/7446154deeca4c19c330 to your computer and use it in GitHub Desktop.
XSL to transform Rosetta IE records for Primo harvesting
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dnx="http://www.exlibrisgroup.com/dps/dnx">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<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" xmlns:dcterms="http://purl.org/dc/terms/">
<xsl:if test="//dc:record">
<xsl:copy-of select="//dc:record/*/."/>
</xsl:if>
<xsl:for-each select="//dnx:section[@id='Collection']/dnx:record">
<dcterms:isPartOf xsi:type="collection">
<xsl:value-of select="dnx:key[@id='collectionId']"/>
</dcterms:isPartOf>
</xsl:for-each>
</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