Skip to content

Commit

Permalink
Merge pull request #26 from ga-gn/ecat3.10-doi
Browse files Browse the repository at this point in the history
Fix after Martin review
  • Loading branch information
josephjohn136 committed Aug 23, 2020
2 parents f32b383 + a9d6546 commit c906d47
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<!-- TODO: Convert language code eng > en_US ? -->
<xsl:variable name="metadataLanguage" select="//mdb:MD_Metadata/mdb:defaultLocale/*/lan:language/*/@codeListValue" />

<xsl:variable name="creatorRoles" select="'pointOfContact', 'custodian'" />
<xsl:variable name="creatorRoles" select="'pointOfContact', 'custodian', 'author', 'coAuthor'" />
<xsl:variable name="authorRoles" select="'author', 'coAuthor'" />

<xsl:variable name="dateMapping">
Expand All @@ -77,18 +77,23 @@
"resourceType": "<xsl:value-of select="concat(upper-case(substring(mdb:metadataScope/*/mdb:resourceScope/*/@codeListValue, 1, 1)), substring(mdb:metadataScope/*/mdb:resourceScope/*/@codeListValue, 2))" />"
},
"creators": [
<xsl:for-each select="mdb:identificationInfo/*/mri:pointOfContact/*">
<xsl:variable name="creatorRolesCount" select="count(mdb:identificationInfo/*/mri:pointOfContact/*/cit:role/*/@codeListValue = ($creatorRoles) and exists(mdb:identificationInfo/*/mri:pointOfContact/*/cit:party/cit:CI_Individual))"/>
<xsl:message>Creator Role count: <xsl:value-of select="$creatorRolesCount"/></xsl:message>

<xsl:for-each select="mdb:identificationInfo/*/mri:pointOfContact/* | mdb:identificationInfo/*/mri:citation/*/cit:citedResponsibleParty/*">
<xsl:if test="cit:role/*/@codeListValue = ($creatorRoles) and exists(cit:party/cit:CI_Individual)">
{
<xsl:variable name="name" select="cit:party/cit:CI_Individual/cit:name/*/text()" />
<xsl:call-template name="creator">
<xsl:with-param name="name" select="$name" />
</xsl:call-template>
},
}
<xsl:if test="position() != last()">,</xsl:if>
</xsl:if>
</xsl:for-each>

<xsl:for-each select="mdb:identificationInfo/*/mri:citation/*/cit:citedResponsibleParty/*">

<!--<xsl:for-each select="mdb:identificationInfo/*/mri:citation/*/cit:citedResponsibleParty/*">
<xsl:if
test="cit:role/*/@codeListValue = ($authorRoles) and exists(cit:party/cit:CI_Individual)">
{
Expand All @@ -100,7 +105,7 @@
<xsl:if test="position() != last()">,</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:for-each>-->
],
"titles": [
<xsl:for-each select="mdb:identificationInfo/*/mri:citation/*/cit:title">
Expand All @@ -111,7 +116,7 @@
</xsl:for-each>
],
<xsl:for-each select="//cit:CI_Organisation[../parent::cit:CI_Responsibility[cit:role/*/@codeListValue = 'publisher']]">
<xsl:if test="position() = 1">
<xsl:if test="position() = 1">
"publisher":"<xsl:value-of select="cit:name/gco:CharacterString" />",
</xsl:if>
</xsl:for-each>
Expand Down

0 comments on commit c906d47

Please sign in to comment.