Project

General

Profile

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
					<![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="varDataSourceId"/>
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']) &gt; 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
 <xsl:variable name="funds" select="tokenize(./ands:description[@type='fundingAmount'],' ')"/>
71
                            <FIELD name="fundedamount" type="float">
72
                                <xsl:value-of select="translate($funds[2],',','')"/>
73
                            </FIELD>
74
                            <FIELD name="currency">
75
                                <xsl:value-of select="substring($funds[1],2)"/>
76
                            </FIELD>
77
                            <FIELD name="summary">
78
                                <xsl:value-of select="./ands:description[@type='brief']"/>
79
                            </FIELD>
80
							<xsl:variable name="keywords">
81
								<xsl:for-each select="./ands:subject[@type='local']">
82
									<xsl:if test="position() != 1">,</xsl:if>
83
									<xsl:value-of select="."/>
84
								</xsl:for-each>
85
							</xsl:variable>
86
							<FIELD name="keywords">
87
								<xsl:value-of select="normalize-space($keywords)"/>
88
							</FIELD>
89
							<FIELD name="collectedfrom">
90
								<xsl:value-of select="$varDataSourceId"/>
91
							</FIELD>
92
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
93
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
94
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
95
						</ROW>
96

    
97
						<ROW table="project_fundingpath">
98
							<FIELD name="_dnet_resource_identifier_">
99
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
100
							</FIELD>
101
							<FIELD name="funding">
102
								<xsl:value-of select="$fundingId"/>
103
							</FIELD>
104
							<FIELD name="project">
105
								<xsl:value-of select="$projectId"/>
106
							</FIELD>
107
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
108
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
109
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
110
								</FIELD>
111
							</xsl:for-each>
112
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
113
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
114
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
115
								</FIELD>
116
							</xsl:for-each>
117
						</ROW>
118

    
119
					</xsl:for-each>
120
				</ROWS>
121
			</metadata>
122
		</record>
123
	</xsl:template>
124
</xsl:stylesheet>
125
]]>
126
		</CODE>
127
		</SCRIPT>
128
		</CONFIGURATION>
129
<STATUS/>
130
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
131
		</BODY>
132
		</RESOURCE_PROFILE>
(15-15/26)