Project

General

Profile

« Previous | Next » 

Revision 49054

update wf

View differences:

ands.xslt
1 1
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2 2
                xmlns:datetime="http://exslt.org/dates-and-times"
3 3
                xmlns:exslt="http://exslt.org/common" xmlns:oai="http://www.openarchives.org/OAI/2.0/"
4
                xmlns:dri="http://www.driver-repository.eu/namespace/dri"
5
                xmlns:dc="http://purl.org/dc/elements/1.1/"
4 6
                xmlns:dnet="eu.dnetlib.dli.DLIUtils"
5
                xmlns:dc="http://purl.org/dc/elements/1.1/"
6 7
                xmlns:oaf="http://namespace.dnet.eu/oaf"
7
                xmlns:stringutils="org.apache.commons.lang3.StringUtils"
8 8
                version="2.0"
9
                exclude-result-prefixes="xsl datetime exslt dnet stringutils">
9
                exclude-result-prefixes="xsl datetime exslt dnet">
10 10
    <xsl:template match="/">
11
        <xsl:choose>
12
            <xsl:when test="not(//*[local-name()='relatedInfo'])">
13
                <record></record>
14
            </xsl:when>
15
            <xsl:when test="not(//*[local-name()='setSpec' and ./text()='class:collection'])">
16
                <record></record>
17
            </xsl:when>
11
        <xsl:variable name="namespacePrefix" select="//dri:datasourceprefix"/>
12
        <xsl:variable name="pid">
13
            <xsl:value-of
14
                    select="dnet:fixPID(//*[local-name()='source']/*[local-name()='identifier']/*[local-name()='identifier'])"/>
15
        </xsl:variable>
16
        <xsl:variable name="pidType">
17
            <xsl:value-of
18
                    select="dnet:inferPidType(//*[local-name()='source']/*[local-name()='identifier']/*[local-name()='identifier'],//*[local-name()='source']/*[local-name()='identifier']/*[local-name()='schema'])"/>
19
        </xsl:variable>
18 20

  
19 21

  
20
            <xsl:otherwise>
21
                <xsl:variable name="pid">
22
                    <xsl:value-of
23
                            select="concat('https://researchdata.ands.org.au/registry/registry_object/view/',stringutils:substringAfter(//*[local-name()='header']/*[local-name()='recordIdentifier'],'::'))"/>
24
                </xsl:variable>
22
        <xsl:variable name="relatedPid">
23
            <xsl:value-of
24
                    select="dnet:fixPID(//*[local-name()='target']/*[local-name()='identifier']/*[local-name()='identifier'])"/>
25
        </xsl:variable>
26
        <xsl:variable name="relatedPidType">
27
            <xsl:value-of
28
                    select="dnet:inferPidType(//*[local-name()='target']/*[local-name()='identifier']/*[local-name()='identifier'],//*[local-name()='target']/*[local-name()='identifier']/*[local-name()='schema'])"/>
29
        </xsl:variable>
25 30

  
26
                <xsl:variable name="namespacePrefix">
27
                    <xsl:value-of select="//*[local-name()='header']/*[local-name()='datasourceprefix']"/>
28
                </xsl:variable>
29
                <xsl:variable name="datasourceID" select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
30
                <xsl:variable name="datasourceName" select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
31
                <pack>
31
        <xsl:variable name="relation">
32
            <xsl:value-of select="//*[local-name()='relationship']/*[local-name()='name']"/>
33
        </xsl:variable>
34
        <xsl:variable name="inverseRelation">
35
            <xsl:value-of select="//*[local-name()='relationship']/*[local-name()='inverseRelationship']"/>
36
        </xsl:variable>
32 37

  
38
        <xsl:variable name="targetType">
39
            <xsl:choose>
40
                <xsl:when
41
                        test="//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] ='dataset' or //*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type']= 'collection'">
42
                    dataset
43
                </xsl:when>
44
                <xsl:when
45
                        test="//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'literature' or //*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'publication'">
46
                    publication
47
                </xsl:when>
48
                <xsl:otherwise>unknown</xsl:otherwise>
49
            </xsl:choose>
50
        </xsl:variable>
33 51

  
34
                    <oai:record xmlns:dc="http://purl.org/dc/elements/1.1/"
35
                                xmlns:dr="http://www.driver-repository.eu/namespace/dr"
36
                                xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"
37
                                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
52
        <xsl:variable name="sourceType">
53
            <xsl:choose>
54
                <xsl:when
55
                        test="//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] ='dataset' or //*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type']= 'collection'">
56
                    dataset
57
                </xsl:when>
58
                <xsl:when test="//source/objectType/type = 'literature' or //source/objectType/type = 'publication'">
59
                    publication
60
                </xsl:when>
61
                <xsl:otherwise>unknown</xsl:otherwise>
62
            </xsl:choose>
63
        </xsl:variable>
64
        <xsl:variable name="dnetSourceId">
65
            <xsl:value-of
66
                    select="concat($namespacePrefix, '::', dnet:generateIdentifier(concat($pid, '::', $relatedPid), concat($pidType, '::', $relatedPidType)))"/>
67
        </xsl:variable>
68
        <xsl:variable name="dnetTargetId">
69
            <xsl:value-of
70
                    select="concat($namespacePrefix, '::', dnet:generateIdentifier(concat($relatedPid, '::', $pid), concat($relatedPidType, '::', $pidType)))"/>
71
        </xsl:variable>
72
        <pack>
73
            <xsl:choose>
74
                <xsl:when
75
                        test=".//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] = 'dataset' or .//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] = 'collection'">
76
                    <oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
38 77
                                xmlns="http://namespace.openaire.eu/">
39
                        <xsl:copy-of select="//*[local-name()='header']"/>
78
                        <oai:header>
79
                            <dri:objIdentifier>
80
                                <xsl:value-of select="$dnetSourceId"/>
81
                            </dri:objIdentifier>
82
                            <dri:recordIdentifier>
83
                                <xsl:value-of select="concat($pid, '::', $pidType)"/>
84
                            </dri:recordIdentifier>
85
                            <dri:dateOfCollection>
86
                                <xsl:value-of select="//dri:dateOfCollection"/>
87
                            </dri:dateOfCollection>
88
                            <dri:repositoryId>
89
                                <xsl:value-of select="//dri:repositoryId"/>
90
                            </dri:repositoryId>
91
                            <dri:datasourceprefix>
92
                                <xsl:value-of select="$namespacePrefix"/>
93
                            </dri:datasourceprefix>
94
                        </oai:header>
40 95
                        <metadata>
41 96
                            <resource xmlns="http://datacite.org/schema/kernel-3"
42 97
                                      xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
43
                                <identifier identifierType="url">
98
                                <identifier identifierType="{$pidType}">
44 99
                                    <xsl:value-of select="$pid"/>
45 100
                                </identifier>
46 101
                                <titles>
47 102
                                    <xsl:for-each
48
                                            select="//*[local-name()='name' and  ./@type='primary']/*[local-name()='namePart']">
103
                                            select="//*[local-name()='source']/*[local-name()='title']">
49 104
                                        <title>
50 105
                                            <xsl:value-of select="."/>
51 106
                                        </title>
52 107
                                    </xsl:for-each>
53 108
                                </titles>
109
                                <publisher>
110
                                    <xsl:value-of select="//*[local-name()='publisher']/*[local-name()='name']"/>
111
                                </publisher>
54 112
                                <dates>
55
                                    <xsl:for-each select="//*[local-name()='date' and ./@type='dateTo']">
113
                                    <xsl:for-each select="//*[local-name()='source']/*[local-name()='publicationDate']">
56 114
                                        <date dateType="Collected">
57 115
                                            <xsl:value-of select="."/>
58 116
                                        </date>
59 117
                                    </xsl:for-each>
60 118
                                </dates>
119
                                <creators>
120
                                    <xsl:for-each select="//*[local-name()='source']//*[local-name()='creatorName']">
121
                                        <creator>
122
                                            <creatorName>
123
                                                <xsl:value-of select="."/>
124
                                            </creatorName>
125
                                        </creator>
126
                                    </xsl:for-each>
127
                                </creators>
61 128
                                <resourceType resourceTypeGeneral="Dataset">Dataset</resourceType>
62 129
                                <relatedIdentifiers>
63
                                    <xsl:for-each select="//*[local-name()='relatedInfo']">
