Skip to content

Commit

Permalink
Merge pull request #94 from metanorma/feature/xslt-update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jun 14, 2023
2 parents cdbe924 + f8faeaf commit 620214c
Showing 1 changed file with 61 additions and 31 deletions.
92 changes: 61 additions & 31 deletions lib/isodoc/jis/jis.international-standard.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -3446,7 +3446,7 @@
<xsl:param name="continued"/>
<xsl:if test="normalize-space() != ''">

<fo:block xsl:use-attribute-sets="table-name-style">
<fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">

<xsl:call-template name="refine_table-name-style">
<xsl:with-param name="continued" select="$continued"/>
Expand Down Expand Up @@ -3831,8 +3831,8 @@
<xsl:template name="table-header-title">
<xsl:param name="cols-count"/>
<!-- row for title -->
<fo:table-row>
<fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
<fo:table-row role="SKIP">
<fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black" role="SKIP">

<xsl:call-template name="refine_table-header-title-style"/>

Expand All @@ -3841,7 +3841,7 @@
</xsl:apply-templates>

<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
<fo:block/>
<fo:block role="SKIP"/>
</xsl:if>

</fo:table-cell>
Expand Down Expand Up @@ -4152,7 +4152,7 @@

<xsl:call-template name="refine_table-header-cell-style"/>

<fo:block>
<fo:block role="SKIP">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
Expand Down Expand Up @@ -4205,7 +4205,7 @@
<xsl:attribute name="text-align">left</xsl:attribute>
</xsl:if>

<fo:block>
<fo:block role="SKIP">

<xsl:if test="$isGenerateTableIF = 'true'">
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
Expand Down Expand Up @@ -5084,7 +5084,7 @@
-->
<fo:table-row>
<fo:table-cell number-columns-spanned="2">
<fo:block>
<fo:block role="SKIP">
<xsl:call-template name="note"/>
</fo:block>
</fo:table-cell>
Expand Down Expand Up @@ -5149,7 +5149,7 @@

<xsl:call-template name="refine_dt-cell-style"/>

<fo:block xsl:use-attribute-sets="dt-block-style">
<fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
<xsl:copy-of select="@id"/>

<xsl:if test="normalize-space($key_iso) = 'true'">
Expand Down Expand Up @@ -5179,7 +5179,7 @@

<xsl:call-template name="refine_dd-cell-style"/>

<fo:block>
<fo:block role="SKIP">

<xsl:if test="$isGenerateTableIF = 'true'">
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
Expand Down Expand Up @@ -5554,11 +5554,41 @@

<xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
<xsl:variable name="text" select="normalize-space(.)"/>
<fo:inline font-size="75%">
<fo:inline font-size="75%" role="SKIP">
<xsl:if test="string-length($text) &gt; 0">
<xsl:call-template name="recursiveSmallCaps">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
<xsl:variable name="smallCapsText">
<xsl:call-template name="recursiveSmallCaps">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:variable>
<!-- merge neighboring fo:inline -->
<xsl:for-each select="xalan:nodeset($smallCapsText)/node()">
<xsl:choose>
<xsl:when test="self::fo:inline and preceding-sibling::node()[1][self::fo:inline]"><!-- <xsl:copy-of select="."/> --></xsl:when>
<xsl:when test="self::fo:inline and @font-size">
<xsl:variable name="curr_pos" select="count(preceding-sibling::node()) + 1"/>
<!-- <curr_pos><xsl:value-of select="$curr_pos"/></curr_pos> -->
<xsl:variable name="next_text_" select="count(following-sibling::node()[not(local-name() = 'inline')][1]/preceding-sibling::node())"/>
<xsl:variable name="next_text">
<xsl:choose>
<xsl:when test="$next_text_ = 0">99999999</xsl:when>
<xsl:otherwise><xsl:value-of select="$next_text_ + 1"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- <next_text><xsl:value-of select="$next_text"/></next_text> -->
<fo:inline>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="./node()"/>
<xsl:for-each select="following-sibling::node()[position() &lt; $next_text - $curr_pos]"> <!-- [self::fo:inline] -->
<xsl:copy-of select="./node()"/>
</xsl:for-each>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:if>
</fo:inline>
</xsl:template>
Expand All @@ -5570,7 +5600,7 @@
<xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
<xsl:choose>
<xsl:when test="$char=$upperCase">
<fo:inline font-size="{100 div 0.75}%">
<fo:inline font-size="{100 div 0.75}%" role="SKIP">
<xsl:value-of select="$upperCase"/>
</fo:inline>
</xsl:when>
Expand Down Expand Up @@ -6984,15 +7014,15 @@
<fo:table-body>
<fo:table-row>
<fo:table-cell display-align="center">
<fo:block xsl:use-attribute-sets="formula-stem-block-style">
<fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">

