Commit bf8f6032 authored by jerome's avatar jerome
Browse files

chg in xslt for scrape all lit data

parent 8f397b84
......@@ -202,6 +202,7 @@ Refer to comments in the code to understand the used algorithm.
</xsl:for-each>
</xsl:template>
<!--Doctype Literature scraped from body/listBibl for each bibl tag in body; -->
<xsl:template match="//body/listBibl">
<xsl:for-each select="bibl">
<doc>
......@@ -223,7 +224,7 @@ Refer to comments in the code to understand the used algorithm.
</xsl:for-each>
<xsl:for-each select="author">
<field name="literature_author">
<xsl:value-of select="."/>
<xsl:value-of select="./normalize-space()"/>
</field>
</xsl:for-each>
<xsl:for-each select="editor">
......@@ -231,29 +232,70 @@ Refer to comments in the code to understand the used algorithm.
<xsl:value-of select="./normalize-space()"/>
</field>
</xsl:for-each>
<field name="title">
<xsl:for-each select="title">
<xsl:value-of select="./normalize-space()"/><xsl:text></xsl:text>
</xsl:for-each>
<!-- TITLE SHIT -->
<xsl:choose>
<xsl:when test="title/@level = 'm'">
<field name="title" level= 'm' type = 'main'>
<xsl:value-of select="title[@type='main']/normalize-space()"/>
</field>
<field name="title" level= 'm' type = 'sub'>
<xsl:value-of select="title[@type='sub']/normalize-space()"/>
</field>
</xsl:when>
<xsl:when test="title/@level = 's'">
<field name="title" level= 's' type = 'main'>
<xsl:value-of select="title[@type='main']/normalize-space()"/>
</field>
<field name="title" level= 's' type = 'sub'>
<xsl:value-of select="title[@type='sub']/normalize-space()"/>
</field>
</xsl:when>
<xsl:when test="title/@level = 'j'">
<field name="title" level = "j">
<xsl:value-of select="title[@type='main']/normalize-space()"/>
</field>
<field name="title" level= 'j' type = 'sub'>
<xsl:value-of select="title[@type='sub']/normalize-space()"/>
</field>
</xsl:when>
<xsl:when test="title/@level = 'a'">
<field name="title" level = 'a'>
<xsl:value-of select="title[@type='main']/normalize-space()"/>
</field>
</xsl:when>
<xsl:when test="title/@level = '' and @type='sub'">
<field name="title" level = 'a' type='sub' >
<xsl:value-of select="title[@type='sub']/normalize-space()"/>
</field>
</xsl:when>
<xsl:when test="title/@level = 'm' ">
<field name="title" level = 'm' >
<xsl:value-of select="title[@type='main']/normalize-space()"/>
</field>
</xsl:when>
</xsl:choose>
<xsl:if test="edition!=''">
<field name="edition">
<xsl:value-of select="edition/normalize-space()"/>
</field>
</xsl:if>
<field name="pub_place">
<xsl:value-of select="pubPlace/name"/>
<xsl:value-of select="pubPlace/name/normalize-space()"/>
</field>
<field name="extent">
<xsl:value-of select="extent/normalize-space()"/>
</field>
<field name="publisher">
<xsl:value-of select="publisher/normalize-space()"/>
</field>
<xsl:if test="date/@type='pub'">
<field name="pub_date">
<xsl:value-of select="date"/>
<xsl:value-of select="date/normalize-space()"/>
</field>
</xsl:if>
<field name="idno">
<xsl:value-of select="idno"/>
<xsl:value-of select="idno/normalize-space()"/>
</field>
</doc>
</xsl:for-each>
......@@ -418,44 +460,7 @@ Refer to comments in the code to understand the used algorithm.
<xsl:choose>
<xsl:when test="contains(document-uri(/), 'Lit')">
<field name="doctype">literature_meta</field>
<!--
<field name="doctype">literature</field>
<xsl:for-each select="//listBibl/bibl">
<xsl:if test="relatedItem/@type='print'">
<field name="type_refs">
<xsl:value-of select="./relatedItem/@type"/>
</field>
<xsl:choose>
<xsl:when test="./relatedItem/ref/@target">
<xsl:for-each select="./relatedItem/bibl/ref/@target">
<field name="target">
<xsl:value-of select="substring-after(./relatedItem/ref/@target, 'http://fbl_bln/Lit/')" />
</field>
</xsl:for-each>
</xsl:when>
<xsl:when test="./relatedItem/bibl/ref/@target">
<xsl:for-each select="./relatedItem/bibl/ref/@target">
<field name="target">
<xsl:value-of select="substring-after(., 'http://fbl_bln/Lit/')" />
</field>
</xsl:for-each>
</xsl:when>
</xsl:choose>
<field name="ref_refs">
<xsl:value-of select="./relatedItem//ref/normalize-space()"/>
</field>
<xsl:if test="./relatedItem/bibl/text() != ''">
<field name="bibl_refs">
<xsl:value-of select="./relatedItem/bibl/text()/normalize-space()"/>
</field>
</xsl:if>
<field name="literature_refs">
<xsl:value-of select="./normalize-space()"/>
</field>
</xsl:if>
</xsl:for-each>
-->
</xsl:when>
<xsl:otherwise>
......
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