Project

General

Profile

« Previous | Next » 

Revision 42546

using OpenTrialsXsltFunction in mapping-utils

View differences:

modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/opentrials2datacite.xml
18 18
    xmlns:dri="http://www.driver-repository.eu/namespace/dri"
19 19
    xmlns:dr="http://www.driver-repository.eu/namespace/dr"
20 20
    xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
21
    extension-element-prefixes="TransformationFunction"
22
    exclude-result-prefixes="xsl TransformationFunction">
21
    xmlns:openTrials="eu.dnetlib.miscutils.functional.xml.OpenTrialsFunctions"
22
    extension-element-prefixes="TransformationFunction openTrials"
23
    exclude-result-prefixes="xsl TransformationFunction openTrials">
23 24

  
24 25
    <xsl:param name="varOfficialName"/>
25 26
    <xsl:param name="varDsType"/>
......
49 50

  
50 51
                    <!--
51 52
                        In order to the web URL to be properly set in the OAF final record, the main id must be an URL.
52
                        Primary and secondary ids can be set as alternate identifiers
53
                        Primary and secondary ids + identifiers can be set as alternate identifiers
53 54
                    -->
54
                    <identifier identifierType="URL">jsonProv.url</identifier>
55
                    <identifier identifierType="URL"> <xsl:value-of select="openTrials:getMainIdentifierURL(//column[@name = 'jsonProv']))"/></identifier>
55 56

  
57

  
56 58
                    <alternateIdentifiers>
57 59
                        <alternateIdentifier alternateIdentifierType="{//column[./@name='primary_register']/text()}">
58 60
                            <xsl:value-of select="//column[./@name = 'primary_id']/text()"/>
59 61
                        </alternateIdentifier>
60
                        <!-- TODO: handle other ids in alternateIdentifiers <column name="secondary_ids">{"others": null}</column> -->
62
                        <!--
63
                        TODO: handle other ids in alternateIdentifiers. For now secondary_ids are not of our concern (as said by Evgeny from OpenTrials)
64
                        But identifiers is relevant instead.
65
                        <column name="secondary_ids">{"others": null}</column>
66
                        <column name="identifiers">{NCT00972270, XXX}</column>
67
                        -->
68
                        <!-- remove '{' and '}' -->
69
                        <xsl:variable name="cleanedIds" select="replace(replace(//column[@name = 'identifiers'], '{', ''), '}', '')">
70
                        <xsl:for-each select="tokenize(cleanedIds,',')">
71
                            <alternateIdentifier><xsl:value-of select="normalize-space(.)"/></alternateIdentifier>
72
                        </xsl:for-each>
61 73
                    </alternateIdentifiers>
62 74
                    <!-- No creators available -->
63 75
                    <creators/>
......
77 89
                            </title>
78 90
                        </xsl:if>
79 91
                    </titles>
80
                    <publisher>use jsonProv.sourceName or OpenTrials</publisher>
92
                    <publisher><xsl:value-of select="//column[./@name='primary_register']/text()"/></publisher>
81 93
                    <resourceType resourceTypeGeneral="Trial">Trial</resourceType>
82 94
                    <descriptions>
83 95
                        <xsl:variable name="description"

Also available in: Unified diff