Skip to content
Snippets Groups Projects

fix(marc2pivot.xsl): correctly import firstnames even if there is no space after comma

Merged Nicolas.Rod requested to merge rodn-marc2pivot-trim-people-names into master
@@ -210,8 +210,8 @@
</role>
<xsl:choose>
<xsl:when test="contains(marc:subfield[@code='a'],',')">
<lastname><xsl:value-of select="substring-before(marc:subfield[@code='a'],',')"/></lastname>
<firstname><xsl:value-of select="substring-after(marc:subfield[@code='a'],', ')"/></firstname>
<lastname><xsl:value-of select="normalize-space(substring-before(marc:subfield[@code='a'],','))"/></lastname>
<firstname><xsl:value-of select="normalize-space(substring-after(marc:subfield[@code='a'],','))"/></firstname>
</xsl:when>
<xsl:otherwise>
<lastname><xsl:value-of select="marc:subfield[@code='a']"/></lastname>
@@ -229,8 +229,8 @@
<other_name>
<xsl:choose>
<xsl:when test="contains(.,',')">
<lastname><xsl:value-of select="substring-before(.,',')"/></lastname>
<firstname><xsl:value-of select="substring-after(.,', ')"/></firstname>
<lastname><xsl:value-of select="normalize-space(substring-before(.,','))"/></lastname>
<firstname><xsl:value-of select="normalize-space(substring-after(.,','))"/></firstname>
</xsl:when>
<xsl:otherwise>
<lastname><xsl:value-of select="."/></lastname>
@@ -248,8 +248,8 @@
<role><xsl:text>director</xsl:text></role>
<xsl:choose>
<xsl:when test="contains(marc:subfield[@code='a'],',')">
<lastname><xsl:value-of select="substring-before(marc:subfield[@code='a'],',')"/></lastname>
<firstname><xsl:value-of select="substring-after(marc:subfield[@code='a'],', ')"/></firstname>
<lastname><xsl:value-of select="normalize-space(substring-before(marc:subfield[@code='a'],','))"/></lastname>
<firstname><xsl:value-of select="normalize-space(substring-after(marc:subfield[@code='a'],','))"/></firstname>
</xsl:when>
<xsl:otherwise>
<lastname><xsl:value-of select="marc:subfield[@code='a']"/></lastname>
@@ -267,8 +267,8 @@
<other_name>
<xsl:choose>
<xsl:when test="contains(.,',')">
<lastname><xsl:value-of select="substring-before(.,',')"/></lastname>
<firstname><xsl:value-of select="substring-after(.,', ')"/></firstname>
<lastname><xsl:value-of select="normalize-space(substring-before(.,','))"/></lastname>
<firstname><xsl:value-of select="normalize-space(substring-after(.,','))"/></firstname>
</xsl:when>
<xsl:otherwise>
<lastname><xsl:value-of select="."/></lastname>
@@ -443,10 +443,10 @@
<xsl:when test="contains(marc:subfield[@code='a'],',')">
<classification>
<code>JEL</code>
<item><xsl:value-of select="substring-before(normalize-space(marc:subfield[@code='a']),',')"/></item>
<item><xsl:value-of select="normalize-space(substring-before(marc:subfield[@code='a'],','))"/></item>
</classification>
<xsl:call-template name="extraitJEL">
<xsl:with-param name="chaineJELS" select="substring-after(normalize-space(marc:subfield[@code='a']),',')"/>
<xsl:with-param name="chaineJELS" select="normalize-space(substring-after(marc:subfield[@code='a'],','))"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
@@ -849,7 +849,7 @@
<xsl:when test="contains($chaineJELS,',')">
<classification>
<code>JEL</code>
<item><xsl:value-of select="substring-before(normalize-space($chaineJELS),',')"/></item>
<item><xsl:value-of select="normalize-space(substring-before($chaineJELS,','))"/></item>
</classification>
<xsl:call-template name="extraitJEL">
<xsl:with-param name="chaineJELS" select="substring-after($chaineJELS,',')"/>
Loading