Commit d9928e12 authored by Klaus Rettinghaus's avatar Klaus Rettinghaus
Browse files

add profession and fix trailing comma

parent be9a690c
......@@ -16,6 +16,7 @@
xsi:noNamespaceSchemaLocation="datamodel-viaf.xsd">
<structure/>
<metadata>
<!-- preferredName -->
<def.preferredName class="MCRMetaPersonName" heritable="false" notinherit="true">
<xsl:for-each select="/marcxml:record/marcxml:datafield[@tag='100']">
......@@ -36,18 +37,27 @@
</title>
</xsl:if>
<xsl:if test="@ind1 = '1' and marcxml:subfield[@code = 'a']">
<xsl:variable name="namestring" select="marcxml:subfield[@code = 'a']/text()"/>
<fullname>
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()"/>
<xsl:choose>
<xsl:when test="substring($namestring, string-length($namestring), 1) = ','">
<xsl:value-of select="substring($namestring, 1, string-length($namestring) - 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$namestring"/>
</xsl:otherwise>
</xsl:choose>
</fullname>
</xsl:if>
</preferredName>
</xsl:for-each>
</def.preferredName>
<!-- variantName -->
<xsl:if test="/marcxml:record/marcxml:datafield[@tag='400']">
<def.variantName class="MCRMetaPersonName" heritable="false" notinherit="true">
<xsl:for-each select="/marcxml:record/marcxml:datafield[@tag='400']">
<variantName inherited="0">
<variantName inherited="0" type="lcnaf">
<xsl:if test="@ind1 = '0' and marcxml:subfield[@code = 'a']">
<xsl:attribute name="xml:lang">
<xsl:variable name="language" select="ld:detectLanguageByCharacter(marcxml:subfield[@code = 'a']/text())"/>
......@@ -86,30 +96,42 @@
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<fullname>
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()"/>
</fullname>
<xsl:variable name="namestring" select="marcxml:subfield[@code = 'a']/text()"/>
<fullname>
<xsl:choose>
<xsl:when test="substring($namestring, string-length($namestring), 1) = ','">
<xsl:value-of select="substring($namestring, 1, string-length($namestring) - 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$namestring"/>
</xsl:otherwise>
</xsl:choose>
</fullname>
</xsl:if>
</variantName>
</xsl:for-each>
</def.variantName>
</xsl:if>
<!-- recordType -->
<def.recordType class="MCRMetaLangText" heritable="false" notinherit="true">
<recordType inherited="0" xml:lang="en">
<xsl:value-of select="'person'"/>
</recordType>
</def.recordType>
<!-- recordSource -->
<def.recordSource class="MCRMetaClassification" heritable="false" notinherit="true">
<recordSource inherited="0" classid="viafRecordSource" categid="lcnaf"/>
</def.recordSource>
<!-- identifier -->
<def.identifier class="MCRMetaLangText" heritable="false" notinherit="true">
<identifier inherited="0" xml:lang="en" type="lcnaf">
<xsl:value-of select="$identifier"/>
</identifier>
</def.identifier>
<!-- sex -->
<xsl:if test="/marcxml:record/marcxml:datafield[@tag='375']/marcxml:subfield[@code='a']">
<def.sex class="MCRMetaClassification" heritable="false" notinherit="true">
......@@ -134,6 +156,18 @@
</sex>
</def.sex>
</xsl:if>
<!-- profession -->
<xsl:if test="/marcxml:record/marcxml:datafield[@tag='374']/marcxml:subfield[@code='a']">
<def.profession class="MCRMetaLangText" heritable="false" notinherit="true">
<xsl:for-each select="/marcxml:record/marcxml:datafield[@tag='374']/marcxml:subfield[@code='a']">
<profession inherited="0" xml:lang="en" type="lcnaf">
<xsl:value-of select="text()" />
</profession>
</xsl:for-each>
</def.profession>
</xsl:if>
<!-- xml of lcnaf as marc21 -->
<def.lcnafxml class="MCRMetaXML" heritable="false" notinherit="true">
<lcnafxml inherited="0">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment