Skip to content

Commit

Permalink
Merge pull request #718 from metanorma/jis_update
Browse files Browse the repository at this point in the history
JIS xslt updated for dl footnotes, metanorma/metanorma-jis#192
  • Loading branch information
Intelligent2013 authored Jul 11, 2024
2 parents 82f9394 + b8afc13 commit 838373e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
9 changes: 9 additions & 0 deletions xslt_src/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9925,6 +9925,15 @@
<xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/>
</xsl:if>

<xsl:if test="$namespace = 'jis'">
<!-- display footnotes after after upper-level `dl` -->
<xsl:if test="not(ancestor::*[local-name() = 'dl'])">
<xsl:for-each select=".//jis:fn[generate-id(.)=generate-id(key('kfn',@reference)[1])]">
<xsl:call-template name="fn_jis"/>
</xsl:for-each>
</xsl:if>
</xsl:if>

</xsl:template> <!-- END: dl -->

<xsl:template name="refine_dl_formula_where_style">
Expand Down
45 changes: 25 additions & 20 deletions xslt_src/jis.international-standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
xmlns:java="http://xml.apache.org/xalan/java"
xmlns:jeuclid="http://jeuclid.sf.net/ns/ext"
xmlns:barcode="http://barcode4j.krysalis.org/ns"
xmlns:redirect="http://xml.apache.org/xalan/redirect"
exclude-result-prefixes="java"
extension-element-prefixes="redirect"
version="1.0">

<xsl:output method="xml" encoding="UTF-8" indent="no"/>
Expand Down Expand Up @@ -1320,29 +1322,32 @@
<debug><ancestor><xsl:value-of select="$ancestor"/></ancestor></debug> -->

<xsl:if test="$ancestor_tree//item[last()][. = $ancestor]">
<fo:block-container margin-left="11mm" margin-bottom="4pt" id="{@ref_id}">

<xsl:if test="position() = last()">
<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
</xsl:if>
<fo:block-container margin-left="0mm">
<fo:list-block provisional-distance-between-starts="10mm">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block xsl:use-attribute-sets="note-name-style">注 <fo:inline xsl:use-attribute-sets="fn-num-style"><xsl:value-of select="@current_fn_number"/><fo:inline font-weight="normal">)</fo:inline></fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates />
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</fo:block-container>
</fo:block-container>
<xsl:call-template name="fn_jis"/>
</xsl:if>
</xsl:template>

<xsl:template name="fn_jis">
<fo:block-container margin-left="11mm" margin-bottom="4pt" id="{@ref_id}">
<xsl:if test="position() = last()">
<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
</xsl:if>
<fo:block-container margin-left="0mm">
<fo:list-block provisional-distance-between-starts="10mm">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block xsl:use-attribute-sets="note-name-style">注 <fo:inline xsl:use-attribute-sets="fn-num-style"><xsl:value-of select="@current_fn_number"/><fo:inline font-weight="normal">)</fo:inline></fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates />
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</fo:block-container>
</fo:block-container>
</xsl:template>

<xsl:template match="*[local-name() = 'span'][@class = 'surname' or @class = 'givenname' or @class = 'JIS' or @class = 'EffectiveYear' or @class = 'CommentaryEffectiveYear']" mode="update_xml_step1" priority="2">
<xsl:copy>
<xsl:apply-templates select="@* | node()" mode="update_xml_step1"/>
Expand Down

0 comments on commit 838373e

Please sign in to comment.