Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER
4
                value="0ef0ac75-0eba-4291-956e-afb762c351b6_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
5
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
6
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
7
        <RESOURCE_URI value=""/>
8
        <DATE_OF_CREATION value="2014-11-19T11:05:55+01:00"/>
9
    </HEADER>
10
    <BODY>
11
        <CONFIGURATION>
12
            <IMPORTED/>
13
            <SCRIPT>
14
                <TITLE>WDS: OAI_Datacite to DMF transform</TITLE>
15
                <CODE><![CDATA[
16
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
	xmlns:dnet="eu.dnetlib.wds.utils.WDSUtils"
18
	xmlns:dri="http://www.driver-repository.eu/namespace/dri"
19
    xmlns:oaf="http://namespace.dnet.eu/oaf" version="2.0" exclude-result-prefixes="xsl dnet">
20
    <xsl:template match="/">
21
        <xsl:choose>
22
            <xsl:when test="not(//*[lower-case(local-name()) = 'metadata'])">
23
                <record/>
24
            </xsl:when>
25
            <xsl:otherwise>
26
                <xsl:apply-templates mode="wds"></xsl:apply-templates>
27
            </xsl:otherwise>
28
        </xsl:choose>
29
    </xsl:template>
30

    
31
    <xsl:template match="@*|node()" mode="wds">
32
        <xsl:copy>
33
            <xsl:apply-templates select="@*|node()" mode="wds"/>
34
        </xsl:copy>
35
    </xsl:template>
36

    
37
    <xsl:template match="*[local-name()='relatedIdentifier']" mode="wds">
38
         <xsl:choose>
39
            <xsl:when test="string-length(normalize-space(./@relatedIdentifierType)) &gt; 0 and string-length(normalize-space(./@relationType)) &gt; 0 and string-length(normalize-space(.)) &gt; 0">
40
                <relatedIdentifier>
41
                    <xsl:attribute name="relatedIdentifierType"><xsl:value-of select="./@relatedIdentifierType"/></xsl:attribute>
42
                    <xsl:attribute name="relationType"><xsl:value-of select="dnet:normalizeRelation(./@relationType)"/></xsl:attribute>
43
                    <xsl:attribute name="inverseRelationType"><xsl:value-of select="dnet:getInverse(./@relationType)"/></xsl:attribute>
44
                    <xsl:value-of select="."/>
45
                </relatedIdentifier>
46
            </xsl:when>
47
        </xsl:choose>
48
    </xsl:template>
49

    
50
</xsl:stylesheet>
51
]]>
52
                </CODE>
53
            </SCRIPT>
54
        </CONFIGURATION>
55
        <STATUS/>
56
        <SECURITY_PARAMETERS/>
57
    </BODY>
58
</RESOURCE_PROFILE>
(2-2/2)