Commit bf8f6032 authored by jerome's avatar jerome
Browse files

chg in xslt for scrape all lit data

parent 8f397b84
...@@ -201,7 +201,8 @@ Refer to comments in the code to understand the used algorithm. ...@@ -201,7 +201,8 @@ Refer to comments in the code to understand the used algorithm.
</field> </field>
</xsl:for-each> </xsl:for-each>
</xsl:template> </xsl:template>
<!--Doctype Literature scraped from body/listBibl for each bibl tag in body; -->
<xsl:template match="//body/listBibl"> <xsl:template match="//body/listBibl">
<xsl:for-each select="bibl"> <xsl:for-each select="bibl">
<doc> <doc>
...@@ -223,7 +224,7 @@ Refer to comments in the code to understand the used algorithm. ...@@ -223,7 +224,7 @@ Refer to comments in the code to understand the used algorithm.
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="author"> <xsl:for-each select="author">
<field name="literature_author"> <field name="literature_author">
<xsl:value-of select="."/> <xsl:value-of select="./normalize-space()"/>
</field> </field>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="editor"> <xsl:for-each select="editor">
...@@ -231,29 +232,70 @@ Refer to comments in the code to understand the used algorithm. ...@@ -231,29 +232,70 @@ Refer to comments in the code to understand the used algorithm.
<xsl:value-of select="./normalize-space()"/> <xsl:value-of select="./normalize-space()"/>
</field> </field>
</xsl:for-each> </xsl:for-each>
<field name="title"> <!-- TITLE SHIT -->
<xsl:for-each select="title"> <xsl:choose>
<xsl:value-of select="./normalize-space()"/><xsl:text></xsl:text> <xsl:when test="title/@level = 'm'">
</xsl:for-each> <field name="title" level= 'm' type = 'main'>
</field> <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!=''"> <xsl:if test="edition!=''">
<field name="edition"> <field name="edition">
<xsl:value-of select="edition/normalize-space()"/> <xsl:value-of select="edition/normalize-space()"/>
</field> </field>
</xsl:if> </xsl:if>
<field name="pub_place"> <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>
<field name="publisher"> <field name="publisher">
<xsl:value-of select="publisher/normalize-space()"/> <xsl:value-of select="publisher/normalize-space()"/>
</field> </field>
<xsl:if test="date/@type='pub'"> <xsl:if test="date/@type='pub'">
<field name="pub_date"> <field name="pub_date">
<xsl:value-of select="date"/> <xsl:value-of select="date/normalize-space()"/>
</field> </field>
</xsl:if> </xsl:if>
<field name="idno"> <field name="idno">
<xsl:value-of select="idno"/> <xsl:value-of select="idno/normalize-space()"/>
</field> </field>
</doc> </doc>
</xsl:for-each> </xsl:for-each>
...@@ -418,44 +460,7 @@ Refer to comments in the code to understand the used algorithm. ...@@ -418,44 +460,7 @@ Refer to comments in the code to understand the used algorithm.
<xsl:choose> <xsl:choose>
<xsl:when test="contains(document-uri(/), 'Lit')"> <xsl:when test="contains(document-uri(/), 'Lit')">
<field name="doctype">literature_meta</field> <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:when>
<xsl:otherwise> <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