Skip to content

Commit

Permalink
made corrections for @from and @to on <biblScope>
Browse files Browse the repository at this point in the history
  • Loading branch information
tillgrallert committed Feb 7, 2017
1 parent 51e9de7 commit 0bcbbc7
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/oclc_4770057679-i_60.TEIP5.xml
Expand Up @@ -66,7 +66,7 @@
<pubPlace xml:lang="en"> <placeName xml:lang="ar">دمشق</placeName> <placeName xml:lang="en">Damascus</placeName> </pubPlace>
<date type="official" xml:lang="ar-Latn-x-ijmes" when-custom="1329-01-01" datingMethod="#cal_islamic" calendar="#cal_islamic" when="1911-01-02">1 Muḥ 1329</date>
</imprint>
<biblScope unit="volume" n="6"/>
<biblScope unit="volume" from="6" to="6"/>
<biblScope unit="issue" n="1"/>
<biblScope unit="page" from="1" to="88"/>
</monogr>
Expand Down
36 changes: 34 additions & 2 deletions xslt-boilerplate/teibp_bibl.xsl
Expand Up @@ -26,9 +26,41 @@
<title>
<xsl:value-of select="$vgPublicationTitle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@n"/>
<!-- include @from and @to -->
<xsl:choose>
<!-- test for singular item -->
<xsl:when test="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@from = $vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@to">
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@from"/>
</xsl:when>
<!-- test for range -->
<xsl:when test="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@from != $vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@to">
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@from"/>
<xsl:text>–</xsl:text>
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@to"/>
</xsl:when>
<!-- default to @n -->
<xsl:otherwise>
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'volume']/@n"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>(</xsl:text>
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@n"/>
<!-- include @from and @to -->
<xsl:choose>
<!-- test for singular item -->
<xsl:when test="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@from = $vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@to">
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@from"/>
</xsl:when>
<!-- test for range -->
<xsl:when test="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@from != $vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@to">
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@from"/>
<xsl:text>–</xsl:text>
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@to"/>
</xsl:when>
<!-- default to @n -->
<xsl:otherwise>
<xsl:value-of select="$vgBiblStructSource/tei:monogr/tei:biblScope[@unit = 'issue']/@n"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>) </xsl:text>
<!-- <xsl:value-of select="$vgPublicationDate"/> -->
</title>
Expand Down
36 changes: 34 additions & 2 deletions xslt-boilerplate/teibp_sourcedesc.xsl
Expand Up @@ -62,7 +62,23 @@
<xsl:text>volume </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'volume']/@n"/>
<!-- include @from and @to -->
<xsl:choose>
<!-- test for singular item -->
<xsl:when test="parent::tei:monogr/tei:biblScope[@unit = 'volume']/@from = parent::tei:monogr/tei:biblScope[@unit = 'volume']/@to">
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'volume']/@from"/>
</xsl:when>
<!-- test for range -->
<xsl:when test="parent::tei:monogr/tei:biblScope[@unit = 'volume']/@from != parent::tei:monogr/tei:biblScope[@unit = 'volume']/@to">
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'volume']/@from"/>
<xsl:text>–</xsl:text>
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'volume']/@to"/>
</xsl:when>
<!-- default to @n -->
<xsl:otherwise>
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'volume']/@n"/>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:if>
<xsl:if test="parent::tei:monogr/tei:biblScope[@unit = 'issue']">
Expand All @@ -79,7 +95,23 @@
<xsl:text>issue </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'issue']/@n"/>
<!-- include @from and @to -->
<xsl:choose>
<!-- test for singular item -->
<xsl:when test="parent::tei:monogr/tei:biblScope[@unit = 'issue']/@from = parent::tei:monogr/tei:biblScope[@unit = 'issue']/@to">
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'issue']/@from"/>
</xsl:when>
<!-- test for range -->
<xsl:when test="parent::tei:monogr/tei:biblScope[@unit = 'issue']/@from != parent::tei:monogr/tei:biblScope[@unit = 'issue']/@to">
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'issue']/@from"/>
<xsl:text>–</xsl:text>
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'issue']/@to"/>
</xsl:when>
<!-- default to @n -->
<xsl:otherwise>
<xsl:value-of select="parent::tei:monogr/tei:biblScope[@unit = 'issue']/@n"/>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:if>
<xsl:if test="parent::tei:monogr/tei:biblScope[@unit = 'page']">
Expand Down

0 comments on commit 0bcbbc7

Please sign in to comment.