64
                                        <xsl:if test="count(./*[local-name()='identifier']) &gt; 0">
65

  
66
                                            <xsl:variable name="relTypology">
67
                                                <xsl:choose>
68
                                                    <xsl:when test="./@type = 'publication'">publication</xsl:when>
69
                                                    <xsl:otherwise>unknown</xsl:otherwise>
70
                                                </xsl:choose>
71
                                            </xsl:variable>
72
                                            <xsl:variable name="relatedIdType">
73
                                                <xsl:choose>
74
                                                    <xsl:when test="./@type = 'publication'">dnet</xsl:when>
75
                                                    <xsl:otherwise>
76
                                                        <xsl:value-of select="./*[local-name()='identifier']/@type"/>
77
                                                    </xsl:otherwise>
78
                                                </xsl:choose>
79
                                            </xsl:variable>
80

  
81
                                            <xsl:variable name="relatedId">
82
                                                <xsl:choose>
83
                                                    <xsl:when test="./@type = 'publication'">
84
                                                        <xsl:choose>
85
                                                            <xsl:when
86
                                                                    test="./*[local-name()='identifier' and ./@type='doi']">
87
                                                                <xsl:value-of
88
                                                                        select="concat($namespacePrefix, '::', dnet:generateIdentifier(./*[local-name()='identifier' and ./@type='doi'],'doi'))"/>
89
                                                            </xsl:when>
90
                                                            <xsl:otherwise>
91
                                                                <xsl:value-of
92
                                                                        select="concat($namespacePrefix, '::', dnet:generateIdentifier(./*[local-name()='identifier'][1], ./*[local-name()='identifier'][1]/@type))"/>
93
                                                            </xsl:otherwise>
94
                                                        </xsl:choose>
95
                                                    </xsl:when>
96
                                                    <xsl:otherwise>
97
                                                        <xsl:value-of select="./*[local-name()='identifier']"/>
98
                                                    </xsl:otherwise>
99
                                                </xsl:choose>
100
                                            </xsl:variable>
101

  
102

  
103
                                            <xsl:for-each select=".//*[local-name()='identifier']">
104
                                                <relatedIdentifier xmlns:oaf="http://namespace.dnet.eu/oaf"
105
                                                                   inverseRelationType="unknown" relationType="unknown"
106
                                                                   entityType="{$relTypology}">
107
                                                    <xsl:attribute name="relatedIdentifierType">
108
                                                        <xsl:value-of select="$relatedIdType"/>
109
                                                    </xsl:attribute>
110
                                                    <xsl:value-of select="$relatedId"/>
111
                                                </relatedIdentifier>
112
                                            </xsl:for-each>
113
                                        </xsl:if>
114
                                    </xsl:for-each>
130
                                    <relatedIdentifier xmlns:oaf="http://namespace.dnet.eu/oaf"
131
                                                       inverseRelationType="{$inverseRelation}"
132
                                                       relationType="{$relation}"
133
                                                       entityType="{$targetType}" name="dnet">
134
                                        <xsl:value-of select="$dnetTargetId"/>
135
                                    </relatedIdentifier>
115 136
                                </relatedIdentifiers>
116 137
                            </resource>
117 138
                        </metadata>
......
130 151
                            </oaf:datainfo>
131 152
                        </oaf:about>
132 153
                    </oai:record>
133

  
134

  
135
                    <xsl:for-each select="//*[local-name()='relatedInfo' and ./@type='publication']">
136

  
137
                        <xsl:if test="count(./*[local-name()='identifier']) &gt; 0">
138
                            <xsl:variable name="pidType">
139
                                <xsl:choose>
140
                                    <xsl:when test="count(./*[local-name()='identifier' and ./@type='doi'])">doi
141
                                    </xsl:when>
142
                                    <xsl:otherwise>
143
                                        <xsl:value-of select="./*[local-name()='identifier'][1]/@type"/>
144
                                    </xsl:otherwise>
145
                                </xsl:choose>
146
                            </xsl:variable>
147
                            <xsl:variable name="publicationIdentifier">
148
                                <xsl:choose>
149
                                    <xsl:when test="count(./*[local-name()='identifier' and ./@type='doi'])">
150
                                        <xsl:value-of select="./*[local-name()='identifier' and ./@type='doi']"/>
