Revision 59437
Added by Alessia Bardi over 3 years ago
xslt_cleaning_datarepo_datacite.xml | ||
---|---|---|
4 | 4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
5 | 5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
6 | 6 |
<RESOURCE_URI value=""/> |
7 |
<DATE_OF_CREATION value="2019-05-22T07:57:37+00:00"/>
|
|
7 |
<DATE_OF_CREATION value="2020-09-19T18:24:53+00:00"/>
|
|
8 | 8 |
</HEADER> |
9 | 9 |
<BODY> |
10 | 10 |
<CONFIGURATION> |
11 | 11 |
<IMPORTED/> |
12 | 12 |
<SCRIPT> |
13 | 13 |
<TITLE>xslt_cleaning_datarepo_datacite</TITLE> |
14 |
<CODE> |
|
15 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" |
|
16 |
xmlns:oaf="http://namespace.openaire.eu/oaf" |
|
17 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
18 |
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" |
|
19 |
extension-element-prefixes="TransformationFunction" |
|
20 |
exclude-result-prefixes="TransformationFunction"> |
|
14 |
<CODE><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" |
|
15 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
16 |
xmlns:oaf="http://namespace.openaire.eu/oaf" |
|
17 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
18 |
xmlns:oai="http://www.openarchives.org/OAI/2.0/" |
|
19 |
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" |
|
20 |
extension-element-prefixes="TransformationFunction" |
|
21 |
exclude-result-prefixes="TransformationFunction"> |
|
21 | 22 |
|
22 |
<xsl:param name="varOfficialName"/>
|
|
23 |
<xsl:param name="varDsType"/>
|
|
24 |
<xsl:param name="varDataSourceId"/>
|
|
23 |
<xsl:param name="varOfficialName" />
|
|
24 |
<xsl:param name="varDsType" />
|
|
25 |
<xsl:param name="varDataSourceId" />
|
|
25 | 26 |
|
26 |
<xsl:param name="varFP7" select="'corda_______::'"/>
|
|
27 |
<xsl:param name="varH2020" select="'corda__h2020::'"/>
|
|
28 |
<xsl:param name="varAKA" select="'aka_________::'"/>
|
|
29 |
<xsl:param name="varARC" select="'arc_________::'"/>
|
|
30 |
<xsl:param name="varCONICYT" select="'conicytf____::'"/>
|
|
31 |
<xsl:param name="varDFG" select="'dfgf________::'"/>
|
|
32 |
<xsl:param name="varFCT" select="'fct_________::'"/>
|
|
33 |
<xsl:param name="varFWF" select="'fwf_________::'"/>
|
|
34 |
<xsl:param name="varHRZZ" select="'irb_hr______::'"/>
|
|
35 |
<xsl:param name="varMESTD" select="'mestd_______::'"/>
|
|
36 |
<xsl:param name="varMZOS" select="'irb_hr______::'"/>
|
|
37 |
<xsl:param name="varNHMRC" select="'nhmrc_______::'"/>
|
|
38 |
<xsl:param name="varNIH" select="'nih_________::'"/>
|
|
39 |
<xsl:param name="varNSF" select="'nsf_________::'"/>
|
|
40 |
<xsl:param name="varNWO" select="'nwo_________::'"/>
|
|
41 |
<xsl:param name="varRCUK" select="'rcuk________::'"/>
|
|
42 |
<xsl:param name="varSFI" select="'sfi_________::'"/>
|
|
43 |
<xsl:param name="varSGOV" select="'sgov________::'"/>
|
|
44 |
<xsl:param name="varSNSF" select="'snsf________::'"/>
|
|
45 |
<xsl:param name="varTARA" select="'taraexp_____::'"/>
|
|
46 |
<xsl:param name="varTUBITAK" select="'tubitakf____::'"/>
|
|
47 |
<xsl:param name="varWT" select="'wt__________::'"/>
|
|
27 |
<xsl:param name="varFP7" select = "'corda_______::'"/>
|
|
28 |
<xsl:param name="varH2020" select = "'corda__h2020::'"/>
|
|
29 |
<xsl:param name="varAKA" select = "'aka_________::'"/>
|
|
30 |
<xsl:param name="varARC" select = "'arc_________::'"/>
|
|
31 |
<xsl:param name="varCONICYT" select = "'conicytf____::'"/>
|
|
32 |
<xsl:param name="varDFG" select = "'dfgf________::'"/>
|
|
33 |
<xsl:param name="varFCT" select = "'fct_________::'"/>
|
|
34 |
<xsl:param name="varFWF" select = "'fwf_________::'"/>
|
|
35 |
<xsl:param name="varHRZZ" select = "'irb_hr______::'"/> <!-- HRZZ not found -->
|
|
36 |
<xsl:param name="varMESTD" select = "'mestd_______::'"/>
|
|
37 |
<xsl:param name="varMZOS" select = "'irb_hr______::'"/>
|
|
38 |
<xsl:param name="varNHMRC" select = "'nhmrc_______::'"/>
|
|
39 |
<xsl:param name="varNIH" select = "'nih_________::'"/>
|
|
40 |
<xsl:param name="varNSF" select = "'nsf_________::'"/>
|
|
41 |
<xsl:param name="varNWO" select = "'nwo_________::'"/>
|
|
42 |
<xsl:param name="varRCUK" select = "'rcuk________::'"/>
|
|
43 |
<xsl:param name="varSFI" select ="'sfi_________::'"/>
|
|
44 |
<xsl:param name="varSGOV" select = "'sgov________::'"/> <!-- SGOV to be added, awaiting DOI from Pilar, found project ids not in CSV list? -->
|
|
45 |
<xsl:param name="varSNSF" select = "'snsf________::'"/>
|
|
46 |
<xsl:param name="varTARA" select = "'taraexp_____::'"/> <!-- TARA to be added, awaiting DOI from André -->
|
|
47 |
<xsl:param name="varTUBITAK" select = "'tubitakf____::'"/>
|
|
48 |
<xsl:param name="varWT" select = "'wt__________::'"/>
|
|
48 | 49 |
|
49 |
<!-- |
|
50 |
// HRZZ not found |
|
51 |
// SGOV to be added, awaiting DOI from Pilar, found project ids not in CSV list? |
|
52 |
// TARA to be added, awaiting DOI from André |
|
53 |
--> |
|
50 |
<xsl:param name="index" select="0"/> |
|
51 |
<xsl:param name="transDate" select="current-dateTime()"/> |
|
52 |
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/> |
|
54 | 53 |
|
55 |
<xsl:param name="index" select="0"/> |
|
56 |
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/> |
|
57 | 54 |
|
55 |
<xsl:template match="/"> |
|
56 |
<xsl:variable name="datasourcePrefix" |
|
57 |
select="normalize-space(//oaf:datasourceprefix)" /> |
|
58 |
<xsl:call-template name="validRecord" /> |
|
59 |
</xsl:template> |
|
58 | 60 |
|
59 |
<xsl:template match="/">
|
|
60 |
<xsl:variable name="datasourcePrefix"
|
|
61 |
select="normalize-space(//oaf:datasourceprefix)"/>
|
|
62 |
<xsl:call-template name="validRecord"/>
|
|
63 |
</xsl:template>
|
|
61 |
<xsl:template name="terminate">
|
|
62 |
<xsl:message terminate="yes">
|
|
63 |
record is not compliant, transformation is interrupted.
|
|
64 |
</xsl:message>
|
|
65 |
</xsl:template> |
|
64 | 66 |
|
65 |
<xsl:template name="terminate"> |
|
66 |
<xsl:message terminate="yes"> |
|
67 |
record is not compliant, transformation is interrupted. |
|
68 |
</xsl:message> |
|
69 |
</xsl:template> |
|
67 |
<xsl:template name="validRecord"> |
|
68 |
<record> |
|
69 |
<xsl:apply-templates select="//*[local-name() = 'header']" /> |
|
70 | 70 |
|
71 |
<xsl:template name="validRecord"> |
|
72 |
<record> |
|
73 |
<xsl:copy-of select="//*[local-name() = 'header']"/> |
|
71 |
<metadata> |
|
74 | 72 |
|
75 |
<metadata>
|
|
73 |
<xsl:apply-templates select="//*[local-name() = 'metadata']//*[local-name() = 'resource']"/>
|
|
76 | 74 |
|
77 |
<xsl:apply-templates select="//*[local-name() = 'metadata']//*[local-name() = 'resource']"/> |
|
75 |
<!-- for CoCoON many deleted records appeared among the transformed records --> |
|
76 |
<xsl:if test="//oai:header/@status='deleted'"> |
|
77 |
<xsl:call-template name="terminate"/> |
|
78 |
</xsl:if> |
|
78 | 79 |
|
80 |
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle'][not(. = '123456789')]"> |
|
81 |
<oaf:identifier> |
|
82 |
<xsl:attribute name="identifierType"> |
|
83 |
<xsl:value-of select="'handle'"/> |
|
84 |
</xsl:attribute> |
|
85 |
<xsl:if test="contains(., '://hdl.handle.net/')"> |
|
86 |
<xsl:value-of select="substring-after(., '://hdl.handle.net/')"/> |
|
87 |
</xsl:if> |
|
88 |
<xsl:if test="not(contains(., '://hdl.handle.net/'))"> |
|
89 |
<xsl:value-of select="."/> |
|
90 |
</xsl:if> |
|
91 |
</oaf:identifier> |
|
92 |
</xsl:for-each> |
|
79 | 93 |
|
80 |
<!-- --> |
|
81 |
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle'][not(. = '123456789')]"> |
|
82 |
<oaf:identifier> |
|
83 |
<xsl:attribute name="identifierType"> |
|
84 |
<xsl:value-of select="'handle'"/> |
|
85 |
</xsl:attribute> |
|
86 |
<xsl:value-of select="."/> |
|
87 |
</oaf:identifier> |
|
88 |
</xsl:for-each> |
|
94 |
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']"> |
|
95 |
<oaf:identifier> |
|
96 |
<xsl:attribute name="identifierType"> |
|
97 |
<xsl:value-of select="'doi'"/> |
|
98 |
</xsl:attribute> |
|
99 |
<!-- |
|
100 |
<xsl:value-of select="."/> |
|
101 |
--> |
|
102 |
<xsl:if test="contains(., '://dx.doi.org/')"> |
|
103 |
<xsl:value-of select="substring-after(., '://dx.doi.org/')"/> |
|
104 |
</xsl:if> |
|
105 |
<xsl:if test="not(contains(., '://dx.doi.org/'))"> |
|
106 |
<xsl:value-of select="."/> |
|
107 |
</xsl:if> |
|
108 |
</oaf:identifier> |
|
109 |
</xsl:for-each> |
|
89 | 110 |
|
90 |
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']">
|
|
91 |
<oaf:identifier>
|
|
92 |
<xsl:attribute name="identifierType">
|
|
93 |
<xsl:value-of select="'doi'"/>
|
|
94 |
</xsl:attribute>
|
|
95 |
<xsl:if test="contains(., '://dx.doi.org/')">
|
|
96 |
<xsl:value-of select="substring-after(., '://dx.doi.org/')"/>
|
|
97 |
</xsl:if>
|
|
98 |
<xsl:if test="not(contains(., '://dx.doi.org/'))">
|
|
99 |
<xsl:value-of select="."/>
|
|
100 |
</xsl:if>
|
|
101 |
</oaf:identifier>
|
|
102 |
</xsl:for-each>
|
|
103 |
<!-- -->
|
|
111 |
<xsl:if test="//*[local-name()='date']/@dateType='Available' and //*[local-name()='datasourceprefix']!='r33ffb097cef'">
|
|
112 |
<xsl:variable name='varEmbargoEndDate'
|
|
113 |
select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='date'][@dateType='Available']), 'DateISO8601')"/>
|
|
114 |
<xsl:choose>
|
|
115 |
<xsl:when test="string-length($varEmbargoEndDate) > 0">
|
|
116 |
<oaf:embargoenddate>
|
|
117 |
<xsl:value-of select="$varEmbargoEndDate"/>
|
|
118 |
</oaf:embargoenddate>
|
|
119 |
</xsl:when>
|
|
120 |
<xsl:otherwise>
|
|
121 |
<xsl:call-template name="terminate"/>
|
|
122 |
</xsl:otherwise>
|
|
123 |
</xsl:choose>
|
|
124 |
</xsl:if>
|
|
104 | 125 |
|
126 |
<!-- |
|
127 |
<xsl:choose> |
|
105 | 128 |
|
106 |
<xsl:if test="//*[local-name()='date']/@dateType='Available' and (//*[local-name()='datasourceprefix']!='od______3691' and //*[local-name()='datasourceprefix']!='r33ffb097cef')"> |
|
107 |
<xsl:variable name='varEmbargoEndDate' |
|
108 |
select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='date'][@dateType='Available']), 'DateISO8601')"/> |
|
109 |
<xsl:choose> |
|
110 |
<xsl:when test="string-length($varEmbargoEndDate) > 0"> |
|
111 |
<oaf:embargoenddate> |
|
112 |
<xsl:value-of select="$varEmbargoEndDate"/> |
|
113 |
</oaf:embargoenddate> |
|
114 |
</xsl:when> |
|
115 |
<xsl:otherwise> |
|
116 |
<xsl:call-template name="terminate"/> |
|
117 |
</xsl:otherwise> |
|
118 |
</xsl:choose> |
|
119 |
</xsl:if> |
|
129 |
or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='software' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='software' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='Film' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='Sound' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='PhysicalObject' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='Audiovisual'"> |
|
130 |
<xsl:when test="lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual')"> |
|
120 | 131 |
|
121 |
<xsl:choose> |
|
122 |
<!-- |
|
123 |
<xsl:when test="//*[local-name()='resourceType']/@resourceTypeGeneral='Dataset' or //*[local-name()='resourceType']/@resourceTypeGeneral='Software' or //*[local-name()='resourceType']/@resourceTypeGeneral='Collection' or //*[local-name()='resourceType']/@resourceTypeGeneral='Film' or //*[local-name()='resourceType']/@resourceTypeGeneral='Sound' or //*[local-name()='resourceType']/@resourceTypeGeneral='PhysicalObject' or //*[local-name()='resourceType']/@resourceTypeGeneral='Audiovisual'"> |
|
124 |
--> |
|
125 |
<!-- |
|
126 |
<xsl:when test="//*[local-name()='resourceType'][lower-case(.)='article'] or lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual', 'model', 'workflow', 'service', 'image') or (//*[local-name()='resourceType'][lower-case(@resourceTypeGeneral)='other' and lower-case(.)='EGI Virtual Appliance'])"> |
|
127 |
--> |
|
128 |
<xsl:when test="//*[local-name()='resourceType'][lower-case(.)='article'] or lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual', 'model', 'workflow', 'service', 'image') or (//*[local-name()='resourceType'][lower-case(./@resourceTypeGeneral)='other' and lower-case(.)=('study', 'egi virtual appliance')])"> |
|
132 |
<xsl:when test="lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual', 'model', 'workflow', 'service', 'image') or //*[local-name()='resourceType'][lower-case(@resourceTypeGeneral)='other' and lower-case(.)=('study', 'research data', 'image', 'photos et images')] or //*[local-name()='resourceType'][lower-case(.)='article'] or (//*[local-name()='resourceType'][lower-case(./@resourceTypeGeneral)='other' and lower-case(.)=('study', 'egi virtual appliance')])"> |
|
129 | 133 |
|
130 |
<!--
|
|
131 |
<dr:CobjCategory>
|
|
132 |
<xsl:value-of
|
|
133 |
select="TransformationFunction:convertString($tf, distinct-values(//*[local-name()='resourceType']/@resourceTypeGeneral), 'TextTypologies')" />
|
|
134 |
</dr:CobjCategory>
|
|
135 |
-->
|
|
134 |
</xsl:when>
|
|
135 |
<xsl:otherwise>
|
|
136 |
<xsl:call-template name="terminate"/>
|
|
137 |
</xsl:otherwise>
|
|
138 |
</xsl:choose>
|
|
139 |
--> |
|
136 | 140 |
|
137 |
<dr:CobjCategory>
|
|
138 |
<xsl:variable name='varCobjCategory' select="TransformationFunction:convertString($tf, distinct-values(//*[local-name()='resourceType']/@resourceTypeGeneral), 'TextTypologies')"/>
|
|
139 |
<xsl:attribute name="type" select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
|
|
140 |
<xsl:value-of select="$varCobjCategory"/>
|
|
141 |
</dr:CobjCategory>
|
|
141 |
<!--
|
|
142 |
<dr:CobjCategory>
|
|
143 |
<xsl:value-of
|
|
144 |
select="TransformationFunction:convertString($tf, distinct-values(//*[local-name()='resourceType']/@resourceTypeGeneral), 'TextTypologies')" />
|
|
145 |
</dr:CobjCategory> |
|
142 | 146 |
|
143 |
</xsl:when> |
|
144 |
<xsl:otherwise> |
|
145 |
<xsl:call-template name="terminate"/> |
|
146 |
</xsl:otherwise> |
|
147 |
</xsl:choose> |
|
147 |
<dr:CobjCategory> |
|
148 |
<xsl:variable name='varCobjCategory' select="TransformationFunction:convertString($tf, distinct-values(//*[local-name()='resourceType']/@resourceTypeGeneral), 'TextTypologies')" /> |
|
149 |
<xsl:attribute name="type" select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/> |
|
150 |
<xsl:value-of select="$varCobjCategory" /> |
|
151 |
</dr:CobjCategory> |
|
152 |
--> |
|
148 | 153 |
|
149 |
<oaf:dateAccepted> |
|
150 |
<xsl:value-of select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='publicationYear']), 'DateISO8601')"/> |
|
151 |
</oaf:dateAccepted> |
|
152 |
<xsl:choose> |
|
153 | 154 |
|
154 |
<!-- |
|
155 |
<xsl:if test="//*[local-name() = 'datasourceprefix'][.='r310e4cd113d'] and not(boolean(//*[local-name() = 'rights']/@rightsURI ) )]"> |
|
156 |
<oaf:skip> |
|
157 |
<xsl:value-of select="TransformationFunction:skipRecord($tf, $index)"/> |
|
158 |
</oaf:skip> |
|
159 |
</xsl:if> |
|
160 |
--> |
|
161 | 155 |
|
162 |
<!-- <xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')]"> |
|
163 |
<oaf:accessrights> |
|
164 |
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"/> |
|
165 |
</oaf:accessrights> |
|
166 |
</xsl:when> |
|
167 |
--> |
|
168 |
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')]"> |
|
169 |
<oaf:accessrights> |
|
170 |
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"/> |
|
171 |
</oaf:accessrights> |
|
172 |
</xsl:when> |
|
156 |
<xsl:variable name='varTypLst' select="distinct-values((//*[local-name()='resourceType']/(., @resourceTypeGeneral)))"/> |
|
157 |
<xsl:variable name='varCobjCatLst' select="distinct-values((for $i in $varTypLst |
|
158 |
return TransformationFunction:convertString($tf, normalize-space($i), 'TextTypologies')))" /> |
|
159 |
<xsl:variable name='varCobjSupLst' select="for $i in $varCobjCatLst |
|
160 |
return concat($i, '###', TransformationFunction:convertString($tf, normalize-space($i), 'SuperTypes'))" /> |
|
173 | 161 |
|
174 |
<xsl:otherwise> |
|
175 |
<xsl:choose> |
|
176 |
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'Creative Commons') or starts-with(normalize-space(.), 'GNU LESSER GENERAL PUBLIC LICENSE')]"> |
|
177 |
<oaf:accessrights> |
|
178 |
<xsl:text>OPEN</xsl:text> |
|
179 |
</oaf:accessrights> |
|
180 |
</xsl:when> |
|
181 |
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'http://opendatacommons.org')]"> |
|
182 |
<oaf:accessrights> |
|
183 |
<xsl:text>OPEN</xsl:text> |
|
184 |
</oaf:accessrights> |
|
185 |
</xsl:when> |
|
186 |
<xsl:otherwise> |
|
187 |
<oaf:accessrights> |
|
188 |
<xsl:text>CLOSED</xsl:text> |
|
189 |
</oaf:accessrights> |
|
190 |
</xsl:otherwise> |
|
191 |
</xsl:choose> |
|
192 |
</xsl:otherwise> |
|
193 |
</xsl:choose> |
|
162 |
<dr:CobjCategory> |
|
163 |
<xsl:choose> |
|
164 |
<xsl:when test="count($varCobjSupLst[not(substring-after(., '###') = 'other') and not(substring-before(., '###') = ('0038', '0039', '0040'))]) > 0"> |
|
165 |
<xsl:variable name='varCobjSup' select="$varCobjSupLst[not(substring-after(., '###') = 'other') and not(substring-before(., '###') = ('0038', '0039', '0040'))][1]" /> |
|
166 |
<xsl:attribute name="type" select="substring-after($varCobjSup, '###')"/> |
|
167 |
<xsl:value-of select="substring-before($varCobjSup, '###')" /> |
|
168 |
</xsl:when> |
|
169 |
<xsl:when test="count($varCobjSupLst[not(substring-after(., '###') = 'other')]) > 0"> |
|
170 |
<xsl:variable name='varCobjSup' select="$varCobjSupLst[not(substring-after(., '###') = 'other')][1]" /> |
|
171 |
<xsl:attribute name="type" select="substring-after($varCobjSup, '###')"/> |
|
172 |
<xsl:value-of select="substring-before($varCobjSup, '###')" /> |
|
173 |
</xsl:when> |
|
174 |
<xsl:when test="count($varCobjSupLst[not(substring-before(., '###') = ('0020', '0000'))]) > 0"> |
|
175 |
<xsl:variable name='varCobjSup' select="$varCobjSupLst[not(substring-before(., '###') = ('0020', '0000'))][1]" /> |
|
176 |
<xsl:attribute name="type" select="substring-after($varCobjSup, '###')"/> |
|
177 |
<xsl:value-of select="substring-before($varCobjSup, '###')" /> |
|
178 |
</xsl:when> |
|
179 |
<xsl:when test="count($varCobjSupLst[not(substring-before(., '###') = ('0000'))]) > 0"> |
|
180 |
<xsl:variable name='varCobjSup' select="$varCobjSupLst[not(substring-before(., '###') = ('0000'))][1]" /> |
|
181 |
<xsl:attribute name="type" select="substring-after($varCobjSup, '###')"/> |
|
182 |
<xsl:value-of select="substring-before($varCobjSup, '###')" /> |
|
183 |
</xsl:when> |
|
184 |
<xsl:otherwise> |
|
185 |
<xsl:attribute name="type" select="'other'"/> |
|
186 |
<xsl:value-of select="'0000'" /> |
|
187 |
</xsl:otherwise> |
|
188 |
</xsl:choose> |
|
189 |
</dr:CobjCategory> |
|
194 | 190 |
|
195 |
<xsl:for-each select="//*[local-name()='rights']/@rightsURI[starts-with(normalize-space(.), 'http') and matches(., '.*(/licenses|/publicdomain|unlicense.org/|/legal-and-data-protection-notices|/download/license|/open-government-licence).*')]"> |
|
196 |
<oaf:license> |
|
197 |
<xsl:value-of select="."/> |
|
198 |
</oaf:license> |
|
199 |
</xsl:for-each> |
|
191 |
<!-- review status --> |
|
192 |
<!-- no review hints found in resource type declarations, no version declarations found --> |
|
193 |
<xsl:variable name="varRefereedConvt" select="for $i in ( |
|
194 |
//*[local-name()='resourceType']/(., @resourceTypeGeneral), //oai:setSpec, //*[local-name()='description']) |
|
195 |
return TransformationFunction:convertString($tf, normalize-space($i), 'ReviewLevels')"/> |
|
196 |
<!-- |
|
197 |
//<xsl:variable name="varRefereedIdntf" select="//*[local-name()=('identifier', 'alternateIdentifier')][matches(lower-case(.), '.*[\s\-\.\\_/:]preprints?[\s\-\.\\_/:].*')]/'0002' "/> |
|
198 |
--> |
|
199 |
<xsl:variable name="varRefereedIdntf" select="( |
|
200 |
//*[local-name()=('identifier', 'alternateIdentifier')][count(//*[local-name()=('metadata', 'resource')]//*[local-name()=('identifier', 'alternateIdentifier')]) = 1][matches(lower-case(.), '(^|.*[\.\-_\\/\s\(\)%\d#:])pre[\.\-_\\/\s\(\)%\d#:]?prints?([\.\-_\\/\s\(\)%\d#:].*)?$')]/'0002', |
|
201 |
//*[local-name()=('identifier', 'alternateIdentifier')][count(//*[local-name()=('metadata', 'resource')]//*[local-name()=('identifier', 'alternateIdentifier')]) = 1][matches(lower-case(.), '(^|.*[\.\-_\\/\s\(\)%\d#:])refereed([\.\-_\\/\s\(\)%\d#:].*)?$')]/'0001', |
|
202 |
//*[local-name()=('identifier', 'alternateIdentifier')][count(//*[local-name()=('metadata', 'resource')]//*[local-name()=('identifier', 'alternateIdentifier')]) = 1][matches(lower-case(.), '.*-peer-reviewed-(fulltext-)?article-.*')]/'0001')"/> |
|
203 |
<xsl:variable name="varRefereedVersn" select="(//*[local-name()='version'][matches(lower-case(.), '.*peer[\s\-\.\\_/:%]?reviewed.*')]/'0001', |
|
204 |
//*[local-name()='version'][matches(normalize-space(lower-case(.)), '^(v|vs|version|rel|release)?[\s\.\-_]*0$')]/'0002', |
|
205 |
//*[local-name()='version'][matches(lower-case(.), '(^|[\s\-\.\\_/:%].*)(beta|draft|trial|test)([\s\-\.\\_/:%].*|$)')]/'0002', |
|
206 |
//*[local-name()='version'][matches(lower-case(.), '.*submi(tted|ssion|ttal).*')]/'0002') "/> |
|
207 |
<xsl:variable name="varRefereedOther" select="(//*[local-name()='publisher'][matches(lower-case(.), '.*[\s\-\.\\_/:%]pre[\s\-\.\\_/:%]?prints?([\s\-\.\\_/:%].*|$)')]/'0002', |
|
208 |
//*[local-name()='description'][matches(lower-case(.), '^peer[\s\-\.\\_/:%]?reviewed$')]/'0001', |
|
209 |
//*[local-name()='description'][matches(lower-case(.), '^pre[\s\-\.\\_/:%]?prints?$')]/'0002') "/> |
|
210 |
<xsl:variable name="varRefereedReltn" select="//*[local-name() = 'relatedIdentifier'][./@relationType/lower-case(.)='isreviewedby']/'0001'"/> |
|
211 |
<xsl:variable name="varRefereedDesct" select="(//*[local-name() = 'description'] |
|
212 |
[matches(lower-case(.), '.*(this\s*book|this\s*volume|it)\s*constitutes\s*the\s*(thoroughly\s*)?refereed') or |
|
213 |
matches(lower-case(.), '.*peer[\.\-_/\s\(\)]?review\s*under\s*responsibility\s*of.*') or |
|
214 |
matches(lower-case(.), '(this|a)\s*(article|preprint)\s*(has\s*been\s*)?(peer[\-\s]*)?reviewed\s*and\s*recommended\s*by\s*peer[\-\s]*community')]/'0001')"/> |
|
215 |
<xsl:variable name="varRefereed" select="($varRefereedConvt, $varRefereedIdntf, $varRefereedReltn, $varRefereedVersn, $varRefereedOther, $varRefereedReltn, $varRefereedDesct)"/> |
|
216 |
<xsl:choose> |
|
217 |
<xsl:when test="count($varRefereed[. = '0001']) > 0"> |
|
218 |
<oaf:refereed> |
|
219 |
<xsl:value-of select="'0001'"/> |
|
220 |
</oaf:refereed> |
|
221 |
</xsl:when> |
|
222 |
<xsl:when test="count($varRefereed[. = '0002']) > 0"> |
|
223 |
<oaf:refereed> |
|
224 |
<xsl:value-of select="'0002'"/> |
|
225 |
</oaf:refereed> |
|
226 |
</xsl:when> |
|
227 |
</xsl:choose> |
|
200 | 228 |
|
201 |
<oaf:language> |
|
202 |
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')"/> |
|
203 |
</oaf:language> |
|
229 |
<oaf:dateAccepted> |
|
230 |
<xsl:value-of select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='publicationYear']), 'DateISO8601')"/> |
|
231 |
</oaf:dateAccepted> |
|
232 |
<xsl:choose> |
|
204 | 233 |
|
205 |
<!--
|
|
206 |
<xsl:if test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics/embargoedAccess')]">
|
|
207 |
<oaf:embargoenddate>
|
|
208 |
<xsl:value-of select="//*[local-name()='date']/@dateType='Available'"/>
|
|
209 |
</oaf:embargoenddate>
|
|
210 |
</xsl:if>
|
|
211 |
-->
|
|
234 |
<!-- |
|
235 |
<xsl:if test="//*[local-name() = 'datasourceprefix'][.='r310e4cd113d'] and not(boolean(//*[local-name() = 'rights']/@rightsURI ) )]">
|
|
236 |
<oaf:skip>
|
|
237 |
<xsl:value-of select="TransformationFunction:skipRecord($tf, $index)"/>
|
|
238 |
</oaf:skip>
|
|
239 |
</xsl:if> |
|
240 |
--> |
|
212 | 241 |
|
213 |
<xsl:for-each select="//*[local-name()='nameIdentifier']"> |
|
214 |
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')"> |
|
215 |
<oaf:projectid> |
|
216 |
<xsl:value-of select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/> |
|
217 |
</oaf:projectid> |
|
218 |
</xsl:if> |
|
219 |
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')"> |
|
220 |
<oaf:projectid> |
|
221 |
<xsl:value-of select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/> |
|
222 |
</oaf:projectid> |
|
223 |
</xsl:if> |
|
224 |
</xsl:for-each> |
|
225 |
<!-- |
|
226 |
<xsl:if test="not(//*[local-name()='nameIdentifier'][starts-with(., 'info:eu-repo/grantAgreement/')])"> |
|
227 |
<xsl:call-template name="terminate"/> |
|
228 |
</xsl:if> |
|
229 |
--> |
|
242 |
<!-- <xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')]"> |
|
243 |
<oaf:accessrights> |
|
244 |
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"/> |
|
245 |
</oaf:accessrights> |
|
246 |
</xsl:when> |
|
247 |
--> |
|
248 |
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')]"> |
|
249 |
<oaf:accessrights> |
|
250 |
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"/> |
|
251 |
</oaf:accessrights> |
|
252 |
</xsl:when> |
|
230 | 253 |
|
231 |
<oaf:hostedBy> |
|
232 |
<xsl:attribute name="name"> |
|
233 |
<xsl:value-of select="$varOfficialName"/> |
|
234 |
</xsl:attribute> |
|
235 |
<xsl:attribute name="id"> |
|
236 |
<xsl:value-of select="$varDataSourceId"/> |
|
237 |
</xsl:attribute> |
|
238 |
</oaf:hostedBy> |
|
239 |
<oaf:collectedFrom> |
|
240 |
<xsl:attribute name="name"> |
|
241 |
<xsl:value-of select="$varOfficialName"/> |
|
242 |
</xsl:attribute> |
|
243 |
<xsl:attribute name="id"> |
|
244 |
<xsl:value-of select="$varDataSourceId"/> |
|
245 |
</xsl:attribute> |
|
246 |
</oaf:collectedFrom> |
|
247 |
</metadata> |
|
248 |
<xsl:copy-of select="//*[local-name() = 'about']"/> |
|
249 |
</record> |
|
250 |
</xsl:template> |
|
254 |
<xsl:otherwise> |
|
255 |
<xsl:choose> |
|
256 |
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'Creative Commons') or starts-with(normalize-space(.), 'GNU LESSER GENERAL PUBLIC LICENSE')]"> |
|
257 |
<oaf:accessrights> |
|
258 |
<xsl:text>OPEN</xsl:text> |
|
259 |
</oaf:accessrights> |
|
260 |
</xsl:when> |
|
261 |
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'http://opendatacommons.org')]"> |
|
262 |
<oaf:accessrights> |
|
263 |
<xsl:text>OPEN</xsl:text> |
|
264 |
</oaf:accessrights> |
|
265 |
</xsl:when> |
|
266 |
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'Open access data at least for academic use')]"> |
|
267 |
<oaf:accessrights> |
|
268 |
<xsl:text>RESTRICTED</xsl:text> |
|
269 |
</oaf:accessrights> |
|
270 |
</xsl:when> |
|
271 |
<xsl:otherwise> |
|
272 |
<oaf:accessrights> |
|
273 |
<xsl:text>UNKNOWN</xsl:text> |
|
274 |
</oaf:accessrights> |
|
275 |
</xsl:otherwise> |
|
276 |
</xsl:choose> |
|
277 |
</xsl:otherwise> |
|
278 |
</xsl:choose> |
|
251 | 279 |
|
252 |
<xsl:template match="node()|@*">
|
|
253 |
<xsl:copy>
|
|
254 |
<xsl:apply-templates select="node()|@*"/>
|
|
255 |
</xsl:copy>
|
|
256 |
</xsl:template>
|
|
280 |
<xsl:for-each select="//*[local-name()='rights']/@rightsURI[starts-with(normalize-space(.), 'http') and matches(., '.*(/licenses|/publicdomain|unlicense.org/|/legal-and-data-protection-notices|/download/license|/open-government-licence).*')]">
|
|
281 |
<oaf:license>
|
|
282 |
<xsl:value-of select="."/>
|
|
283 |
</oaf:license>
|
|
284 |
</xsl:for-each>
|
|
257 | 285 |
|
258 |
<xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']"> |
|
259 |
<xsl:copy> |
|
260 |
<xsl:apply-templates select="node()|@*"/> |
|
261 |
</xsl:copy> |
|
262 |
</xsl:template> |
|
286 |
<oaf:language> |
|
287 |
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" /> |
|
288 |
</oaf:language> |
|
263 | 289 |
|
264 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers']"> |
|
265 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
290 |
<!-- |
|
291 |
<xsl:if test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics/embargoedAccess')]"> |
|
292 |
<oaf:embargoenddate> |
|
293 |
<xsl:value-of select="//*[local-name()='date']/@dateType='Available'"/> |
|
294 |
</oaf:embargoenddate> |
|
295 |
</xsl:if> |
|
296 |
--> |
|
266 | 297 |
|
267 |
<xsl:copy-of select="./*"/> |
|
298 |
<!-- |
|
299 |
<xsl:if test="not(//*[local-name()='nameIdentifier'][starts-with(., 'info:eu-repo/grant')])"> |
|
300 |
<xsl:call-template name="terminate"/> |
|
301 |
</xsl:if> |
|
302 |
--> |
|
268 | 303 |
|
269 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle']"> |
|
270 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
271 |
<xsl:attribute name="alternateIdentifierType"> |
|
272 |
<xsl:value-of select="'URL'"/> |
|
273 |
</xsl:attribute> |
|
274 |
<xsl:value-of |
|
275 |
select="concat('http://hdl.handle.net/', //*[local-name() = 'resource']/*[local-name()='identifier'])"/> |
|
276 |
</xsl:element> |
|
277 |
</xsl:if> |
|
304 |
<xsl:for-each select="//*[local-name()='nameIdentifier']"> |
|
305 |
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')"> |
|
306 |
<oaf:projectid> |
|
307 |
<xsl:value-of select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/> |
|
308 |
</oaf:projectid> |
|
309 |
</xsl:if> |
|
310 |
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')"> |
|
311 |
<oaf:projectid> |
|
312 |
<xsl:value-of select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/> |
|
313 |
</oaf:projectid> |
|
314 |
</xsl:if> |
|
315 |
</xsl:for-each> |
|
278 | 316 |
|
279 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='URN']"> |
|
280 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
281 |
<xsl:attribute name="alternateIdentifierType"> |
|
282 |
<xsl:value-of select="'URL'"/> |
|
283 |
</xsl:attribute> |
|
284 |
<xsl:value-of |
|
285 |
select="concat('http://nbn-resolving.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])"/> |
|
286 |
</xsl:element> |
|
287 |
</xsl:if> |
|
317 |
<oaf:hostedBy> |
|
318 |
<xsl:attribute name="name"> |
|
319 |
<xsl:value-of select="$varOfficialName"/> |
|
320 |
</xsl:attribute> |
|
321 |
<xsl:attribute name="id"> |
|
322 |
<xsl:value-of select="$varDataSourceId"/> |
|
323 |
</xsl:attribute> |
|
324 |
</oaf:hostedBy> |
|
325 |
<oaf:collectedFrom> |
|
326 |
<xsl:attribute name="name"> |
|
327 |
<xsl:value-of select="$varOfficialName"/> |
|
328 |
</xsl:attribute> |
|
329 |
<xsl:attribute name="id"> |
|
330 |
<xsl:value-of select="$varDataSourceId"/> |
|
331 |
</xsl:attribute> |
|
332 |
</oaf:collectedFrom> |
|
333 |
</metadata> |
|
334 |
<xsl:copy-of select="//*[local-name() = 'about']" /> |
|
335 |
</record> |
|
336 |
</xsl:template> |
|
288 | 337 |
|
289 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']">
|
|
290 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
291 |
<xsl:attribute name="alternateIdentifierType">
|
|
292 |
<xsl:value-of select="'URL'"/>
|
|
293 |
</xsl:attribute>
|
|
338 |
<xsl:template match="node()|@*">
|
|
339 |
<xsl:copy>
|
|
340 |
<xsl:apply-templates select="node()|@*"/>
|
|
341 |
</xsl:copy>
|
|
342 |
</xsl:template>
|
|
294 | 343 |
|
295 |
<!-- |
|
296 |
<xsl:value-of |
|
297 |
select="concat('http://dx.doi.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])" /> |
|
298 |
--> |
|
299 |
<xsl:value-of |
|
300 |
select="//*[local-name() = 'resource']/(*[local-name()='identifier'][not(contains(., '://dx.doi.org/'))]/concat('http://dx.doi.org/', .), *[local-name()='identifier'][contains(., '://dx.doi.org/')])"/> |
|
301 |
</xsl:element> |
|
302 |
</xsl:if> |
|
344 |
<xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']"> |
|
345 |
<xsl:copy> |
|
346 |
<xsl:apply-templates select="node()|@*"/> |
|
347 |
</xsl:copy> |
|
348 |
</xsl:template> |
|
303 | 349 |
|
304 |
</xsl:element> |
|
350 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers']"> |
|
351 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
305 | 352 |
|
306 |
</xsl:template>
|
|
353 |
<xsl:copy-of select="./*"/>
|
|
307 | 354 |
|
308 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='identifier']"> |
|
309 |
<!-- cut off DOI resolver prefix to just get the number part --> |
|
310 |
<xsl:if test=".[@identifierType='DOI'][contains(., '://dx.doi.org/')]"> |
|
311 |
<xsl:element name="identifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
312 |
<xsl:attribute name="identifierType"> |
|
313 |
<xsl:value-of select="'DOI'"/> |
|
314 |
</xsl:attribute> |
|
315 |
<xsl:value-of |
|
316 |
select="substring-after(., '://dx.doi.org/')"/> |
|
317 |
</xsl:element> |
|
318 |
</xsl:if> |
|
319 |
<xsl:copy-of select=".[not(contains(., '://dx.doi.org/'))]"/> |
|
320 |
<xsl:if test="not(//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers'])"> |
|
321 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
322 |
<xsl:if test=".[@identifierType='Handle']"> |
|
323 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
324 |
<xsl:attribute name="alternateIdentifierType"> |
|
325 |
<xsl:value-of select="'URL'"/> |
|
326 |
</xsl:attribute> |
|
327 |
<xsl:value-of |
|
328 |
select="concat('http://hdl.handle.net/', .)"/> |
|
329 |
</xsl:element> |
|
330 |
</xsl:if> |
|
331 |
<xsl:if test=".[@identifierType='URN']"> |
|
332 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
333 |
<xsl:attribute name="alternateIdentifierType"> |
|
334 |
<xsl:value-of select="'URL'"/> |
|
335 |
</xsl:attribute> |
|
336 |
<xsl:value-of |
|
337 |
select="concat('http://nbn-resolving.org/', .)"/> |
|
338 |
</xsl:element> |
|
339 |
</xsl:if> |
|
340 |
<xsl:if test=".[@identifierType='DOI']"> |
|
341 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
342 |
<xsl:attribute name="alternateIdentifierType"> |
|
343 |
<xsl:value-of select="'URL'"/> |
|
344 |
</xsl:attribute> |
|
345 |
<xsl:value-of |
|
346 |
select="concat('http://dx.doi.org/', .)"/> |
|
347 |
</xsl:element> |
|
348 |
</xsl:if> |
|
355 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle']"> |
|
356 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
357 |
<xsl:attribute name="alternateIdentifierType"> |
|
358 |
<xsl:value-of select="'URL'"/> |
|
359 |
</xsl:attribute> |
|
360 |
<xsl:value-of |
|
361 |
select="concat('http://hdl.handle.net/', //*[local-name() = 'resource']/*[local-name()='identifier'])" /> |
|
362 |
</xsl:element> |
|
363 |
</xsl:if> |
|
349 | 364 |
|
350 |
</xsl:element> |
|
351 |
</xsl:if> |
|
365 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='URN']"> |
|
366 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
367 |
<xsl:attribute name="alternateIdentifierType"> |
|
368 |
<xsl:value-of select="'URL'"/> |
|
369 |
</xsl:attribute> |
|
370 |
<xsl:value-of |
|
371 |
select="concat('http://nbn-resolving.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])" /> |
|
372 |
</xsl:element> |
|
373 |
</xsl:if> |
|
352 | 374 |
|
375 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']"> |
|
376 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
377 |
<xsl:attribute name="alternateIdentifierType"> |
|
378 |
<xsl:value-of select="'URL'"/> |
|
379 |
</xsl:attribute> |
|
380 |
<!-- |
|
381 |
<xsl:value-of |
|
382 |
select="concat('http://dx.doi.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])" /> |
|
383 |
--> |
|
384 |
<xsl:value-of |
|
385 |
select="//*[local-name() = 'resource']/(*[local-name()='identifier'][not(contains(., '://dx.doi.org/'))]/concat('http://dx.doi.org/', .), *[local-name()='identifier'][contains(., '://dx.doi.org/')])" /> |
|
386 |
</xsl:element> |
|
387 |
</xsl:if> |
|
353 | 388 |
|
354 |
<!-- funding --> |
|
355 |
<xsl:for-each select="//*[local-name()='fundingReference']"> |
|
356 |
<!-- FP7 --> |
|
357 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100004963', '10.13039/100011199') and matches(./*[local-name()='awardNumber'], '.*(^|[^\d])\d\d\d\d\d\d($|[^\d]).*')"> |
|
358 |
<oaf:projectid> |
|
359 |
<xsl:value-of select="concat($varFP7, replace(./*[local-name()='awardNumber'], '.*(^|[^\d])(\d\d\d\d\d\d)($|[^\d]).*', '$2'))"/> |
|
360 |
</oaf:projectid> |
|
361 |
</xsl:if> |
|
362 |
<!-- H2020 --> |
|
363 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100010661') and matches(./*[local-name()='awardNumber'], '.*(^|[^\d])\d\d\d\d\d\d($|[^\d]).*')"> |
|
364 |
<oaf:projectid> |
|
365 |
<xsl:value-of select="concat($varH2020, replace(./*[local-name()='awardNumber'], '.*(^|[^\d])(\d\d\d\d\d\d)($|[^\d]).*', '$2'))"/> |
|
366 |
</oaf:projectid> |
|
367 |
</xsl:if> |
|
368 |
<!-- AKA --> |
|
369 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002341') or contains(./*[local-name()='funderName'], 'Suomen Akatemia') or contains(./*[local-name()='funderName'], 'Academy of Finland')"> |
|
370 |
<oaf:projectid> |
|
371 |
<xsl:value-of select="concat($varAKA, ./*[local-name()='awardNumber'])"/> |
|
372 |
</oaf:projectid> |
|
373 |
</xsl:if> |
|
374 |
<!-- ARC --> |
|
375 |
<xsl:if test="(substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000923') or contains(./*[local-name()='funderName'], 'Australian Research Council')) and matches(./*[local-name()='awardNumber'], '^\d{6}$')"> |
|
376 |
<oaf:projectid> |
|
377 |
<xsl:value-of select="concat($varAKA, replace(./*[local-name()='awardNumber'], '.*(^\d{6}$).*', '$2'))"/> |
|
378 |
</oaf:projectid> |
|
379 |
</xsl:if> |
|
380 |
<!-- CONICYT --> |
|
381 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002848') or contains(./*[local-name()='funderName'], 'Comisión Nacional de Investigación Científica y Tecnológica') or contains(./*[local-name()='funderName'], 'CONICYT')"> |
|
382 |
<oaf:projectid> |
|
383 |
<xsl:value-of select="concat($varCONICYT, ./*[local-name()='awardNumber'])"/> |
|
384 |
</oaf:projectid> |
|
385 |
</xsl:if> |
|
386 |
<!-- DFG --> |
|
387 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001659') or contains(./*[local-name()='funderName'], 'Deutsche Forschungsgemeinschaft') or contains(./*[local-name()='funderName'], 'DFG')"> |
|
388 |
<oaf:projectid> |
|
389 |
<xsl:value-of select="concat($varDFG, ./*[local-name()='awardNumber'])"/> |
|
390 |
</oaf:projectid> |
|
391 |
</xsl:if> |
|
392 |
<!-- FCT --> |
|
393 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001871') or contains(./*[local-name()='funderName'], 'Fundação para a Ciência e a Tecnologia')"> |
|
394 |
<oaf:projectid> |
|
395 |
<xsl:value-of select="concat($varFCT, ./*[local-name()='awardNumber'])"/> |
|
396 |
</oaf:projectid> |
|
397 |
</xsl:if> |
|
398 |
<!-- FWF --> |
|
399 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002428') or contains(./*[local-name()='funderName'], 'Fonds zur Förderung der Wissenschaftlichen Forschung') or contains(./*[local-name()='funderName'], 'Austrian Science Fund')"> |
|
400 |
<oaf:projectid> |
|
401 |
<xsl:value-of select="concat($varFCT, ./*[local-name()='awardNumber'])"/> |
|
402 |
</oaf:projectid> |
|
403 |
</xsl:if> |
|
404 |
<!-- MESTD --> |
|
405 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001871') or (contains(./*[local-name()='funderName'], 'Ministarstvo Prosvete, Nauke i Tehnolo') and contains(./*[local-name()='funderName'], 'kog Razvoja')) or contains(./*[local-name()='funderName'], 'MESTD')"> |
|
406 |
<oaf:projectid> |
|
407 |
<xsl:value-of select="concat($varMESTD, ./*[local-name()='awardNumber'])"/> |
|
408 |
</oaf:projectid> |
|
409 |
</xsl:if> |
|
410 |
<!-- MZOS --> |
|
411 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100006588') or contains(./*[local-name()='funderName'], 'Ministarstvo Znanosti, Obrazovanja i Sporta') or contains(./*[local-name()='funderName'], 'Ministry of Science, Education and Sports')"> |
|
412 |
<oaf:projectid> |
|
413 |
<xsl:value-of select="concat($varMZOS, ./*[local-name()='awardNumber'])"/> |
|
414 |
</oaf:projectid> |
|
415 |
</xsl:if> |
|
416 |
<!-- NHMRC --> |
|
417 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000925') or contains(./*[local-name()='funderName'], 'National Health and Medical Research Council') or contains(./*[local-name()='funderName'], 'NHMRC')"> |
|
418 |
<oaf:projectid> |
|
419 |
<xsl:value-of select="concat($varNHMRC, ./*[local-name()='awardNumber'])"/> |
|
420 |
</oaf:projectid> |
|
421 |
</xsl:if> |
|
422 |
<!-- NIH --> |
|
423 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100000002') or contains(./*[local-name()='funderName'], 'National Institutes of Health')"> |
|
424 |
<oaf:projectid> |
|
425 |
<xsl:value-of select="concat($varNIH, ./*[local-name()='awardNumber'])"/> |
|
426 |
</oaf:projectid> |
|
427 |
</xsl:if> |
|
428 |
<!-- NSF --> |
|
429 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org') = ('10.13039/100000001') or contains(./*[local-name()='funderName'], 'National Science Foundation')"> |
|
430 |
<oaf:projectid> |
|
431 |
<xsl:value-of select="concat($varNSF, ./*[local-name()='awardNumber'])"/> |
|
432 |
</oaf:projectid> |
|
433 |
</xsl:if> |
|
434 |
<!-- NWO --> |
|
435 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100003246') or contains(./*[local-name()='funderName'], 'Netherlands Organisation for Scientific Research') or contains(./*[local-name()='funderName'], 'Nederlandse Organisatie voor Wetenschappelijk Onderzoek')"> |
|
436 |
<oaf:projectid> |
|
437 |
<xsl:value-of select="concat($varNWO, ./*[local-name()='awardNumber'])"/> |
|
438 |
</oaf:projectid> |
|
439 |
</xsl:if> |
|
440 |
<!-- RCUK --> |
|
441 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000690') or contains(./*[local-name()='funderName'], 'Research Councils UK') or contains(./*[local-name()='funderName'], 'RCUK')"> |
|
442 |
<oaf:projectid> |
|
443 |
<xsl:value-of select="concat($varRCUK, ./*[local-name()='awardNumber'])"/> |
|
444 |
</oaf:projectid> |
|
445 |
</xsl:if> |
|
446 |
<!-- SFI --> |
|
447 |
<xsl:if test="(substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001602') or contains(./*[local-name()='funderName'], 'Science Foundation Ireland')) and matches(./*[local-name()='awardNumber'], '.*([\dA-Za-z\.\-]+/)+[\dA-Za-z\.\-]+.*')"> |
|
448 |
<oaf:projectid> |
|
449 |
<xsl:value-of select="concat($varSFI, replace(./*[local-name()='awardNumber'], '.*(^|\s)(([\dA-Za-z\.\-]+/)+[\dA-Za-z\.\-]+)($|\s).*', '$2'))"/> |
|
450 |
</oaf:projectid> |
|
451 |
</xsl:if> |
|
452 |
<!-- SNSF --> |
|
453 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001711') or contains(./*[local-name()='funderName'], 'Swiss National Science Foundation') or contains(./*[local-name()='funderName'], 'Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung')"> |
|
454 |
<oaf:projectid> |
|
455 |
<xsl:value-of select="concat($varSNSF, ./*[local-name()='awardNumber'])"/> |
|
456 |
</oaf:projectid> |
|
457 |
</xsl:if> |
|
458 |
<!-- TUBITAK --> |
|
459 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100004410') or contains(./*[local-name()='funderName'], 'Turkish National Science and Research Council') or (contains(./*[local-name()='funderName'], 'Türkiye Bilimsel ve Teknolojik Ara') and contains(./*[local-name()='funderName'], 'rma Kurumu'))"> |
|
460 |
<oaf:projectid> |
|
461 |
<xsl:value-of select="concat($varTUBITAK, ./*[local-name()='awardNumber'])"/> |
|
462 |
</oaf:projectid> |
|
463 |
</xsl:if> |
|
464 |
<!-- WT --> |
|
465 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100004440') or contains(./*[local-name()='funderName'], 'Wellcome Trust')"> |
|
466 |
<oaf:projectid> |
|
467 |
<xsl:value-of select="concat($varWT, ./*[local-name()='awardNumber'])"/> |
|
468 |
</oaf:projectid> |
|
469 |
</xsl:if> |
|
470 |
</xsl:for-each> |
|
389 |
</xsl:element> |
|
471 | 390 |
|
472 |
</xsl:template>
|
|
391 |
</xsl:template> |
|
473 | 392 |
|
474 |
<!-- |
|
475 |
<xsl:template match="//*[local-name()='language']"> |
|
476 |
<oaf:language> |
|
477 |
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" /> |
|
478 |
</oaf:language> |
|
479 |
</xsl:template> |
|
480 |
--> |
|
481 |
</xsl:stylesheet> |
|
482 |
</CODE> |
|
393 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='identifier']"> |
|
394 |
<!-- cut off DOI resolver prefix to just get the number part --> |
|
395 |
<xsl:if test=".[@identifierType='DOI'][contains(., '://dx.doi.org/')]"> |
|
396 |
<xsl:element name="identifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
397 |
<xsl:attribute name="identifierType"> |
|
398 |
<xsl:value-of select="'DOI'"/> |
|
399 |
</xsl:attribute> |
|
400 |
<xsl:value-of |
|
401 |
select="substring-after(., '://dx.doi.org/')" /> |
|
402 |
</xsl:element> |
|
403 |
</xsl:if> |
|
404 |
<xsl:copy-of select=".[not(contains(., '://dx.doi.org/'))]"/> |
|
405 |
<!-- |
|
406 |
<xsl:copy-of select="."/> |
|
407 |
--> |
|
408 |
<xsl:if test="not(//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers'])"> |
|
409 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
410 |
<xsl:if test=".[@identifierType='Handle']"> |
|
411 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
412 |
<xsl:attribute name="alternateIdentifierType"> |
|
413 |
<xsl:value-of select="'URL'"/> |
|
414 |
</xsl:attribute> |
|
415 |
<xsl:value-of |
|
416 |
select="concat('http://hdl.handle.net/', .)" /> |
|
417 |
</xsl:element> |
|
418 |
</xsl:if> |
|
419 |
<xsl:if test=".[@identifierType='URN']"> |
|
420 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
421 |
<xsl:attribute name="alternateIdentifierType"> |
|
422 |
<xsl:value-of select="'URL'"/> |
|
423 |
</xsl:attribute> |
|
424 |
<xsl:value-of |
|
425 |
select="concat('http://nbn-resolving.org/', .)" /> |
|
426 |
</xsl:element> |
|
427 |
</xsl:if> |
|
428 |
<xsl:if test=".[@identifierType='DOI']"> |
|
429 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
430 |
<xsl:attribute name="alternateIdentifierType"> |
|
431 |
<xsl:value-of select="'URL'"/> |
|
432 |
</xsl:attribute> |
|
433 |
<xsl:value-of |
|
434 |
select="concat('http://dx.doi.org/', .)" /> |
|
435 |
</xsl:element> |
|
436 |
</xsl:if> |
|
437 |
|
|
438 |
</xsl:element> |
|
439 |
</xsl:if> |
|
440 |
|
|
441 |
|
|
442 |
|
|
443 |
<!-- funding --> |
|
444 |
<xsl:for-each select="//*[local-name()='fundingReference']"> |
|
445 |
<!-- FP7 --> |
|
446 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100004963', '10.13039/100011199') and matches(./*[local-name()='awardNumber'], '.*(^|[^\d])\d\d\d\d\d\d($|[^\d]).*')"> |
|
447 |
<oaf:projectid> |
|
448 |
<xsl:value-of select="concat($varFP7, replace(./*[local-name()='awardNumber'], '.*(^|[^\d])(\d\d\d\d\d\d)($|[^\d]).*', '$2'))"/> |
|
449 |
</oaf:projectid> |
|
450 |
</xsl:if> |
|
451 |
<!-- H2020 --> |
|
452 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100010661') and matches(./*[local-name()='awardNumber'], '.*(^|[^\d])\d\d\d\d\d\d($|[^\d]).*')"> |
|
453 |
<oaf:projectid> |
|
454 |
<xsl:value-of select="concat($varH2020, replace(./*[local-name()='awardNumber'], '.*(^|[^\d])(\d\d\d\d\d\d)($|[^\d]).*', '$2'))"/> |
|
455 |
</oaf:projectid> |
|
456 |
</xsl:if> |
|
457 |
<!-- AKA --> |
|
458 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002341') or contains(./*[local-name()='funderName'], 'Suomen Akatemia') or contains(./*[local-name()='funderName'], 'Academy of Finland')"> |
|
459 |
<oaf:projectid> |
|
460 |
<xsl:value-of select="concat($varAKA, ./*[local-name()='awardNumber'])"/> |
|
461 |
</oaf:projectid> |
|
462 |
</xsl:if> |
|
463 |
<!-- ARC --> |
|
464 |
<xsl:if test="(substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000923') or contains(./*[local-name()='funderName'], 'Australian Research Council')) and matches(./*[local-name()='awardNumber'], '^\d{6}$')"> |
|
465 |
<oaf:projectid> |
|
466 |
<xsl:value-of select="concat($varAKA, replace(./*[local-name()='awardNumber'], '.*(^\d{6}$).*', '$2'))"/> |
|
467 |
</oaf:projectid> |
|
468 |
</xsl:if> |
|
469 |
<!-- CONICYT --> |
|
470 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002848') or contains(./*[local-name()='funderName'], 'Comisión Nacional de Investigación Científica y Tecnológica') or contains(./*[local-name()='funderName'], 'CONICYT')"> |
|
471 |
<oaf:projectid> |
|
472 |
<xsl:value-of select="concat($varCONICYT, ./*[local-name()='awardNumber'])"/> |
|
473 |
</oaf:projectid> |
|
474 |
</xsl:if> |
|
475 |
<!-- DFG --> |
|
476 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001659') or contains(./*[local-name()='funderName'], 'Deutsche Forschungsgemeinschaft') or contains(./*[local-name()='funderName'], 'DFG')"> |
|
477 |
<oaf:projectid> |
|
478 |
<xsl:value-of select="concat($varDFG, ./*[local-name()='awardNumber'])"/> |
|
479 |
</oaf:projectid> |
|
480 |
</xsl:if> |
|
481 |
<!-- FCT --> |
|
482 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001871') or contains(./*[local-name()='funderName'], 'Fundação para a Ciência e a Tecnologia')"> |
|
483 |
<oaf:projectid> |
|
484 |
<xsl:value-of select="concat($varFCT, ./*[local-name()='awardNumber'])"/> |
|
485 |
</oaf:projectid> |
|
486 |
</xsl:if> |
|
487 |
<!-- FWF --> |
|
488 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002428') or contains(./*[local-name()='funderName'], 'Fonds zur Förderung der Wissenschaftlichen Forschung') or contains(./*[local-name()='funderName'], 'Austrian Science Fund')"> |
|
489 |
<oaf:projectid> |
|
490 |
<xsl:value-of select="concat($varFCT, ./*[local-name()='awardNumber'])"/> |
|
491 |
</oaf:projectid> |
|
492 |
</xsl:if> |
|
493 |
<!-- MESTD --> |
|
494 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001871') or (contains(./*[local-name()='funderName'], 'Ministarstvo Prosvete, Nauke i Tehnolo') and contains(./*[local-name()='funderName'], 'kog Razvoja')) or contains(./*[local-name()='funderName'], 'MESTD')"> |
|
495 |
<oaf:projectid> |
|
496 |
<xsl:value-of select="concat($varMESTD, ./*[local-name()='awardNumber'])"/> |
|
497 |
</oaf:projectid> |
|
498 |
</xsl:if> |
|
499 |
<!-- MZOS --> |
|
500 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100006588') or contains(./*[local-name()='funderName'], 'Ministarstvo Znanosti, Obrazovanja i Sporta') or contains(./*[local-name()='funderName'], 'Ministry of Science, Education and Sports')"> |
|
501 |
<oaf:projectid> |
|
502 |
<xsl:value-of select="concat($varMZOS, ./*[local-name()='awardNumber'])"/> |
|
503 |
</oaf:projectid> |
|
504 |
</xsl:if> |
|
505 |
<!-- NHMRC --> |
|
506 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000925') or contains(./*[local-name()='funderName'], 'National Health and Medical Research Council') or contains(./*[local-name()='funderName'], 'NHMRC')"> |
|
507 |
<oaf:projectid> |
|
508 |
<xsl:value-of select="concat($varNHMRC, ./*[local-name()='awardNumber'])"/> |
|
509 |
</oaf:projectid> |
|
510 |
</xsl:if> |
|
511 |
<!-- NIH --> |
|
512 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100000002') or contains(./*[local-name()='funderName'], 'National Institutes of Health')"> |
|
513 |
<oaf:projectid> |
|
514 |
<xsl:value-of select="concat($varNIH, ./*[local-name()='awardNumber'])"/> |
|
515 |
</oaf:projectid> |
|
516 |
</xsl:if> |
|
517 |
<!-- NSF --> |
|
518 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org') = ('10.13039/100000001') or contains(./*[local-name()='funderName'], 'National Science Foundation')"> |
|
519 |
<oaf:projectid> |
|
520 |
<xsl:value-of select="concat($varNSF, ./*[local-name()='awardNumber'])"/> |
|
521 |
</oaf:projectid> |
|
522 |
</xsl:if> |
|
523 |
<!-- NWO --> |
|
524 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100003246') or contains(./*[local-name()='funderName'], 'Netherlands Organisation for Scientific Research') or contains(./*[local-name()='funderName'], 'Nederlandse Organisatie voor Wetenschappelijk Onderzoek')"> |
|
525 |
<oaf:projectid> |
|
526 |
<xsl:value-of select="concat($varNWO, ./*[local-name()='awardNumber'])"/> |
|
527 |
</oaf:projectid> |
|
528 |
</xsl:if> |
|
529 |
<!-- RCUK --> |
|
530 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000690') or contains(./*[local-name()='funderName'], 'Research Councils UK') or contains(./*[local-name()='funderName'], 'RCUK')"> |
|
531 |
<oaf:projectid> |
|
532 |
<xsl:value-of select="concat($varRCUK, ./*[local-name()='awardNumber'])"/> |
|
533 |
</oaf:projectid> |
|
534 |
</xsl:if> |
|
535 |
<!-- SFI --> |
|
536 |
<xsl:if test="(substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001602') or contains(./*[local-name()='funderName'], 'Science Foundation Ireland')) and matches(./*[local-name()='awardNumber'], '.*([\dA-Za-z\.\-]+/)+[\dA-Za-z\.\-]+.*')"> |
|
537 |
<oaf:projectid> |
|
538 |
<xsl:value-of select="concat($varSFI, replace(./*[local-name()='awardNumber'], '.*(^|\s)(([\dA-Za-z\.\-]+/)+[\dA-Za-z\.\-]+)($|\s).*', '$2'))"/> |
|
539 |
</oaf:projectid> |
|
540 |
</xsl:if> |
|
541 |
<!-- SNSF --> |
|
542 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001711') or contains(./*[local-name()='funderName'], 'Swiss National Science Foundation') or contains(./*[local-name()='funderName'], 'Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung')"> |
|
543 |
<oaf:projectid> |
|
544 |
<xsl:value-of select="concat($varSNSF, ./*[local-name()='awardNumber'])"/> |
|
545 |
</oaf:projectid> |
|
546 |
</xsl:if> |
|
547 |
<!-- TUBITAK --> |
|
548 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100004410') or contains(./*[local-name()='funderName'], 'Turkish National Science and Research Council') or (contains(./*[local-name()='funderName'], 'Türkiye Bilimsel ve Teknolojik Ara') and contains(./*[local-name()='funderName'], 'rma Kurumu'))"> |
|
549 |
<oaf:projectid> |
|
550 |
<xsl:value-of select="concat($varTUBITAK, ./*[local-name()='awardNumber'])"/> |
|
551 |
</oaf:projectid> |
|
552 |
</xsl:if> |
|
553 |
<!-- WT --> |
|
554 |
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100004440') or contains(./*[local-name()='funderName'], 'Wellcome Trust')"> |
|
555 |
<oaf:projectid> |
|
556 |
<xsl:value-of select="concat($varWT, ./*[local-name()='awardNumber'])"/> |
|
557 |
</oaf:projectid> |
|
558 |
</xsl:if> |
|
559 |
</xsl:for-each> |
|
560 |
|
|
561 |
</xsl:template> |
|
562 |
|
|
563 |
<!-- |
|
564 |
<xsl:template match="//*[local-name()='language']"> |
|
565 |
<oaf:language> |
|
566 |
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" /> |
|
567 |
</oaf:language> |
|
568 |
</xsl:template> |
|
569 |
--> |
|
570 |
|
|
571 |
<xsl:template match="//*[local-name() = 'header']"> |
|
572 |
<xsl:copy> |
|
573 |
<xsl:apply-templates select="node()|@*"/> |
|
574 |
<xsl:element name="dr:dateOfTransformation"> |
|
575 |
<xsl:value-of select="$transDate"/> |
|
576 |
</xsl:element> |
|
577 |
</xsl:copy> |
|
578 |
</xsl:template> |
|
579 |
|
|
580 |
</xsl:stylesheet></CODE> |
|
483 | 581 |
</SCRIPT> |
484 | 582 |
</CONFIGURATION> |
485 | 583 |
<STATUS/> |
Also available in: Unified diff
fix generation of handle in oaf:identifier