Skip to content

Instantly share code, notes, and snippets.

@tts
Created June 3, 2012 10:01
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 tts/2862877 to your computer and use it in GitHub Desktop.
Save tts/2862877 to your computer and use it in GitHub Desktop.
Selection of MARC fields from Vaski library consortia open bibliographic data
<xsl:stylesheet xmlns:marc="info:lc/xmlns/marcxchange-v1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="marc" version="1.0">
<xsl:output encoding="UTF-8" indent="yes" method="xml"/>
<!--
Selection of MARC fields from
Vaski library consortia open bibliographic data
http://data.kirjastot.fi/data.html
Lisenssi: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Tuija Sonkkila 31.5.2012
-->
<xsl:template match="/">
<xsl:apply-templates select="marc:collection/marc:record"/>
</xsl:template>
<xsl:template match="marc:record">
<book>
<isbn>
<xsl:value-of select="marc:datafield[@tag='021']/
marc:subfield[@code='a']"/>
</isbn>
<lang>
<xsl:value-of select="marc:datafield[@tag='041']/
marc:subfield[@code='a']"/>
</lang>
<year>
<xsl:value-of select="marc:datafield[@tag='260']/
marc:subfield[@code='c']"/>
</year>
<pages>
<xsl:value-of select="marc:datafield[@tag='300']/
marc:subfield[@code='a']"/>
</pages>
<size>
<xsl:value-of select="marc:datafield[@tag='300']/
marc:subfield[@code='c']"/>
</size>
<cat>
<xsl:value-of select="marc:datafield[@tag='098']/
marc:subfield[@code='a']"/>
</cat>
</book>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment