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

add profession and fix trailing comma

parent be9a690c
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
xsi:noNamespaceSchemaLocation="datamodel-viaf.xsd"> xsi:noNamespaceSchemaLocation="datamodel-viaf.xsd">
<structure/> <structure/>
<metadata> <metadata>
<!-- preferredName --> <!-- preferredName -->
<def.preferredName class="MCRMetaPersonName" heritable="false" notinherit="true"> <def.preferredName class="MCRMetaPersonName" heritable="false" notinherit="true">
<xsl:for-each select="/marcxml:record/marcxml:datafield[@tag='100']"> <xsl:for-each select="/marcxml:record/marcxml:datafield[@tag='100']">
...@@ -36,18 +37,27 @@ ...@@ -36,18 +37,27 @@
</title> </title>
</xsl:if> </xsl:if>
<xsl:if test="@ind1 = '1' and marcxml:subfield[@code = 'a']"> <xsl:if test="@ind1 = '1' and marcxml:subfield[@code = 'a']">
<xsl:variable name="namestring" select="marcxml:subfield[@code = 'a']/text()"/>
<fullname> <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> </fullname>
</xsl:if> </xsl:if>
</preferredName> </preferredName>
</xsl:for-each> </xsl:for-each>
</def.preferredName> </def.preferredName>
<!-- variantName --> <!-- variantName -->
<xsl:if test="/marcxml:record/marcxml:datafield[@tag='400']"> <xsl:if test="/marcxml:record/marcxml:datafield[@tag='400']">
<def.variantName class="MCRMetaPersonName" heritable="false" notinherit="true"> <def.variantName class="MCRMetaPersonName" heritable="false" notinherit="true">
<xsl:for-each select="/marcxml:record/marcxml:datafield[@tag='400']"> <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:if test="@ind1 = '0' and marcxml:subfield[@code = 'a']">
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
<xsl:variable name="language" select="ld:detectLanguageByCharacter(marcxml:subfield[@code = 'a']/text())"/> <xsl:variable name="language" select="ld:detectLanguageByCharacter(marcxml:subfield[@code = 'a']/text())"/>
...@@ -86,30 +96,42 @@ ...@@ -86,30 +96,42 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>
<fullname> <xsl:variable name="namestring" select="marcxml:subfield[@code = 'a']/text()"/>
<xsl:value-of select="marcxml:subfield[@code = 'a']/text()"/> <fullname>
</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> </xsl:if>
</variantName> </variantName>
</xsl:for-each> </xsl:for-each>
</def.variantName> </def.variantName>
</xsl:if> </xsl:if>
<!-- recordType --> <!-- recordType -->
<def.recordType class="MCRMetaLangText" heritable="false" notinherit="true"> <def.recordType class="MCRMetaLangText" heritable="false" notinherit="true">
<recordType inherited="0" xml:lang="en"> <recordType inherited="0" xml:lang="en">
<xsl:value-of select="'person'"/> <xsl:value-of select="'person'"/>
</recordType> </recordType>
</def.recordType> </def.recordType>
<!-- recordSource --> <!-- recordSource -->
<def.recordSource class="MCRMetaClassification" heritable="false" notinherit="true"> <def.recordSource class="MCRMetaClassification" heritable="false" notinherit="true">
<recordSource inherited="0" classid="viafRecordSource" categid="lcnaf"/> <recordSource inherited="0" classid="viafRecordSource" categid="lcnaf"/>
</def.recordSource> </def.recordSource>
<!-- identifier --> <!-- identifier -->
<def.identifier class="MCRMetaLangText" heritable="false" notinherit="true"> <def.identifier class="MCRMetaLangText" heritable="false" notinherit="true">
<identifier inherited="0" xml:lang="en" type="lcnaf"> <identifier inherited="0" xml:lang="en" type="lcnaf">
<xsl:value-of select="$identifier"/> <xsl:value-of select="$identifier"/>
</identifier> </identifier>
</def.identifier> </def.identifier>
<!-- sex --> <!-- sex -->
<xsl:if test="/marcxml:record/marcxml:datafield[@tag='375']/marcxml:subfield[@code='a']"> <xsl:if test="/marcxml:record/marcxml:datafield[@tag='375']/marcxml:subfield[@code='a']">
<def.sex class="MCRMetaClassification" heritable="false" notinherit="true"> <def.sex class="MCRMetaClassification" heritable="false" notinherit="true">
...@@ -134,6 +156,18 @@ ...@@ -134,6 +156,18 @@
</sex> </sex>
</def.sex> </def.sex>
</xsl:if> </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 --> <!-- xml of lcnaf as marc21 -->
<def.lcnafxml class="MCRMetaXML" heritable="false" notinherit="true"> <def.lcnafxml class="MCRMetaXML" heritable="false" notinherit="true">
<lcnafxml inherited="0"> <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