Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<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
	<xsl:output indent="yes"/>
6

    
7
	<xsl:param name="parentDatasourceId"/>
8

    
9
	<xsl:template match="/">
10
		<record>
11

    
12
			<xsl:copy-of select=".//*[local-name()='header']"/>
13

    
14
			<metadata>
15
				<ROWS>
16
					<xsl:for-each select="//ands:registryObject[@group='Australian Research Council']/ands:activity[@type='grant']">
17
						<xsl:variable name="projectId" select="concat('arc_________::', normalize-space(./ands:identifier[@type='arc']))"/>
18
						<xsl:variable name="fundingId">
19
							<xsl:choose>
20
								<xsl:when test="string-length(./ands:description[@type='fundingScheme']) &gt; 0">
21
									<xsl:value-of select="concat('arc_________::ARC::', normalize-space(./ands:description[@type='fundingScheme']))"/>
22
								</xsl:when>
23
								<xsl:otherwise>
24
									<xsl:value-of select="string('arc_________::ARC')"/>
25
								</xsl:otherwise>
26
							</xsl:choose>
27
						</xsl:variable>
28

    
29
						<ROW table="projects">
30
							<FIELD name="_dnet_resource_identifier_">
31
								<xsl:value-of select="$projectId"/>
32
							</FIELD>
33
							<FIELD name="id">
34
								<xsl:value-of select="$projectId"/>
35
							</FIELD>
36
							<FIELD name="code">
37
								<xsl:value-of select="normalize-space(.//ands:identifier[@type='arc'])"/>
38
							</FIELD>
39
							<FIELD name="title">
40
								<xsl:value-of select="./ands:name[@type='primary']/ands:namePart"/>
41
							</FIELD>
42
							<FIELD name="websiteurl">
43
								<xsl:value-of select="./ands:identifier[@type='purl']"/>
44
							</FIELD>
45

    
46
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
47
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
48
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
49
								</FIELD>
50
							</xsl:for-each>
51
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
52
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
53
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
54
								</FIELD>
55
							</xsl:for-each>
56

    
57
							<xsl:variable name="keywords">
58
								<xsl:for-each select="./ands:subject[@type='local']">
59
									<xsl:if test="position() != 1">,</xsl:if>
60
									<xsl:value-of select="."/>
61
								</xsl:for-each>
62
							</xsl:variable>
63
							<FIELD name="keywords">
64
								<xsl:value-of select="normalize-space($keywords)"/>
65
							</FIELD>
66
							<FIELD name="collectedfrom">
67
								<xsl:value-of select="$parentDatasourceId"/>
68
							</FIELD>
69
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
70
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
71
						</ROW>
72

    
73
						<ROW table="project_fundingpath">
74
							<FIELD name="_dnet_resource_identifier_">
75
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
76
							</FIELD>
77
							<FIELD name="funding">
78
								<xsl:value-of select="$fundingId"/>
79
							</FIELD>
80
							<FIELD name="project">
81
								<xsl:value-of select="$projectId"/>
82
							</FIELD>
83
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
84
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
85
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
86
								</FIELD>
87
							</xsl:for-each>
88
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
89
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
90
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
91
								</FIELD>
92
							</xsl:for-each>
93
						</ROW>
94

    
95
					</xsl:for-each>
96
				</ROWS>
97
			</metadata>
98
		</record>
99
	</xsl:template>
100
</xsl:stylesheet>
(2-2/30)