151
                                    </xsl:when>
152
                                    <xsl:otherwise>
153
                                        <xsl:value-of select="./*[local-name()='identifier'][1]"/>
154
                                    </xsl:otherwise>
155
                                </xsl:choose>
156
                            </xsl:variable>
157
                            <xsl:variable name="objIdentifier">
158
                                <xsl:value-of
159
                                        select="concat($namespacePrefix, '::', dnet:generateIdentifier($publicationIdentifier,$pidType))"/>
160
                            </xsl:variable>
161
                            <oai:record xmlns:oai="http://www.openarchives.org/OAI/2.0/"
162
                                        xmlns:dri="http://www.driver-repository.eu/namespace/dri"
163
                                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
164
                                <oai:header>
165
                                    <dri:objIdentifier>
166
                                        <xsl:value-of select="$objIdentifier"/>
167
                                    </dri:objIdentifier>
168
                                    <dri:recordIdentifier>
169
                                        <xsl:value-of select="$publicationIdentifier"/>
170
                                    </dri:recordIdentifier>
171
                                    <dri:dateOfCollection>
172
                                        <xsl:value-of select="//dri:dateOfCollection"/>
173
                                    </dri:dateOfCollection>
174
                                    <dri:repositoryId>
175
                                        <xsl:value-of select="//dri:repositoryId"/>
176
                                    </dri:repositoryId>
177
                                    <dri:datasourceprefix>
178
                                        <xsl:value-of select="$namespacePrefix"/>
179
                                    </dri:datasourceprefix>
180
                                    <oai:identifier>
181
                                        <xsl:value-of select="$publicationIdentifier"/>
182
                                    </oai:identifier>
183
                                </oai:header>
184
                                <metadata>
185
                                    <oaf:pid type="{$pidType}">
186
                                        <xsl:value-of select="$publicationIdentifier"/>
187
                                    </oaf:pid>
188
                                    <dc:identifier>
189
                                        <xsl:value-of select="$publicationIdentifier"/>
190
                                    </dc:identifier>
191
                                    <xsl:for-each select="./*[local-name()='title']">
192
                                        <dc:title>
154
                </xsl:when>
155
                <xsl:when
156
                        test=".//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] = 'literature' or .//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] = 'publication'">
157
                    <oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
158
                                xmlns="http://namespace.openaire.eu/">
159
                        <oai:header>
160
                            <dri:objIdentifier>
161
                                <xsl:value-of select="$dnetSourceId"/>
162
                            </dri:objIdentifier>
163
                            <dri:recordIdentifier>
164
                                <xsl:value-of select="concat($pid, '::', $pidType)"/>
165
                            </dri:recordIdentifier>
166
                            <dri:dateOfCollection>
167
                                <xsl:value-of select="//dri:dateOfCollection"/>
168
                            </dri:dateOfCollection>
169
                            <dri:repositoryId>
170
                                <xsl:value-of select="//dri:repositoryId"/>
171
                            </dri:repositoryId>
172
                            <dri:datasourceprefix>
173
                                <xsl:value-of select="$namespacePrefix"/>
174
                            </dri:datasourceprefix>
175
                        </oai:header>
176
                        <metadata>
177
                            <oaf:pid type="{$pidType}">
178
                                <xsl:value-of select="$pid"/>
179
                            </oaf:pid>
180
                            <dc:identifier>
181
                                <xsl:value-of select="$pid"/>
182
                            </dc:identifier>
183
                            <dc:title>
184
                                <xsl:value-of select="//*[local-name()='source']/*[local-name()='title']"/>
185
                            </dc:title>
186
                            <xsl:for-each select="//*[local-name()='source']//*[local-name()='creatorName']">
187
                                <dc:creator>
188
                                    <xsl:value-of select="."/>
189
                                </dc:creator>
190
                            </xsl:for-each>
191
                            <dc:type>publication</dc:type>
192
                            <oaf:relatedIdentifier inverseRelationType="{$inverseRelation}" relationType="{$relation}"
193
                                                   entityType="{$targetType}" name="dnet">
194
                                <xsl:value-of select="$dnetTargetId"/>
195
                            </oaf:relatedIdentifier>
196
                        </metadata>
