1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER
|
4
|
value="oaiAndsTransform_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
5
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
6
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
7
|
<RESOURCE_URI value=""/>
|
8
|
<DATE_OF_CREATION value="2014-11-19T11:05:55+01:00"/>
|
9
|
</HEADER>
|
10
|
<BODY>
|
11
|
<CONFIGURATION>
|
12
|
<IMPORTED/>
|
13
|
<SCRIPT>
|
14
|
<TITLE>OAI_ANDS transform</TITLE>
|
15
|
<CODE><![CDATA[
|
16
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
17
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
18
|
xmlns:datetime="http://exslt.org/dates-and-times" xmlns:exslt="http://exslt.org/common"
|
19
|
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
|
20
|
xmlns:dnet="eu.dnetlib.msro.dli.workflows.nodes.transform.DLIUtils"
|
21
|
xmlns:stringutils="org.apache.commons.lang.StringUtils"
|
22
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:dli="http://www.dli.eu"
|
23
|
exclude-result-prefixes="xsl datetime exslt dnet stringutils">
|
24
|
<xsl:template match="/">
|
25
|
<xsl:choose>
|
26
|
<xsl:when test="not(//*[local-name()='relatedInfo' and ./@type='publication'])">
|
27
|
<record></record>
|
28
|
</xsl:when>
|
29
|
<xsl:otherwise>
|
30
|
<record>
|
31
|
<xsl:copy-of select="//*[local-name()='header']"/>
|
32
|
<metadata>
|
33
|
<xsl:variable name="pid">
|
34
|
<xsl:value-of select="concat('https://researchdata.ands.org.au/registry/registry_object/view/',stringutils:substringAfter(//*[local-name()='header']/*[local-name()='recordIdentifier'],'::'))"/>
|
35
|
</xsl:variable>
|
36
|
|
37
|
<xsl:variable name="namespacePrefix">
|
38
|
<xsl:value-of select="//*[local-name()='header']/*[local-name()='datasourceprefix']"/>
|
39
|
</xsl:variable>
|
40
|
<dli:dliObject>
|
41
|
<dnetResourceIdentifier>
|
42
|
<xsl:value-of select="concat($namespacePrefix,'::',dnet:generateIdentifier($pid,'url'))"/>
|
43
|
</dnetResourceIdentifier>
|
44
|
<localIdentifier type="url">
|
45
|
<xsl:value-of
|
46
|
select="$pid"
|
47
|
/>
|
48
|
</localIdentifier>
|
49
|
<provenance>
|
50
|
<datasource>
|
51
|
<xsl:attribute name="completionStatus">complete</xsl:attribute>
|
52
|
<xsl:attribute name="provisionMode">collected</xsl:attribute>
|
53
|
<xsl:value-of select="$namespacePrefix" />
|
54
|
</datasource>
|
55
|
</provenance>
|
56
|
<xsl:for-each
|
57
|
select="//*[local-name()='name' and ./@type='primary']/*[local-name()='namePart']">
|
58
|
<title>
|
59
|
<xsl:value-of select="."/>
|
60
|
</title>
|
61
|
</xsl:for-each>
|
62
|
<xsl:for-each
|
63
|
select="//*[local-name()='date' and ./@type='dateTo']">
|
64
|
<date> <xsl:value-of select="." /> </date>
|
65
|
</xsl:for-each>
|
66
|
<objectType>dataset</objectType>
|
67
|
<relations>
|
68
|
<xsl:for-each select="//*[local-name()='relatedInfo' and ./@type='publication']">
|
69
|
<xsl:for-each select=".//*[local-name()='identifier']">
|
70
|
|
71
|
<relation>
|
72
|
<xsl:variable name="relationType">
|
73
|
<xsl:value-of select="Unknown"/>
|
74
|
</xsl:variable>
|
75
|
<pid>
|
76
|
<xsl:attribute name="type">
|
77
|
<xsl:value-of select="./@type"/>
|
78
|
</xsl:attribute>
|
79
|
<xsl:value-of select="."/>
|
80
|
</pid>
|
81
|
<typeOfRelation>Unknown</typeOfRelation>
|
82
|
</relation>
|
83
|
</xsl:for-each>
|
84
|
</xsl:for-each>
|
85
|
</relations>
|
86
|
</dli:dliObject>
|
87
|
</metadata>
|
88
|
</record>
|
89
|
</xsl:otherwise>
|
90
|
</xsl:choose>
|
91
|
</xsl:template>
|
92
|
</xsl:stylesheet>
|
93
|
]]></CODE>
|
94
|
</SCRIPT>
|
95
|
</CONFIGURATION>
|
96
|
<STATUS/>
|
97
|
<SECURITY_PARAMETERS/>
|
98
|
</BODY>
|
99
|
</RESOURCE_PROFILE>
|