Skip to content

Commit 417944f

Browse files
Merge pull request #801 from metanorma/jis_update
JIS xslt updated for footnotes, metanorma/laozi#7
2 parents 64d5375 + 7cbac6a commit 417944f

File tree

2 files changed

+99
-7
lines changed

2 files changed

+99
-7
lines changed

xslt_src/common.xsl

+91-7
Original file line numberDiff line numberDiff line change
@@ -5750,6 +5750,10 @@
57505750
<xsl:if test="not($vertical_layout = 'true')">
57515751
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
57525752
</xsl:if>
5753+
<xsl:if test="$vertical_layout = 'true'">
5754+
<xsl:attribute name="vertical-align">baseline</xsl:attribute>
5755+
<xsl:attribute name="font-size">100%</xsl:attribute>
5756+
</xsl:if>
57535757
</xsl:if>
57545758
</xsl:template> <!-- refine_fn-body-num-style -->
57555759

@@ -9237,6 +9241,16 @@
92379241
<xsl:otherwise><xsl:value-of select="$current_fn_number"/><xsl:text>)</xsl:text></xsl:otherwise>
92389242
</xsl:choose>
92399243
</xsl:when>
9244+
<xsl:when test="$namespace = 'jis'">
9245+
<xsl:choose>
9246+
<xsl:when test="$autonumbering_style = 'japanese'">
9247+
<xsl:text>&#x2008;</xsl:text>
9248+
<xsl:value-of select="$numbers_japanese//jis:localized-string[@key = $current_fn_number]"/>
9249+
<xsl:text>&#x2008;</xsl:text>
9250+
</xsl:when>
9251+
<xsl:otherwise><xsl:value-of select="$current_fn_number"/><fo:inline font-weight="normal">)</fo:inline></xsl:otherwise>
9252+
</xsl:choose>
9253+
</xsl:when>
92409254
<xsl:otherwise>
92419255
<xsl:value-of select="$current_fn_number"/>
92429256
</xsl:otherwise>
@@ -9246,9 +9260,6 @@
92469260
<xsl:text>)</xsl:text>
92479261
</xsl:if>
92489262
</xsl:if>
9249-
<xsl:if test="$namespace = 'jis'">
9250-
<fo:inline font-weight="normal">)</fo:inline>
9251-
</xsl:if>
92529263
</xsl:variable>
92539264

92549265
<xsl:variable name="ref_id">
@@ -9279,6 +9290,11 @@
92799290
<xsl:if test="not($vertical_layout = 'true')">
92809291
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
92819292
</xsl:if>
9293+
<xsl:if test="$vertical_layout = 'true'">
9294+
<xsl:attribute name="vertical-align">baseline</xsl:attribute>
9295+
<xsl:attribute name="font-size">80%</xsl:attribute>
9296+
<xsl:attribute name="baseline-shift">20%</xsl:attribute>
9297+
</xsl:if>
92829298
</xsl:if>
92839299
</fn_styles>
92849300
</xsl:otherwise>
@@ -9313,7 +9329,21 @@
93139329
<xsl:with-param name="element">
93149330
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
93159331
<fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
9332+
9333+
<xsl:if test="$namespace = 'jis'">
9334+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9335+
<xsl:call-template name="insertVerticalChar">
9336+
<xsl:with-param name="str" select="'&#x3014;'"/>
9337+
</xsl:call-template>
9338+
</xsl:if>
93169339
<xsl:copy-of select="$current_fn_number_text"/>
9340+
9341+
<xsl:if test="$namespace = 'jis'">
9342+
<xsl:call-template name="insertVerticalChar">
9343+
<xsl:with-param name="str" select="'&#x3015;'"/>
9344+
</xsl:call-template>
9345+
</xsl:if>
9346+
93179347
</fo:inline>
93189348
</fo:basic-link>
93199349
</xsl:with-param>
@@ -9334,20 +9364,74 @@
93349364
<fo:block role="SKIP">&#xa0;</fo:block>
93359365
</xsl:if>
93369366
</xsl:if>
9367+
93379368
<fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
93389369