197
                        <oaf:about>
198
                            <oaf:datainfo>
199
                                <oaf:collectedFrom completionStatus="complete">
200
                                    <xsl:attribute name="id">
201
                                        <xsl:value-of select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
202
                                    </xsl:attribute>
203
                                    <xsl:attribute name="name">
204
                                        <xsl:value-of select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
205
                                    </xsl:attribute>
206
                                </oaf:collectedFrom>
207
                                <oaf:completionStatus>complete</oaf:completionStatus>
208
                                <oaf:provisionMode>collected</oaf:provisionMode>
209
                            </oaf:datainfo>
210
                        </oaf:about>
211
                    </oai:record>
212
                </xsl:when>
213
            </xsl:choose>
214
            <xsl:choose>
215
                <xsl:when
216
                        test="//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'literature' or //*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'publication'">
217
                    <oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
218
                                xmlns="http://namespace.openaire.eu/">
219
                        <oai:header>
220
                            <dri:objIdentifier>
221
                                <xsl:value-of select="$dnetTargetId"/>
222
                            </dri:objIdentifier>
223
                            <dri:recordIdentifier>
224
                                <xsl:value-of select="concat($relatedPid, '::', $relatedPidType)"/>
225
                            </dri:recordIdentifier>
226
                            <dri:dateOfCollection>
227
                                <xsl:value-of select="//dri:dateOfCollection"/>
228
                            </dri:dateOfCollection>
229
                            <dri:repositoryId>
230
                                <xsl:value-of select="//dri:repositoryId"/>
231
                            </dri:repositoryId>
232
                            <dri:datasourceprefix>
233
                                <xsl:value-of select="$namespacePrefix"/>
234
                            </dri:datasourceprefix>
235
                        </oai:header>
236
                        <metadata>
237
                            <oaf:pid type="{$relatedPidType}">
238
                                <xsl:value-of select="$relatedPid"/>
239
                            </oaf:pid>
240
                            <dc:identifier>
241
                                <xsl:value-of select="$relatedPid"/>
242
                            </dc:identifier>
243
                            <dc:title>
244
                                <xsl:value-of select="//*[local-name()='target']/*[local-name()='title']"/>
245
                            </dc:title>
246
                            <xsl:for-each select="//*[local-name()='target']//*[local-name()='creatorName']">
247
                                <dc:creator>
248
                                    <xsl:value-of select="."/>
249
                                </dc:creator>
250
                            </xsl:for-each>
251
                            <dc:type>publication</dc:type>
252
                            <oaf:relatedIdentifier inverseRelationType="{$relation}" relationType="{$inverseRelation}"
253
                                                   entityType="{$sourceType}" name="dnet">
254
                                <xsl:value-of select="$dnetSourceId"/>
255
                            </oaf:relatedIdentifier>
256
                        </metadata>
257
                        <oaf:about>
258
                            <oaf:datainfo>
259
                                <oaf:collectedFrom completionStatus="complete">
260
                                    <xsl:attribute name="id">
261
                                        <xsl:value-of select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
262
                                    </xsl:attribute>
263
                                    <xsl:attribute name="name">
264
                                        <xsl:value-of select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
265
                                    </xsl:attribute>
266
                                </oaf:collectedFrom>
267
                                <oaf:completionStatus>complete</oaf:completionStatus>
268
                                <oaf:provisionMode>collected</oaf:provisionMode>
269
                            </oaf:datainfo>
270
                        </oaf:about>
271
                    </oai:record>
272
                </xsl:when>
273
                <xsl:when
274
                        test=".//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'dataset' or .//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'collection'">
275
                    <oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
276
                                xmlns="http://namespace.openaire.eu/">
277
                        <oai:header>
278
                            <dri:objIdentifier>
279
                                <xsl:value-of select="$dnetTargetId"/>
280
                            </dri:objIdentifier>
281
                            <dri:recordIdentifier>
282
                                <xsl:value-of select="concat($relatedPid, '::', $relatedPidType)"/>
283
                            </dri:recordIdentifier>
284
                            <dri:dateOfCollection>
285
                                <xsl:value-of select="//dri:dateOfCollection"/>
286
                            </dri:dateOfCollection>
287
                            <dri:repositoryId>
