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 |
|
|
|
13 |
|
|
<xsl:template match="/">
|
14 |
|
|
<oai:record xmlns="http://namespace.openaire.eu/"
|
15 |
|
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
16 |
|
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
17 |
|
|
xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"
|
18 |
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
19 |
|
|
|
20 |
34843
|
andrea.man
|
<xsl:variable name="datestamp" select="datetime:dateTime()" />
|
21 |
|
|
|
22 |
31255
|
andrea.man
|
<oai:header>
|
23 |
31272
|
andrea.man
|
<xsl:if test="\$status">
|
24 |
31255
|
andrea.man
|
<xsl:attribute name="status" >
|
25 |
31272
|
andrea.man
|
<xsl:value-of select="\$status"/>
|
26 |
31255
|
andrea.man
|
</xsl:attribute>
|
27 |
|
|
</xsl:if>
|
28 |
|
|
<xsl:if test="not(.//dri:objIdentifier)">
|
29 |
|
|
<dri:objIdentifier><xsl:value-of select="concat('$namespacePrefix$::', dnet:md5($xpath$))"/></dri:objIdentifier>
|
30 |
|
|
</xsl:if>
|
31 |
|
|
<xsl:if test="not(.//dri:recordIdentifier)">
|
32 |
31271
|
andrea.man
|
<dri:recordIdentifier><xsl:value-of select="$xpath$"/></dri:recordIdentifier>
|
33 |
31255
|
andrea.man
|
</xsl:if>
|
34 |
|
|
<xsl:if test="not(.//dri:dateOfCollection)">
|
35 |
34843
|
andrea.man
|
<dri:dateOfCollection><xsl:value-of select="\$datestamp"/></dri:dateOfCollection>
|
36 |
31255
|
andrea.man
|
</xsl:if>
|
37 |
|
|
<xsl:if test="not(.//dri:repositoryId)">
|
38 |
|
|
<dri:repositoryId>$datasourceId$</dri:repositoryId>
|
39 |
|
|
</xsl:if>
|
40 |
|
|
<xsl:if test="not(.//oaf:datasourceprefix)">
|
41 |
|
|
<oaf:datasourceprefix>$namespacePrefix$</oaf:datasourceprefix>
|
42 |
|
|
</xsl:if>
|
43 |
|
|
|
44 |
|
|
<xsl:for-each select="/*[local-name() = 'record']/*[local-name() = 'header']/*">
|
45 |
|
|
<xsl:copy-of select="."/>
|
46 |
|
|
</xsl:for-each>
|
47 |
|
|
</oai:header>
|
48 |
|
|
<xsl:choose>
|
49 |
|
|
<xsl:when test="count(/*[local-name() = 'record']/*[local-name() = 'metadata']) > 0">
|
50 |
|
|
<xsl:copy-of select="/*[local-name() = 'record']/*[local-name() = 'metadata']"/>
|
51 |
|
|
</xsl:when>
|
52 |
31272
|
andrea.man
|
<xsl:when test="\$status = 'deleted'" />
|
53 |
31255
|
andrea.man
|
<xsl:otherwise>
|
54 |
|
|
<oai:metadata>
|
55 |
|
|
<xsl:copy-of select="."/>
|
56 |
|
|
</oai:metadata>
|
57 |
|
|
</xsl:otherwise>
|
58 |
|
|
</xsl:choose>
|
59 |
31278
|
alessia.ba
|
<xsl:if test="not(\$status) or \$status != 'deleted'">
|
60 |
31255
|
andrea.man
|
<about>
|
61 |
34843
|
andrea.man
|
<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">
|
62 |
|
|
<originDescription harvestDate="{\$datestamp}" altered="true">
|
63 |
|
|
<baseURL>$baseurl$</baseURL>
|
64 |
34849
|
andrea.man
|
<identifier><xsl:value-of select="//*[local-name()='header']/*[local-name()='identifier']"/></identifier>
|
65 |
34843
|
andrea.man
|
<datestamp><xsl:value-of select="//*[local-name()='header']/*[local-name()='datestamp']"/></datestamp>
|
66 |
|
|
<metadataNamespace>$metadatanamespace$</metadataNamespace>
|
67 |
|
|
<xsl:copy-of select="//*[local-name()='provenance']/*[local-name() = 'originDescription']"/>
|
68 |
|
|
</originDescription>
|
69 |
|
|
</provenance>
|
70 |
31255
|
andrea.man
|
<oaf:datainfo>
|
71 |
|
|
<oaf:inferred>$inferred$</oaf:inferred>
|
72 |
|
|
<oaf:deletedbyinference>$deletedbyinference$</oaf:deletedbyinference>
|
73 |
|
|
<oaf:trust>$trust$</oaf:trust>
|
74 |
|
|
<oaf:inferenceprovenance>$inferenceprovenance$</oaf:inferenceprovenance>
|
75 |
|
|
<oaf:provenanceaction schemename="dnet:provenanceActions" schemeid="dnet:provenanceActions" classname="$provenanceactionclassname$" classid="$provenanceactionclassid$"/>
|
76 |
|
|
</oaf:datainfo>
|
77 |
|
|
</about>
|
78 |
|
|
</xsl:if>
|
79 |
|
|
</oai:record>
|
80 |
|
|
</xsl:template>
|
81 |
|
|
|
82 |
30840
|
claudio.at
|
</xsl:stylesheet>
|