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
|
|
13
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
14
|
|
15
|
<metadata>
|
16
|
<ROWS>
|
17
|
<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
|
<xsl:variable name="fundingId">
|
20
|
<xsl:choose>
|
21
|
<xsl:when test="string-length(./ands:description[@type='fundingScheme']) > 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
|
<ROW table="projects">
|
31
|
<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
|
<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
|
48
|
<FIELD name="startdate" type="date" format="dd-MM-yyyy">
|
49
|
<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
|
50
|
</FIELD>
|
51
|
</xsl:for-each>
|
52
|
<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
|
53
|
<FIELD name="enddate" type="date" format="dd-MM-yyyy">
|
54
|
<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
|
55
|
</FIELD>
|
56
|
</xsl:for-each>
|
57
|
|
58
|
<xsl:variable name="keywords">
|
59
|
<xsl:for-each select="./ands:subject[@type='local']">
|
60
|
<xsl:if test="position() != 1">,</xsl:if>
|
61
|
<xsl:value-of select="."/>
|
62
|
</xsl:for-each>
|
63
|
</xsl:variable>
|
64
|
<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
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
71
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
72
|
</ROW>
|
73
|
|
74
|
<ROW table="project_fundingpath">
|
75
|
<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
|
<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
|
85
|
<FIELD name="startdate" type="date" format="dd-MM-yyyy">
|
86
|
<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
|
87
|
</FIELD>
|
88
|
</xsl:for-each>
|
89
|
<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
|
90
|
<FIELD name="enddate" type="date" format="dd-MM-yyyy">
|
91
|
<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
|
92
|
</FIELD>
|
93
|
</xsl:for-each>
|
94
|
</ROW>
|
95
|
|
96
|
</xsl:for-each>
|
97
|
</ROWS>
|
98
|
</metadata>
|
99
|
</record>
|
100
|
</xsl:template>
|
101
|
</xsl:stylesheet>
|