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
	
5
	<xsl:param name="parentDatasourceId" />
6

    
7
	<xsl:variable name="invalid" select="' ,-'" />
8
	<xsl:variable name="valid"   select="'___'" />
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:variable name="prefix" select="string('arc_________')" />
21
					<xsl:variable name="projectId" select="concat($prefix, '::',  //project/id)" />
22
					<xsl:variable name="parentDatasourceId" select="string('openaire____::arc')"/>
23
					<xsl:variable name="startDate" select="//project/startDate" />
24
					<xsl:variable name="endDate" select="//project/endDate" />
25
									
26
					<ROW table="projects">
27
						<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD>
28
						<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD>
29
						<FIELD name="code"><xsl:value-of select="//project/id" /></FIELD>
30
						<FIELD name="title"><xsl:value-of select="//project/title" /></FIELD>
31
						<xsl:if test="normalize-space($startDate)">
32
							<FIELD name="startdate" type="date" format="dd-MM-yyyy"><xsl:value-of select="$startDate" /></FIELD>
33
						</xsl:if>
34
						<xsl:if test="normalize-space($endDate)">
35
							<FIELD name="enddate" type="date" format="dd-MM-yyyy"><xsl:value-of select="$endDate" /></FIELD>
36
						</xsl:if>
37
						<FIELD name="keywords"><xsl:value-of select="//project/keywords" /></FIELD>
38
						<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId"/></FIELD>
39
						<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
40
					</ROW>
41
					
42
					<xsl:for-each select="//organisation">
43
						<xsl:variable name="orgId" select="concat($prefix,'::',.)"/>					
44
						<ROW table="organizations">
45
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$orgId" /></FIELD>
46
							<FIELD name="id"><xsl:value-of select="$orgId" /></FIELD>
47
							<FIELD name="legalname"><xsl:value-of select="." /></FIELD>
48
							<FIELD name="countryclass">AU</FIELD>
49
						</ROW>
50
						<ROW table="project_organization">
51
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectId,'@@',$orgId)" /></FIELD>
52
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
53
							<FIELD name="resporganization"><xsl:value-of select="$orgId" /></FIELD>
54
							<FIELD name="participantnumber" type="int">1</FIELD>
55
							<xsl:if test="normalize-space($startDate)">
56
								<FIELD name="startdate" type="date" format="dd-MM-yyyy"><xsl:value-of select="$startDate" /></FIELD>
57
							</xsl:if>
58
							<xsl:if test="normalize-space($endDate)">
59
								<FIELD name="enddate" type="date" format="dd-MM-yyyy"><xsl:value-of select="$endDate" /></FIELD>
60
							</xsl:if>
61
						</ROW>
62
					</xsl:for-each>
63
					
64
					<xsl:for-each select="//funding">
65
						<xsl:variable name="fundingId" select="concat('arc_________::ARC::', ./id)" />
66
						<ROW table="project_fundingpath">
67
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId, '@@', $projectId)" /></FIELD>
68
							<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD>
69
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
70
							<xsl:if test="normalize-space($startDate)">
71
								<FIELD name="startdate" type="date" format="dd-MM-yyyy"><xsl:value-of select="$startDate" /></FIELD>
72
							</xsl:if>
73
							<xsl:if test="normalize-space($endDate)">
74
								<FIELD name="enddate" type="date" format="dd-MM-yyyy"><xsl:value-of select="$endDate" /></FIELD>
75
							</xsl:if>
76
						</ROW>
77
					</xsl:for-each>
78
					
79
				</ROWS>
80
			</metadata>
81
		</record>
82
	</xsl:template>
83

    
84
</xsl:stylesheet>
(2-2/13)