Revision 48139
Added by Alessia Bardi over 6 years ago
tara_2_db.xsl | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
3 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
4 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
5 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:fn="http://www.w3.org/2005/xpath-functions" |
|
3 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
|
6 | 4 |
exclude-result-prefixes="xs" version="1.0"> |
7 | 5 |
|
8 |
<xsl:param name="parentDatasourceId" />
|
|
9 |
<xsl:param name="namespacePrefix" />
|
|
6 |
<xsl:param name="parentDatasourceId"/>
|
|
7 |
<xsl:param name="namespacePrefix"/>
|
|
10 | 8 |
|
11 |
<xsl:template match="/">
|
|
9 |
<xsl:template match="/">
|
|
12 | 10 |
|
13 |
<xsl:variable name="funderId" select="string('taraexp_____::tara')" />
|
|
11 |
<xsl:variable name="funderId" select="string('taraexp_____::tara')"/>
|
|
14 | 12 |
|
15 |
<record xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
16 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
17 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oaf="http://namespace.openaire.eu/oaf" |
|
18 |
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"> |
|
13 |
<record |
|
14 |
> |
|
19 | 15 |
|
20 |
<xsl:copy-of select=".//*[local-name()='header']" />
|
|
16 |
<xsl:copy-of select=".//*[local-name()='header']"/>
|
|
21 | 17 |
|
22 |
<metadata>
|
|
23 |
<ROWS>
|
|
24 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='PROJECT ID']))" />
|
|
25 |
<xsl:variable name="startDate" select=".//column[@name='START DATE']" />
|
|
26 |
<xsl:variable name="endDate" select=".//column[@name='END DATE']" />
|
|
18 |
<metadata>
|
|
19 |
<ROWS>
|
|
20 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='PROJECT ID']))"/>
|
|
21 |
<xsl:variable name="startDate" select=".//column[@name='START DATE']"/>
|
|
22 |
<xsl:variable name="endDate" select=".//column[@name='END DATE']"/>
|
|
27 | 23 |
|
28 |
<ROW table="projects"> |
|
29 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD> |
|
30 |
<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD> |
|
31 |
<FIELD name="code"><xsl:value-of select=".//column[@name='PROJECT ID']" /></FIELD> |
|
32 |
<FIELD name="title"><xsl:value-of select=".//column[@name='PROJECT TITLE']" /></FIELD> |
|
33 |
<FIELD name="jsonextrainfo"><xsl:value-of select=".//column[@name='DM KEYWORDS']" /></FIELD> |
|
34 |
<FIELD name="startdate" type="date" format="yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
35 |
<FIELD name="enddate" type="date" format="yyyy"><xsl:value-of select="$endDate" /></FIELD> |
|
36 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
37 |
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD> |
|
38 |
</ROW> |
|
24 |
<ROW table="projects"> |
|
25 |
<FIELD name="_dnet_resource_identifier_"> |
|
26 |
<xsl:value-of select="$projectId"/> |
|
27 |
</FIELD> |
|
28 |
<FIELD name="id"> |
|
29 |
<xsl:value-of select="$projectId"/> |
|
30 |
</FIELD> |
|
31 |
<FIELD name="code"> |
|
32 |
<xsl:value-of select=".//column[@name='PROJECT ID']"/> |
|
33 |
</FIELD> |
|
34 |
<FIELD name="title"> |
|
35 |
<xsl:value-of select=".//column[@name='PROJECT TITLE']"/> |
|
36 |
</FIELD> |
|
37 |
<FIELD name="jsonextrainfo"> |
|
38 |
<xsl:value-of select=".//column[@name='DM KEYWORDS']"/> |
|
39 |
</FIELD> |
|
40 |
<FIELD name="startdate" type="date" format="yyyy"> |
|
41 |
<xsl:value-of select="$startDate"/> |
|
42 |
</FIELD> |
|
43 |
<FIELD name="enddate" type="date" format="yyyy"> |
|
44 |
<xsl:value-of select="$endDate"/> |
|
45 |
</FIELD> |
|
46 |
<FIELD name="collectedfrom"> |
|
47 |
<xsl:value-of select="$parentDatasourceId"/> |
|
48 |
</FIELD> |
|
49 |
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD> |
|
50 |
</ROW> |
|
39 | 51 |
|
40 |
<ROW table="project_fundingpath"> |
|
41 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($funderId, '@@', $projectId)" /></FIELD> |
|
42 |
<FIELD name="funding"><xsl:value-of select="$funderId" /></FIELD> |
|
43 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
44 |
<FIELD name="startdate" type="date" format="yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
45 |
<FIELD name="enddate" type="date" format="yyyy"><xsl:value-of select="$endDate" /></FIELD> |
|
46 |
</ROW> |
|
52 |
<ROW table="project_fundingpath"> |
|
53 |
<FIELD name="_dnet_resource_identifier_"> |
|
54 |
<xsl:value-of select="concat($funderId, '@@', $projectId)"/> |
|
55 |
</FIELD> |
|
56 |
<FIELD name="funding"> |
|
57 |
<xsl:value-of select="$funderId"/> |
|
58 |
</FIELD> |
|
59 |
<FIELD name="project"> |
|
60 |
<xsl:value-of select="$projectId"/> |
|
61 |
</FIELD> |
|
62 |
<FIELD name="startdate" type="date" format="yyyy"> |
|
63 |
<xsl:value-of select="$startDate"/> |
|
64 |
</FIELD> |
|
65 |
<FIELD name="enddate" type="date" format="yyyy"> |
|
66 |
<xsl:value-of select="$endDate"/> |
|
67 |
</FIELD> |
|
68 |
</ROW> |
|
47 | 69 |
|
48 |
</ROWS>
|
|
49 |
</metadata>
|
|
50 |
</record>
|
|
51 |
</xsl:template>
|
|
70 |
</ROWS>
|
|
71 |
</metadata>
|
|
72 |
</record>
|
|
73 |
</xsl:template>
|
|
52 | 74 |
|
53 | 75 |
</xsl:stylesheet> |
Also available in: Unified diff
integrated (hopefully) all required changes from dnet40