288
                                <xsl:value-of select="//dri:repositoryId"/>
289
                            </dri:repositoryId>
290
                            <dri:datasourceprefix>
291
                                <xsl:value-of select="$namespacePrefix"/>
292
                            </dri:datasourceprefix>
293
                        </oai:header>
294
                        <metadata>
295
                            <resource xmlns="http://datacite.org/schema/kernel-3"
296
                                      xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
297
                                <identifier identifierType="{$relatedPidType}">
298
                                    <xsl:value-of select="$relatedPid"/>
299
                                </identifier>
300
                                <titles>
301
                                    <xsl:for-each
302
                                            select="//*[local-name()='target']/*[local-name()='title']">
303
                                        <title>
193 304
                                            <xsl:value-of select="."/>
194
                                        </dc:title>
305
                                        </title>
195 306
                                    </xsl:for-each>
196
                                    <xsl:for-each select=".//*[local-name()='note']">
197
                                        <dc:description>
307
                                </titles>
308
                                <publisher>
309
                                    <xsl:value-of select="//*[local-name()='publisher']/*[local-name()='name']"/>
310
                                </publisher>
311
                                <dates>
312
                                    <xsl:for-each select="//*[local-name()='target']/*[local-name()='publicationDate']">
313
                                        <date dateType="Collected">
198 314
                                            <xsl:value-of select="."/>
199
                                        </dc:description>
315
                                        </date>
200 316
                                    </xsl:for-each>
201
                                    <dc:type>publication</dc:type>
202
                                </metadata>
203
                                <oaf:about>
204
                                    <oaf:datainfo>
205
                                        <oaf:collectedFrom completionStatus="complete">
206
                                            <xsl:attribute name="id">
207
                                                <xsl:value-of
208
                                                        select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
209
                                            </xsl:attribute>
210
                                            <xsl:attribute name="name">
211
                                                <xsl:value-of
212
                                                        select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
213
                                            </xsl:attribute>
214
                                        </oaf:collectedFrom>
215
                                        <oaf:completionStatus>complete</oaf:completionStatus>
216
                                        <oaf:provisionMode>collected</oaf:provisionMode>
217
                                    </oaf:datainfo>
218
                                </oaf:about>
219
                            </oai:record>
220
                        </xsl:if>
221

  
222
                    </xsl:for-each>
223

  
224

  
225
                </pack>
226
            </xsl:otherwise>
227
        </xsl:choose>
317
                                </dates>
318
                                <creators>
319
                                    <xsl:for-each select="//*[local-name()='target']//*[local-name()='creatorName']">
320
                                        <creator>
321
                                            <creatorName>
322
                                                <xsl:value-of select="."/>
323
                                            </creatorName>
324
                                        </creator>
325
                                    </xsl:for-each>
326
                                </creators>
327
                                <resourceType resourceTypeGeneral="Dataset">Dataset</resourceType>
328
                                <relatedIdentifiers>
329
                                    <relatedIdentifier xmlns:oaf="http://namespace.dnet.eu/oaf"
330
                                                       inverseRelationType="{$relation}"
331
                                                       relationType="{$inverseRelation}"
332
                                                       entityType="{$sourceType}" name="dnet">
333
                                        <xsl:value-of select="$dnetSourceId"/>
334
                                    </relatedIdentifier>
335
                                </relatedIdentifiers>
336
                            </resource>
337
                        </metadata>
338
                        <oaf:about>
339
                            <oaf:datainfo>
340
                                <oaf:collectedFrom completionStatus="complete">
341
                                    <xsl:attribute name="id">
342
                                        <xsl:value-of select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
343
                                    </xsl:attribute>
344
                                    <xsl:attribute name="name">
345
                                        <xsl:value-of select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
346
                                    </xsl:attribute>
347
                                </oaf:collectedFrom>
348
                                <oaf:completionStatus>complete</oaf:completionStatus>
349
                                <oaf:provisionMode>collected</oaf:provisionMode>
350
                            </oaf:datainfo>
351
                        </oaf:about>
352
                    </oai:record>
353
                </xsl:when>
354
            </xsl:choose>
355
        </pack>
228 356
    </xsl:template>
229

  
230 357
</xsl:stylesheet>

Also available in: Unified diff