Skip to content
Snippets Groups Projects

Update marc2pivot.xsl: traitement des codes FNS et meilleur traitement de la pagination

Merged Jean-Blaise Claivaz requested to merge jbc-new-xsl into master
1 file
+ 54
20
Compare changes
  • Side-by-side
  • Inline
@@ -5,12 +5,12 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Convert MARCXML records into AoU pivot format with schema v2.5
Convert MARCXML records into AoU pivot format with schema v2.4
Pay attention to:
- tag <resId/> for <academic_structure/> is always empty because info doesn't exist in MARCXML
- tag <resId/> for <group/> may be empty because info doesn't exist in MARCXML for non UNIGE groups
- empty attribute xmlns="" is sometimes created for the tag <classification/> as in <classification xmlns="">
- empty attribute xmlns="" is sometimes created as in <classification xmlns="">
- empty tag <datasets/> is created when no dataset exists in MARCXML
- no information regarding files are retrieved (access level, licence, number of files, links...)
@@ -22,6 +22,8 @@
- MARC 700$8 discarded
- MARC 710 discarded if $a = Collaboration
- MARC 856 discarded if $3 != Alternate edition or Dataset
- MARC 300 is cleaned with removal of " p."
- SNSF codes are reduced to their second part only
-->
@@ -286,12 +288,10 @@
<!-- **** PAGES **** -->
<!-- **** ***** **** -->
<xsl:choose>
<xsl:when test="$view = 'diplome' or $view = 'rapport' or $subview = 'actes' or $subview = 'livre' or $subview = 'livre_collectif'">
<xsl:if test="marc:datafield[@tag='300']">
<pages>
<paging><xsl:value-of select="marc:datafield[@tag='300']/marc:subfield[@code='a']"/></paging>
</pages>
</xsl:if>
<xsl:when test="marc:datafield[@tag='300']">
<pages>
<paging><xsl:value-of select="translate(marc:datafield[@tag='300']/marc:subfield[@code='a'],' p.','')"/></paging>
</pages>
</xsl:when>
<xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='p'] != ''">
<pages>
@@ -312,12 +312,12 @@
<!-- **** *********** **** -->
<xsl:if test="marc:datafield[@tag='020'] or marc:datafield[@tag='022'] or marc:datafield[@tag='024'] or marc:datafield[@tag='088'] or marc:datafield[@tag='502'] or marc:datafield[@tag='856']/marc:subfield[@code='3'] = 'URN'">
<identifiers>
<xsl:for-each select="marc:datafield[@tag='020']">
<isbn><xsl:value-of select="marc:subfield[@code='a']"/></isbn>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='022']">
<issn><xsl:value-of select="marc:subfield[@code='a']"/></issn>
</xsl:for-each>
<xsl:if test="marc:datafield[@tag='020']">
<isbn><xsl:value-of select="marc:datafield[@tag='020']/marc:subfield[@code='a']"/></isbn>
</xsl:if>
<xsl:if test="marc:datafield[@tag='022']">
<issn><xsl:value-of select="marc:datafield[@tag='022']/marc:subfield[@code='a']"/></issn>
</xsl:if>
<xsl:for-each select="marc:datafield[@tag='024']">
<xsl:if test="marc:subfield[@code='2'] = 'DOI'">
<doi><xsl:value-of select="marc:subfield[@code='a']"/></doi>
@@ -553,11 +553,29 @@
<xsl:value-of select="marc:subfield[@code='n']"/>
</name>
</xsl:if>
<xsl:if test="marc:subfield[@code='c']">
<code>
<xsl:value-of select="marc:subfield[@code='c']"/>
</code>
</xsl:if>
<xsl:choose>
<xsl:when test="marc:subfield[@code='c'] and marc:subfield[@code='f'] = 'Swiss National Science Foundation'">
<xsl:choose>
<xsl:when test="contains(marc:subfield[@code='c'],'-')">
<xsl:call-template name="extraitFNS">
<xsl:with-param name="codeFNS" select="substring-after(translate(marc:subfield[@code='c'],'_','-'),'-')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<code>
<xsl:value-of select="marc:subfield[@code='c']"/>
</code>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="marc:subfield[@code='c']">
<code>
<xsl:value-of select="marc:subfield[@code='c']"/>
</code>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="marc:subfield[@code='a']">
<acronym>
<xsl:value-of select="marc:subfield[@code='a']"/>
@@ -824,5 +842,21 @@
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<!-- Pour ne conserver que les 5 ou 6 derniers chiffres du code -->
<xsl:template name="extraitFNS">
<xsl:param name="codeFNS"/>
<xsl:choose>
<xsl:when test="contains($codeFNS,'-')">
<xsl:call-template name="extraitFNS">
<xsl:with-param name="codeFNS" select="substring-after($codeFNS,'-')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<code>
<xsl:value-of select="$codeFNS"/>
</code>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Loading