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