1 |
30840
|
claudio.at
|
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3 |
31255
|
andrea.man
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4 |
|
|
xmlns:datetime="http://exslt.org/dates-and-times" xmlns:exslt="http://exslt.org/common"
|
5 |
|
|
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
|
6 |
|
|
xmlns:dnet="eu.dnetlib.miscutils.functional.xml.DnetXsltFunctions"
|
7 |
|
|
xmlns:oaf="http://namespace.openaire.eu/oaf"
|
8 |
|
|
exclude-result-prefixes="xsl datetime exslt dnet"
|
9 |
|
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri">
|
10 |
|
|
|
11 |
|
|
<xsl:variable name="status" select="/*[local-name() = 'record']/*[local-name() = 'header']/@status" />
|
12 |
47655
|
alessia.ba
|
<xsl:variable name="datestamp" select="datetime:dateTime()" />
|
13 |
|
|
|
14 |
31255
|
andrea.man
|
<xsl:template match="/">
|
15 |
47655
|
alessia.ba
|
<xsl:choose>
|
16 |
|
|
<xsl:when test=".//oaf:entity">
|
17 |
|
|
<xsl:call-template name="identity"/>
|
18 |
|
|
</xsl:when>
|
19 |
|
|
<xsl:otherwise>
|
20 |
|
|
<xsl:call-template name="default"/>
|
21 |
|
|
</xsl:otherwise>
|
22 |
|
|
</xsl:choose>
|
23 |
|
|
</xsl:template>
|
24 |
|
|
|
25 |
|
|
<xsl:template name="identity">
|
26 |
31255
|
andrea.man
|
<oai:record xmlns="http://namespace.openaire.eu/"
|
27 |
|
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
28 |
|
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
29 |
|
|
xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"
|
30 |
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
31 |
47655
|
alessia.ba
|
|
32 |
31255
|
andrea.man
|
<oai:header>
|
33 |
47655
|
alessia.ba
|
<dri:dateOfCollection><xsl:value-of select="\$datestamp"/></dri:dateOfCollection>
|
34 |
48178
|
alessia.ba
|
<xsl:if test="not(.//oaf:datasourceprefix)">
|
35 |
|
|
<oaf:datasourceprefix>$namespacePrefix$</oaf:datasourceprefix>
|
36 |
|
|
</xsl:if>
|
37 |
47655
|
alessia.ba
|
<xsl:for-each select="//*[local-name() = 'header']/*[local-name() != 'dateOfCollection']">
|
38 |
|
|
<xsl:copy-of select="."/>
|
39 |
|
|
</xsl:for-each>
|
40 |
|
|
</oai:header>
|
41 |
|
|
<oai:metadata>
|
42 |
|
|
<xsl:copy-of select=".//oaf:entity"/>
|
43 |
|
|
</oai:metadata>
|
44 |
|
|
<xsl:call-template name="about"/>
|
45 |
|
|
</oai:record>
|
46 |
|
|
</xsl:template>
|
47 |
|
|
|
48 |
|
|
<xsl:template name="default">
|
49 |
|
|
|
50 |
|
|
<oai:record xmlns="http://namespace.openaire.eu/"
|
51 |
|
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
52 |
|
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
53 |
|
|
xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"
|
54 |
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
55 |
|
|
|
56 |
|
|
<oai:header>
|
57 |
31272
|
andrea.man
|
<xsl:if test="\$status">
|
58 |
31255
|
andrea.man
|
<xsl:attribute name="status" >
|
59 |
31272
|
andrea.man
|
<xsl:value-of select="\$status"/>
|
60 |
31255
|
andrea.man
|
</xsl:attribute>
|
61 |
|
|
</xsl:if>
|
62 |
47590
|
alessia.ba
|
<xsl:if test="not(.//dri:objIdentifier) and not(.//*[local-name() = 'header']/*[local-name()='objIdentifier'])">
|
63 |
31255
|
andrea.man
|
<dri:objIdentifier><xsl:value-of select="concat('$namespacePrefix$::', dnet:md5($xpath$))"/></dri:objIdentifier>
|
64 |
|
|
</xsl:if>
|
65 |
|
|
<xsl:if test="not(.//dri:recordIdentifier)">
|
66 |
31271
|
andrea.man
|
<dri:recordIdentifier><xsl:value-of select="$xpath$"/></dri:recordIdentifier>
|
67 |
31255
|
andrea.man
|
</xsl:if>
|
68 |
47655
|
alessia.ba
|
<xsl:if test="not(string(.//dri:dateOfCollection))">
|
69 |
34843
|
andrea.man
|
<dri:dateOfCollection><xsl:value-of select="\$datestamp"/></dri:dateOfCollection>
|
70 |
31255
|
andrea.man
|
</xsl:if>
|
71 |
|
|
<xsl:if test="not(.//oaf:datasourceprefix)">
|
72 |
|
|
<oaf:datasourceprefix>$namespacePrefix$</oaf:datasourceprefix>
|
73 |
|
|
</xsl:if>
|
74 |
47655
|
alessia.ba
|
|
75 |
31255
|
andrea.man
|
<xsl:for-each select="/*[local-name() = 'record']/*[local-name() = 'header']/*">
|
76 |
|
|
<xsl:copy-of select="."/>
|
77 |
|
|
</xsl:for-each>
|
78 |
|
|
</oai:header>
|
79 |
|
|
<xsl:choose>
|
80 |
|
|
<xsl:when test="count(/*[local-name() = 'record']/*[local-name() = 'metadata']) > 0">
|
81 |
|
|
<xsl:copy-of select="/*[local-name() = 'record']/*[local-name() = 'metadata']"/>
|
82 |
|
|
</xsl:when>
|
83 |
31272
|
andrea.man
|
<xsl:when test="\$status = 'deleted'" />
|
84 |
31255
|
andrea.man
|
<xsl:otherwise>
|
85 |
|
|
<oai:metadata>
|
86 |
|
|
<xsl:copy-of select="."/>
|
87 |
|
|
</oai:metadata>
|
88 |
|
|
</xsl:otherwise>
|
89 |
|
|
</xsl:choose>
|
90 |
31278
|
alessia.ba
|
<xsl:if test="not(\$status) or \$status != 'deleted'">
|
91 |
47655
|
alessia.ba
|
<xsl:call-template name="about"/>
|
92 |
31255
|
andrea.man
|
</xsl:if>
|
93 |
|
|
</oai:record>
|
94 |
|
|
</xsl:template>
|
95 |
47655
|
alessia.ba
|
|
96 |
|
|
<xsl:template name="about">
|
97 |
|
|
<about>
|
98 |
|
|
<provenance xmlns="http://www.openarchives.org/OAI/2.0/provenance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/provenance http://www.openarchives.org/OAI/2.0/provenance.xsd">
|
99 |
|
|
<originDescription harvestDate="{\$datestamp}" altered="true">
|
100 |
|
|
<baseURL>$baseurl$</baseURL>
|
101 |
|
|
<identifier><xsl:value-of select="//*[local-name()='header']/*[local-name()='identifier']"/></identifier>
|
102 |
|
|
<datestamp><xsl:value-of select="//*[local-name()='header']/*[local-name()='datestamp']"/></datestamp>
|
103 |
|
|
<metadataNamespace>$metadatanamespace$</metadataNamespace>
|
104 |
|
|
<xsl:copy-of select="//*[local-name()='provenance']/*[local-name() = 'originDescription']"/>
|
105 |
|
|
</originDescription>
|
106 |
|
|
</provenance>
|
107 |
|
|
<oaf:datainfo>
|
108 |
|
|
<oaf:inferred>$inferred$</oaf:inferred>
|
109 |
|
|
<oaf:deletedbyinference>$deletedbyinference$</oaf:deletedbyinference>
|
110 |
|
|
<oaf:trust>$trust$</oaf:trust>
|
111 |
|
|
<oaf:inferenceprovenance>$inferenceprovenance$</oaf:inferenceprovenance>
|
112 |
|
|
<oaf:provenanceaction schemename="dnet:provenanceActions" schemeid="dnet:provenanceActions" classname="$provenanceactionclassname$" classid="$provenanceactionclassid$"/>
|
113 |
|
|
</oaf:datainfo>
|
114 |
|
|
</about>
|
115 |
|
|
</xsl:template>
|
116 |
31255
|
andrea.man
|
|
117 |
30840
|
claudio.at
|
</xsl:stylesheet>
|