Project

General

Profile

1 35420 michele.ar
<?xml version="1.0" encoding="UTF-8"?>
2 48139 alessia.ba
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                xmlns:ands="http://ands.org.au/standards/rif-cs/registryObjects">
4
5 37863 alessia.ba
	<xsl:output indent="yes"/>
6 48139 alessia.ba
7
	<xsl:param name="parentDatasourceId"/>
8
9 35420 michele.ar
	<xsl:template match="/">
10 48139 alessia.ba
		<record
11
		>
12
13 35420 michele.ar
			<xsl:copy-of select=".//*[local-name()='header']"/>
14 48139 alessia.ba
15 35420 michele.ar
			<metadata>
16
				<ROWS>
17 37863 alessia.ba
					<xsl:for-each select="//ands:registryObject[@group='Australian Research Council']/ands:activity[@type='grant']">
18
						<xsl:variable name="projectId" select="concat('arc_________::', normalize-space(./ands:identifier[@type='arc']))"/>
19 41476 claudio.at
						<xsl:variable name="fundingId">
20
							<xsl:choose>
21
								<xsl:when test="string-length(./ands:description[@type='fundingScheme']) &gt; 0">
22
									<xsl:value-of select="concat('arc_________::ARC::', normalize-space(./ands:description[@type='fundingScheme']))"/>
23
								</xsl:when>
24
								<xsl:otherwise>
25
									<xsl:value-of select="string('arc_________::ARC')"/>
26
								</xsl:otherwise>
27
							</xsl:choose>
28
						</xsl:variable>
29
30 37863 alessia.ba
						<ROW table="projects">
31 48139 alessia.ba
							<FIELD name="_dnet_resource_identifier_">
32
								<xsl:value-of select="$projectId"/>
33
							</FIELD>
34
							<FIELD name="id">
35
								<xsl:value-of select="$projectId"/>
36
							</FIELD>
37
							<FIELD name="code">
38
								<xsl:value-of select="normalize-space(.//ands:identifier[@type='arc'])"/>
39
							</FIELD>
40
							<FIELD name="title">
41
								<xsl:value-of select="./ands:name[@type='primary']/ands:namePart"/>
42
							</FIELD>
43
							<FIELD name="websiteurl">
44
								<xsl:value-of select="./ands:identifier[@type='purl']"/>
45
							</FIELD>
46
47 37863 alessia.ba
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
48 48139 alessia.ba
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
49
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
50
								</FIELD>
51 37863 alessia.ba
							</xsl:for-each>
52
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
53 48139 alessia.ba
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
54
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
55
								</FIELD>
56 37863 alessia.ba
							</xsl:for-each>
57 48139 alessia.ba
58 37863 alessia.ba
							<xsl:variable name="keywords">
59
								<xsl:for-each select="./ands:subject[@type='local']">
60 48139 alessia.ba
									<xsl:if test="position() != 1">,</xsl:if>
61 37863 alessia.ba
									<xsl:value-of select="."/>
62
								</xsl:for-each>
63
							</xsl:variable>
64 48139 alessia.ba
							<FIELD name="keywords">
65
								<xsl:value-of select="normalize-space($keywords)"/>
66
							</FIELD>
67
							<FIELD name="collectedfrom">
68
								<xsl:value-of select="$parentDatasourceId"/>
69
							</FIELD>
70 37863 alessia.ba
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
71
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
72 35420 michele.ar
						</ROW>
73 48139 alessia.ba
74 35420 michele.ar
						<ROW table="project_fundingpath">
75 48139 alessia.ba
							<FIELD name="_dnet_resource_identifier_">
76
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
77
							</FIELD>
78
							<FIELD name="funding">
79
								<xsl:value-of select="$fundingId"/>
80
							</FIELD>
81
							<FIELD name="project">
82
								<xsl:value-of select="$projectId"/>
83
							</FIELD>
84 37863 alessia.ba
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
85 48139 alessia.ba
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
86
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
87
								</FIELD>
88 37863 alessia.ba
							</xsl:for-each>
89
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
90 48139 alessia.ba
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
91
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
92
								</FIELD>
93 37863 alessia.ba
							</xsl:for-each>
94 35420 michele.ar
						</ROW>
95 48139 alessia.ba
96 35420 michele.ar
					</xsl:for-each>
97
				</ROWS>
98
			</metadata>
99
		</record>
100
	</xsl:template>
101
</xsl:stylesheet>