Skip to content

Commit

Permalink
UBO-287 Use xsl:key to speed up transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
fluetze authored and kkrebs committed Dec 18, 2023
1 parent 12f4659 commit 1123517
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ubo-common/src/main/resources/xsl/import/scopus2mods.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

<xsl:output method="xml" encoding="UTF-8" indent="yes" xalan:indent-amount="2" />

<xsl:key name="authors" match="author[@auid]" use="@auid" />
<xsl:key name="affiliation" match="affiliation[@afid]" use="@afid" />

<xsl:template match="scopus:abstracts-retrieval-response">
<mods:mods>
<xsl:apply-templates select="item/bibrecord/head/citation-info/citation-type/@code" />
Expand Down Expand Up @@ -61,7 +64,7 @@
<mods:roleTerm type="code" authority="marcrelator">aut</mods:roleTerm>
</mods:role>
<xsl:apply-templates select="scopus:affiliation" />
<xsl:apply-templates select="//author[@auid=current()/@auid][1]/ce:e-address[@type='email']" />
<xsl:apply-templates select="key('authors',@auid)[1]/ce:e-address[@type='email']" />
</mods:name>
</xsl:template>

Expand All @@ -72,7 +75,7 @@
</xsl:template>

<xsl:template match="scopus:affiliation">
<xsl:apply-templates select="//affiliation[@afid=current()/@id][1]" />
<xsl:apply-templates select="key('affiliation',@id)[1]" />
</xsl:template>

<xsl:template match="affiliation">
Expand Down

0 comments on commit 1123517

Please sign in to comment.