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" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr"
3
	xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:fn="http://www.w3.org/2005/xpath-functions"
4
	xmlns:ands="http://ands.org.au/standards/rif-cs/registryObjects">
5
	
6
	<xsl:output indent="yes"/>
7
	
8
	<xsl:param name="parentDatasourceId" />
9
		
10
	<xsl:template match="/">
11
		<record xmlns:dr="http://www.driver-repository.eu/namespace/dr"
12
			xmlns:dri="http://www.driver-repository.eu/namespace/dri"
13
			xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
14
			xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
15
			
16
			<xsl:copy-of select=".//*[local-name()='header']"/>
17
			
18
			<metadata>
19
				<ROWS>
20
					<xsl:for-each select="//ands:registryObject[@group='Australian Research Council']/ands:activity[@type='grant']">
21
						<xsl:variable name="projectId" select="concat('arc_________::', normalize-space(./ands:identifier[@type='arc']))"/>
22
						<xsl:variable name="fundingId">
23
							<xsl:choose>
24
								<xsl:when test="string-length(./ands:description[@type='fundingScheme']) &gt; 0">
25
									<xsl:value-of select="concat('arc_________::ARC::', normalize-space(./ands:description[@type='fundingScheme']))"/>
26
								</xsl:when>
27
								<xsl:otherwise>
28
									<xsl:value-of select="string('arc_________::ARC')"/>
29
								</xsl:otherwise>
30
							</xsl:choose>
31
						</xsl:variable>
32

    
33
						<ROW table="projects">
34
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD>
35
							<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD>
36
							<FIELD name="code"><xsl:value-of select="normalize-space(.//ands:identifier[@type='arc'])" /></FIELD>
37
							<FIELD name="title"><xsl:value-of select="./ands:name[@type='primary']/ands:namePart" /></FIELD>
38
							<FIELD name="websiteurl"><xsl:value-of select="./ands:identifier[@type='purl']"/></FIELD>
39
							
40
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
41
								<FIELD name="startdate" type="date" format="dd-MM-yyyy"><xsl:value-of select="concat('01-01-', normalize-space(.))" /></FIELD>
42
							</xsl:for-each>
43
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
44
								<FIELD name="enddate" type="date" format="dd-MM-yyyy"><xsl:value-of select="concat('31-12-', normalize-space(.))" /></FIELD>
45
							</xsl:for-each>
46
							
47
							<xsl:variable name="keywords">
48
								<xsl:for-each select="./ands:subject[@type='local']">
49
									<xsl:if test="position() != 1">, </xsl:if>
50
									<xsl:value-of select="."/>
51
								</xsl:for-each>
52
							</xsl:variable>
53
							<FIELD name="keywords"><xsl:value-of select="normalize-space($keywords)" /></FIELD>
54
							<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
55
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
56
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
57
						</ROW>
58
						
59
						<ROW table="project_fundingpath">
60
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId, '@@', $projectId)" /></FIELD>
61
							<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD>
62
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
63
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
64
								<FIELD name="startdate" type="date" format="dd-MM-yyyy"><xsl:value-of select="concat('01-01-', normalize-space(.))" /></FIELD>
65
							</xsl:for-each>
66
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
67
								<FIELD name="enddate" type="date" format="dd-MM-yyyy"><xsl:value-of select="concat('31-12-', normalize-space(.))" /></FIELD>
68
							</xsl:for-each>
69
						</ROW>
70
					
71
					</xsl:for-each>
72
				</ROWS>
73
			</metadata>
74
		</record>
75
	</xsl:template>
76
</xsl:stylesheet>
(1-1/24)