...
 
Commits (3)
......@@ -50,7 +50,10 @@ Refer to comments in the code to understand the used algorithm.
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="http://www.tei-c.org/ns/1.0" xmlns:gfl="http://sub.gfl.de"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="gfl saxon xs">
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="gfl saxon xs"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
xmlns:marc="http://www.loc.gov/MARC21/slim">
<xsl:output method="xml" indent="yes" saxon:suppress-indentation="div" />
<xsl:strip-space elements="*" />
......@@ -88,11 +91,93 @@ Refer to comments in the code to understand the used algorithm.
</field>
<field name="id">
<xsl:value-of select="."/>
</field>
</field>
<xsl:variable name="gnd_number">
<xsl:value-of select="substring-after(., 'gnd:')"/>
</xsl:variable>
<xsl:variable name="uri_path">
<xsl:value-of select="concat('http://d-nb.info/gnd/', $gnd_number, '/about/marcxml')"/>
</xsl:variable>
<xsl:apply-templates select="doc($uri_path)/marc:record" />
</doc>
</xsl:if>
</xsl:template>
<xsl:template match="marc:record">
<xsl:choose>
<xsl:when test="marc:datafield[@tag='100']">
<field name="mostly_use_name">
<xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
</field>
</xsl:when>
<xsl:when test="marc:datafield[@tag='110']">
<field name="mostly_use_name">
<xsl:value-of select="marc:datafield[@tag='110']/marc:subfield[@code='a']"/>
</field>
</xsl:when>
<xsl:when test="marc:datafield[@tag='111']">
<field name="mostly_use_name">
<xsl:value-of select="marc:datafield[@tag='111']/marc:subfield[@code='a']"/>
</field>
</xsl:when>
<xsl:when test="marc:datafield[@tag='130']">
<field name="mostly_use_name">
<xsl:value-of select="marc:datafield[@tag='130']/marc:subfield[@code='a']"/>
</field>
</xsl:when>
<xsl:when test="marc:datafield[@tag='150']">
<field name="mostly_use_name">
<xsl:value-of select="marc:datafield[@tag='150']"/>
</field>
</xsl:when>
<xsl:when test="marc:datafield[@tag='151']">
<field name="mostly_use_name">
<xsl:value-of select="marc:datafield[@tag='151']"/>
</field>
</xsl:when>
</xsl:choose>
<xsl:for-each select="marc:datafield[@tag='400']">
<field name="alternatively_name">
<xsl:value-of select="marc:subfield[@code='a']"/>
</field>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='410']">
<field name="alternatively_name">
<xsl:value-of select="marc:subfield[@code='a']"/>
<xsl:text> </xsl:text>
<xsl:value-of select="marc:subfield[@code='b']"/>
</field>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='430']">
<field name="alternatively_name">
<xsl:value-of select="marc:subfield[@code='a']"/><xsl:text></xsl:text>
<xsl:value-of select="marc:subfield[@code='g']"/><xsl:text></xsl:text>
<xsl:value-of select="marc:subfield[@code='n']"/>
</field>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='451']">
<field name="alternatively_name">
<xsl:value-of select="marc:subfield[@code='a']"/>
</field>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='034']">
<field name="west_cordinate">
<xsl:value-of select="marc:subfield[@code='e']"/>
</field>
<field name="east_cordinate">
<xsl:value-of select="marc:subfield[@code='e']"/>
</field>
<field name="north_cordinate">
<xsl:value-of select="marc:subfield[@code='f']"/>
</field>
<field name="south_cordinate">
<xsl:value-of select="marc:subfield[@code='g']"/>
</field>
</xsl:for-each>
</xsl:template>
<xsl:template match="listBibl">
<xsl:for-each select="bibl">
<doc>
......@@ -334,24 +419,7 @@ Refer to comments in the code to understand the used algorithm.
</field>
</xsl:for-each>
</xsl:when>
</xsl:choose>
<!--xsl:choose>
<xsl:when test="./relatedItem/ref/@target">
<xsl:variable name="targetString" select="substring-after(./relatedItem/ref/@target, 'http://fbl_bln/Lit/')"/>
<field name="target">
<xsl:value-of select="$targetString" />
</field>
</xsl:when>
<xsl:when test="./relatedItem/bibl/ref/@target">
<xsl:variable name="targetString_bibl" select="substring-after(./relatedItem/bibl/ref/@target, 'http://fbl_bln/Lit/')"/>
<field name="target">
<xsl:value-of select="$targetString_bibl" />
</field>
</xsl:when>
</xsl:choose-->
</xsl:choose>
<field name="ref_refs">
<xsl:value-of select="./relatedItem//ref/normalize-space()"/>
</field>
......
......@@ -55,9 +55,15 @@
<!-- 'article' or 'page' or 'literatur'-->
<field name="doctype" type="string" required="true"/>
<!-- for doctype 'entity' -->
<!-- for doctype 'entity' -->
<field name="entity_name" type="string_ci" multiValued="false"/>
<field name="mostly_use_name" type="string" />
<field name="alternatively_name" type="string" multiValued="true"/>
<field name="west_cordinate" type="string" multiValued="true"/>
<field name="east_cordinate" type="string" multiValued="true"/>
<field name="north_cordinate" type="string" multiValued="true"/>
<field name="south_cordinate" type="string" multiValued="true"/>
<!-- for doctype 'literature' -->
<field name="uri" type="string" multiValued="true"/>
<field name="literature_author" type="string" multiValued="true"/>
......