Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AoU-Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AoU
AoU-Backend
Merge requests
!663
Update marc2pivot.xsl: traitement des codes FNS et meilleur traitement de la pagination
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update marc2pivot.xsl: traitement des codes FNS et meilleur traitement de la pagination
jbc-new-xsl
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Jean-Blaise Claivaz
requested to merge
jbc-new-xsl
into
master
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
version 1
8e215df2
2 years ago
master (base)
and
latest version
latest version
9166e330
1 commit,
2 years ago
version 1
8e215df2
1 commit,
2 years ago
1 file
+
54
−
20
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
AoU-Model/src/main/resources/xslt/marc2pivot.xsl
+
54
−
20
Options
@@ -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
selec
t=
"marc:datafield[@tag='020']"
>
<isbn><xsl:value-of
select=
"marc:subfield[@code='a']"
/></isbn>
</xsl:f
or-each
>
<xsl:
for-each
selec
t=
"marc:datafield[@tag='022']"
>
<issn><xsl:value-of
select=
"marc:subfield[@code='a']"
/></issn>
</xsl:f
or-each
>
<xsl:
if
tes
t=
"marc:datafield[@tag='020']"
>
<isbn><xsl:value-of
select=
"marc:
datafield[@tag='020']/marc:
subfield[@code='a']"
/></isbn>
</xsl:
i
f>
<xsl:
if
tes
t=
"marc:datafield[@tag='022']"
>
<issn><xsl:value-of
select=
"marc:
datafield[@tag='022']/marc:
subfield[@code='a']"
/></issn>
</xsl:
i
f>
<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