<xsl:call-template name="refine_formula-stem-block-style"/>

<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block xsl:use-attribute-sets="formula-stem-number-style">
<fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">

<xsl:call-template name="refine_formula-stem-number-style"/>

Expand Down Expand Up @@ -8498,7 +8528,7 @@
<!-- second td with sourcecode -->
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
<fo:table-cell>
<fo:block>
<fo:block role="SKIP">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
Expand Down Expand Up @@ -8985,7 +9015,7 @@

<xsl:call-template name="setTableCellAttributes"/>

<fo:block>
<fo:block role="SKIP">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
Expand All @@ -9007,7 +9037,7 @@

<xsl:call-template name="setTableCellAttributes"/>

<fo:block>
<fo:block role="SKIP">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
Expand Down Expand Up @@ -10015,7 +10045,7 @@
<xsl:call-template name="refine_list-item-style"/>

<fo:list-item-label end-indent="label-end()">
<fo:block xsl:use-attribute-sets="list-item-label-style">
<fo:block xsl:use-attribute-sets="list-item-label-style" role="SKIP">

<xsl:call-template name="refine_list-item-label-style"/>

Expand All @@ -10029,7 +10059,7 @@
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
<fo:block>
<fo:block role="SKIP">

<xsl:call-template name="refine_list-item-body-style"/>

Expand Down Expand Up @@ -10308,10 +10338,10 @@
<fo:table-body>
<fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">

<fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block role="SKIP">Date</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block role="SKIP">Type</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block role="SKIP">Change</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block role="SKIP">Pages</fo:block></fo:table-cell>
</fo:table-row>
<xsl:apply-templates/>
</fo:table-body>
Expand All @@ -10326,7 +10356,7 @@

<xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
<fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
<fo:block><xsl:apply-templates/></fo:block>
<fo:block role="SKIP"><xsl:apply-templates/></fo:block>
</fo:table-cell>
</xsl:template>
<!-- ============ -->
Expand Down Expand Up @@ -10411,8 +10441,8 @@
<fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<fo:inline>
<fo:block role="SKIP">
<fo:inline role="SKIP">

<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
<xsl:with-param name="biblio_tag_part">first</xsl:with-param>
Expand All @@ -10421,7 +10451,7 @@
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
<fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
<xsl:call-template name="processBibitem">
<xsl:with-param name="biblio_tag_part">last</xsl:with-param>
</xsl:call-template>
Expand Down Expand Up @@ -10642,7 +10672,7 @@
<xsl:for-each select="*[local-name() = 'tab']">
<xsl:variable name="current_id" select="generate-id()"/>
<fo:table-cell>
<fo:block line-height-shift-adjustment="disregard-shifts">
<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
<xsl:call-template name="insert_basic_link">
<xsl:with-param name="element">
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
Expand All @@ -10660,7 +10690,7 @@
</xsl:for-each>
<!-- last column - for page numbers -->
<fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
<fo:block>
<fo:block role="SKIP">
<xsl:call-template name="insert_basic_link">
<xsl:with-param name="element">
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
Expand Down

0 comments on commit 620214c

Please sign in to comment.