Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="bc8d96f0-f35d-4791-8da9-7bc9b788b978_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>ARC 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
			<xsl:copy-of select=".//*[local-name()='header']"/>
25
			<metadata>
26
				<ROWS>
27
					<xsl:for-each select="//ands:registryObject[@group='Australian Research Council']/ands:activity[@type='grant']">
28
						<xsl:variable name="projectId" select="concat('arc_________::', normalize-space(./ands:identifier[@type='arc']))"/>
29
						<xsl:variable name="fundingId">
30
							<xsl:choose>
31
								<xsl:when test="string-length(./ands:description[@type='fundingScheme']) &gt; 0">
32
									<xsl:value-of select="concat('arc_________::ARC::', normalize-space(./ands:description[@type='fundingScheme']))"/>
33
								</xsl:when>
34
								<xsl:otherwise>
35
									<xsl:value-of select="string('arc_________::ARC')"/>
36
								</xsl:otherwise>
37
							</xsl:choose>
38
						</xsl:variable>
39

    
40
						<ROW table="projects">
41
							<FIELD name="_dnet_resource_identifier_">
42
								<xsl:value-of select="$projectId"/>
43
							</FIELD>
44
							<FIELD name="id">
45
								<xsl:value-of select="$projectId"/>
46
							</FIELD>
47
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
48
							<FIELD name="code">
49
								<xsl:value-of select="normalize-space(.//ands:identifier[@type='arc'])"/>
50
							</FIELD>
51
							<FIELD name="title">
52
								<xsl:value-of select="./ands:name[@type='primary']/ands:namePart"/>
53
							</FIELD>
54
							<FIELD name="websiteurl">
55
								<xsl:value-of select="./ands:identifier[@type='purl']"/>
56
							</FIELD>
57

    
58
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
59
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
60
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
61
								</FIELD>
62
							</xsl:for-each>
63
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
64
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
65
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
66
								</FIELD>
67
							</xsl:for-each>
68

    
69
							<xsl:variable name="keywords">
70
								<xsl:for-each select="./ands:subject[@type='local']">
71
									<xsl:if test="position() != 1">,</xsl:if>
72
									<xsl:value-of select="."/>
73
								</xsl:for-each>
74
							</xsl:variable>
75
							<FIELD name="keywords">
76
								<xsl:value-of select="normalize-space($keywords)"/>
77
							</FIELD>
78
							<FIELD name="collectedfrom">
79
								<xsl:value-of select="$varDataSourceId"/>
80
							</FIELD>
81
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
82
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
83
						</ROW>
84

    
85
						<ROW table="project_fundingpath">
86
							<FIELD name="_dnet_resource_identifier_">
87
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
88
							</FIELD>
89
							<FIELD name="funding">
90
								<xsl:value-of select="$fundingId"/>
91
							</FIELD>
92
							<FIELD name="project">
93
								<xsl:value-of select="$projectId"/>
94
							</FIELD>
95
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
96
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
97
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
98
								</FIELD>
99
							</xsl:for-each>
100
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
101
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
102
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
103
								</FIELD>
104
							</xsl:for-each>
105
						</ROW>
106

    
107
					</xsl:for-each>
108
				</ROWS>
109
			</metadata>
110
		</record>
111
	</xsl:template>
112
</xsl:stylesheet>
113
		</CODE>
114
		</SCRIPT>
115
		</CONFIGURATION>
116
<STATUS/>
117
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
118
		</BODY>
119
		</RESOURCE_PROFILE>
(2-2/22)