1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2018-06-04T11:15:30+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>NHMRC to DB</TITLE>
|
14
|
<CODE>
|
15
|
<![CDATA[
|
16
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
17
|
xmlns:ands="http://ands.org.au/standards/rif-cs/registryObjects">
|
18
|
|
19
|
<xsl:output indent="yes"/>
|
20
|
|
21
|
<xsl:param name="parentDatasourceId"/>
|
22
|
|
23
|
<xsl:template match="/">
|
24
|
<record>
|
25
|
|
26
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
27
|
|
28
|
<metadata>
|
29
|
<ROWS>
|
30
|
<xsl:for-each select="//ands:registryObject[@group='National Health and Medical Research Council']/ands:activity[@type='grant']">
|
31
|
<xsl:variable name="projectId" select="concat('nhmrc_______::', normalize-space(./ands:identifier[@type='nhmrc']))"/>
|
32
|
<xsl:variable name="fundingId">
|
33
|
<xsl:choose>
|
34
|
<xsl:when test="string-length(./ands:description[@type='fundingScheme']) > 0">
|
35
|
<xsl:value-of select="concat('nhmrc_______::NHMRC::', normalize-space(./ands:description[@type='fundingScheme']))"/>
|
36
|
</xsl:when>
|
37
|
<xsl:otherwise>
|
38
|
<xsl:value-of select="string('nhmrc_______::NHMRC')"/>
|
39
|
</xsl:otherwise>
|
40
|
</xsl:choose>
|
41
|
</xsl:variable>
|
42
|
|
43
|
<ROW table="projects">
|
44
|
<FIELD name="_dnet_resource_identifier_">
|
45
|
<xsl:value-of select="$projectId"/>
|
46
|
</FIELD>
|
47
|
<FIELD name="id">
|
48
|
<xsl:value-of select="$projectId"/>
|
49
|
</FIELD>
|
50
|
<FIELD name="code">
|
51
|
<xsl:value-of select="normalize-space(.//ands:identifier[@type='nhmrc'])"/>
|
52
|
</FIELD>
|
53
|
<FIELD name="title">
|
54
|
<xsl:value-of select="./ands:name[@type='primary']/ands:namePart"/>
|
55
|
</FIELD>
|
56
|
<FIELD name="websiteurl">
|
57
|
<xsl:value-of select="./ands:identifier[@type='purl']"/>
|
58
|
</FIELD>
|
59
|
|
60
|
<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
|
61
|
<FIELD name="startdate" type="date" format="dd-MM-yyyy">
|
62
|
<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
|
63
|
</FIELD>
|
64
|
</xsl:for-each>
|
65
|
<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
|
66
|
<FIELD name="enddate" type="date" format="dd-MM-yyyy">
|
67
|
<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
|
68
|
</FIELD>
|
69
|
</xsl:for-each>
|
70
|
|
71
|
<xsl:variable name="keywords">
|
72
|
<xsl:for-each select="./ands:subject[@type='local']">
|
73
|
<xsl:if test="position() != 1">,</xsl:if>
|
74
|
<xsl:value-of select="."/>
|
75
|
</xsl:for-each>
|
76
|
</xsl:variable>
|
77
|
<FIELD name="keywords">
|
78
|
<xsl:value-of select="normalize-space($keywords)"/>
|
79
|
</FIELD>
|
80
|
<FIELD name="collectedfrom">
|
81
|
<xsl:value-of select="$parentDatasourceId"/>
|
82
|
</FIELD>
|
83
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
84
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
85
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
86
|
</ROW>
|
87
|
|
88
|
<ROW table="project_fundingpath">
|
89
|
<FIELD name="_dnet_resource_identifier_">
|
90
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
91
|
</FIELD>
|
92
|
<FIELD name="funding">
|
93
|
<xsl:value-of select="$fundingId"/>
|
94
|
</FIELD>
|
95
|
<FIELD name="project">
|
96
|
<xsl:value-of select="$projectId"/>
|
97
|
</FIELD>
|
98
|
<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
|
99
|
<FIELD name="startdate" type="date" format="dd-MM-yyyy">
|
100
|
<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
|
101
|
</FIELD>
|
102
|
</xsl:for-each>
|
103
|
<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
|
104
|
<FIELD name="enddate" type="date" format="dd-MM-yyyy">
|
105
|
<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
|
106
|
</FIELD>
|
107
|
</xsl:for-each>
|
108
|
</ROW>
|
109
|
|
110
|
</xsl:for-each>
|
111
|
</ROWS>
|
112
|
</metadata>
|
113
|
</record>
|
114
|
</xsl:template>
|
115
|
</xsl:stylesheet>
|
116
|
]]>
|
117
|
</CODE>
|
118
|
</SCRIPT>
|
119
|
</CONFIGURATION>
|
120
|
<STATUS/>
|
121
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
122
|
</BODY>
|
123
|
</RESOURCE_PROFILE>
|