9339-
<fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
9340-
9370+
<xsl:variable name="fn_block">
93419371
<xsl:call-template name="refine_fn-body-style"/>
9342-
9372+
93439373
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
93449374

93459375
<xsl:call-template name="refine_fn-body-num-style"/>
93469376

93479377
<xsl:value-of select="$current_fn_number_text"/>
9378+
93489379
</fo:inline>
93499380
<xsl:apply-templates />
9350-
</fo:block>
9381+
</xsl:variable>
9382+
9383+
<xsl:choose>
9384+
<xsl:when test="$namespace = 'jis'">
9385+
<xsl:choose>
9386+
<xsl:when test="$vertical_layout = 'true'">
9387+
<fo:list-block xsl:use-attribute-sets="fn-body-style" role="SKIP" provisional-distance-between-starts="25mm">
9388+
<xsl:call-template name="refine_fn-body-style"/>
9389+
<fo:list-item role="SKIP">
9390+
<fo:list-item-label start-indent="{$text_indent}mm" end-indent="label-end()" role="SKIP">
9391+
<fo:block role="SKIP">
9392+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
9393+
9394+
<xsl:call-template name="refine_fn-body-num-style"/>
9395+
9396+
<xsl:call-template name="insertVerticalChar">
9397+
<xsl:with-param name="str" select="'&#x3014;'"/>
9398+
</xsl:call-template>
9399+
9400+
<xsl:value-of select="$current_fn_number_text"/>
9401+
9402+
<xsl:call-template name="insertVerticalChar">
9403+
<xsl:with-param name="str" select="'&#x3015;'"/>
9404+
</xsl:call-template>
9405+
9406+
</fo:inline>
9407+
</fo:block>
9408+
</fo:list-item-label>
9409+
<fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="table-fn-body-style" role="SKIP">
9410+
<fo:block role="SKIP">
9411+
<xsl:apply-templates />
9412+
</fo:block>
9413+
</fo:list-item-body>
9414+
</fo:list-item>
9415+
</fo:list-block>
9416+
</xsl:when>
9417+
<xsl:otherwise>
9418+
<fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
9419+
<xsl:copy-of select="$fn_block"/>
9420+
</fo:block>
9421+
</xsl:otherwise>
9422+
</xsl:choose>
9423+
<!-- jis -->
9424+
</xsl:when>
9425+
<xsl:otherwise>
9426+
<fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
9427+
<xsl:copy-of select="$fn_block"/>
9428+
</fo:block>
9429+
</xsl:otherwise>
9430+
</xsl:choose>
9431+
9432+
9433+
9434+
93519435
</fo:block-container>
93529436
</fo:footnote-body>
93539437
</fo:footnote>

xslt_src/jis.international-standard.core.xsl

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
<xsl:variable name="vertical_layout" select="normalize-space(/*/jis:metanorma-extension/jis:presentation-metadata/jis:vertical-layout)"/>
3131
<xsl:variable name="vertical_layout_rotate_clause_numbers" select="normalize-space(/*/jis:metanorma-extension/jis:presentation-metadata/jis:vertical-layout-rotate-clause-numbers)"/>
3232

33+
<xsl:variable name="autonumbering_style" select="normalize-space(/*/jis:metanorma-extension/jis:presentation-metadata/jis:autonumbering-style)"/>
34+
35+
<xsl:variable name="numbers_japanese_">
36+
<xsl:copy-of select="/*/jis:localized-strings/jis:localized-string[starts-with(@key,'0') or starts-with(@key,'1') or starts-with(@key,'2') or starts-with(@key,'3') or
37+
starts-with(@key,'4') or starts-with(@key,'5') or starts-with(@key,'6') or starts-with(@key,'7') or starts-with(@key,'8') or starts-with(@key,'9')]"/>
38+
</xsl:variable>
39+
<xsl:variable name="numbers_japanese" select="xalan:nodeset($numbers_japanese_)"/>
40+
3341
<xsl:variable name="contents_">
3442
<xsl:variable name="bundle" select="count(//jis:jis-standard) &gt; 1"/>
3543

0 commit comments

Comments
 (0)