metanorma-iec 2.6.1 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/iec/html/htmlstyle.css +7 -0
- data/lib/isodoc/iec/iec.international-standard.xsl +619 -249
- data/lib/isodoc/iec/word_convert.rb +2 -3
- data/lib/metanorma/iec/basicdoc.rng +34 -27
- data/lib/metanorma/iec/isodoc.rng +37 -1
- data/lib/metanorma/iec/relaton-iec.rng +0 -22
- data/lib/metanorma/iec/version.rb +1 -1
- metadata +2 -2
| @@ -1931,10 +1931,6 @@ | |
| 1931 1931 |  | 
| 1932 1932 | 
             
            	</xsl:template>
         | 
| 1933 1933 |  | 
| 1934 | 
            -
            	<xsl:template match="iec:p/iec:fn/iec:p">
         | 
| 1935 | 
            -
            		<xsl:apply-templates/>
         | 
| 1936 | 
            -
            	</xsl:template>
         | 
| 1937 | 
            -
             | 
| 1938 1934 | 
             
            	<xsl:template match="iec:dd/iec:p">
         | 
| 1939 1935 | 
             
            		<fo:block margin-bottom="5pt"><xsl:apply-templates/></fo:block>
         | 
| 1940 1936 | 
             
            	</xsl:template>
         | 
| @@ -3033,15 +3029,19 @@ | |
| 3033 3029 | 
             
            	</xsl:template>
         | 
| 3034 3030 |  | 
| 3035 3031 | 
             
            	<xsl:attribute-set name="table-fn-number-style">
         | 
| 3032 | 
            +
            		<!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
         | 
| 3033 | 
            +
             | 
| 3034 | 
            +
            	</xsl:attribute-set> <!-- table-fn-number-style -->
         | 
| 3035 | 
            +
             | 
| 3036 | 
            +
            	<xsl:attribute-set name="table-fmt-fn-label-style">
         | 
| 3036 3037 | 
             
            		<xsl:attribute name="font-size">80%</xsl:attribute>
         | 
| 3037 | 
            -
            		<xsl:attribute name="padding-right">5mm</xsl:attribute>
         | 
| 3038 3038 |  | 
| 3039 3039 | 
             
            			<xsl:attribute name="baseline-shift">30%</xsl:attribute>
         | 
| 3040 3040 | 
             
            			<xsl:attribute name="font-size">70%</xsl:attribute>
         | 
| 3041 3041 |  | 
| 3042 | 
            -
            	</xsl:attribute-set> <!-- table-fn- | 
| 3042 | 
            +
            	</xsl:attribute-set> <!-- table-fmt-fn-label-style -->
         | 
| 3043 3043 |  | 
| 3044 | 
            -
            	<xsl:template name="refine_table-fn- | 
| 3044 | 
            +
            	<xsl:template name="refine_table-fmt-fn-label-style">
         | 
| 3045 3045 |  | 
| 3046 3046 | 
             
            	</xsl:template>
         | 
| 3047 3047 |  | 
| @@ -3056,13 +3056,20 @@ | |
| 3056 3056 | 
             
            	</xsl:attribute-set>
         | 
| 3057 3057 |  | 
| 3058 3058 | 
             
            	<xsl:attribute-set name="figure-fn-number-style">
         | 
| 3059 | 
            -
            		<xsl:attribute name="font-size">80%</xsl:attribute>
         | 
| 3060 3059 | 
             
            		<xsl:attribute name="padding-right">5mm</xsl:attribute>
         | 
| 3060 | 
            +
            	</xsl:attribute-set> <!-- figure-fn-number-style -->
         | 
| 3061 | 
            +
             | 
| 3062 | 
            +
            	<xsl:attribute-set name="figure-fmt-fn-label-style">
         | 
| 3063 | 
            +
            		<xsl:attribute name="font-size">80%</xsl:attribute>
         | 
| 3061 3064 | 
             
            		<xsl:attribute name="vertical-align">super</xsl:attribute>
         | 
| 3062 3065 |  | 
| 3063 3066 | 
             
            			<xsl:attribute name="baseline-shift">65%</xsl:attribute>
         | 
| 3064 3067 |  | 
| 3065 | 
            -
            	</xsl:attribute-set>
         | 
| 3068 | 
            +
            	</xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
         | 
| 3069 | 
            +
             | 
| 3070 | 
            +
            	<xsl:template name="refine_figure-fmt-fn-label-style">
         | 
| 3071 | 
            +
             | 
| 3072 | 
            +
            	</xsl:template>
         | 
| 3066 3073 |  | 
| 3067 3074 | 
             
            	<xsl:attribute-set name="figure-fn-body-style">
         | 
| 3068 3075 | 
             
            		<xsl:attribute name="text-align">justify</xsl:attribute>
         | 
| @@ -4608,9 +4615,13 @@ | |
| 4608 4615 |  | 
| 4609 4616 | 
             
            					<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'][not(@type = 'units')] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
         | 
| 4610 4617 | 
             
            					<xsl:if test="$isNoteOrFnExist = 'true'">
         | 
| 4611 | 
            -
             | 
| 4612 | 
            -
             | 
| 4613 | 
            -
             | 
| 4618 | 
            +
            						<!-- <xsl:choose>
         | 
| 4619 | 
            +
            							<xsl:when test="$namespace = 'plateau'"></xsl:when>
         | 
| 4620 | 
            +
            							<xsl:otherwise>
         | 
| 4621 | 
            +
            								
         | 
| 4622 | 
            +
            							</xsl:otherwise>
         | 
| 4623 | 
            +
            						</xsl:choose> -->
         | 
| 4624 | 
            +
            						<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
         | 
| 4614 4625 | 
             
            					</xsl:if>
         | 
| 4615 4626 |  | 
| 4616 4627 | 
             
            					<xsl:choose>
         | 
| @@ -4657,7 +4668,7 @@ | |
| 4657 4668 | 
             
            									<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
         | 
| 4658 4669 | 
             
            								</xsl:when>
         | 
| 4659 4670 | 
             
            								<xsl:otherwise>
         | 
| 4660 | 
            -
            									<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'example') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p')          and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
         | 
| 4671 | 
            +
            									<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'example') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p')          and not(local-name() = 'thead') and not(local-name() = 'tfoot') and not(local-name() = 'fmt-footnote-container')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
         | 
| 4661 4672 | 
             
            								</xsl:otherwise>
         | 
| 4662 4673 | 
             
            							</xsl:choose>
         | 
| 4663 4674 |  | 
| @@ -4668,13 +4679,26 @@ | |
| 4668 4679 |  | 
| 4669 4680 | 
             
            				<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
         | 
| 4670 4681 |  | 
| 4671 | 
            -
             | 
| 4672 | 
            -
             | 
| 4673 | 
            -
             | 
| 4674 | 
            -
             | 
| 4675 | 
            -
             | 
| 4676 | 
            -
             | 
| 4677 | 
            -
            						 | 
| 4682 | 
            +
            				<!-- https://github.com/metanorma/metanorma-plateau/issues/171 -->
         | 
| 4683 | 
            +
             | 
| 4684 | 
            +
            				<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
         | 
| 4685 | 
            +
            					<xsl:call-template name="insertTableFooterInSeparateTable">
         | 
| 4686 | 
            +
            						<xsl:with-param name="table_attributes" select="$table_attributes"/>
         | 
| 4687 | 
            +
            						<xsl:with-param name="colwidths" select="$colwidths"/>
         | 
| 4688 | 
            +
            						<xsl:with-param name="colgroup" select="$colgroup"/>
         | 
| 4689 | 
            +
            					</xsl:call-template>
         | 
| 4690 | 
            +
            				</xsl:for-each>
         | 
| 4691 | 
            +
             | 
| 4692 | 
            +
            				<!-- https://github.com/metanorma/metanorma-plateau/issues/171
         | 
| 4693 | 
            +
            				<xsl:if test="$namespace = 'plateau'">
         | 
| 4694 | 
            +
            					<xsl:apply-templates select="*[not(local-name()='thead') and not(local-name()='tbody') and not(local-name()='tfoot') and not(local-name()='name')]" />
         | 
| 4695 | 
            +
            					<xsl:for-each select="*[local-name()='tbody']"> - select context to tbody -
         | 
| 4696 | 
            +
            						<xsl:variable name="table_fn_block">
         | 
| 4697 | 
            +
            							<xsl:call-template name="table_fn_display" />
         | 
| 4698 | 
            +
            						</xsl:variable>
         | 
| 4699 | 
            +
            						<xsl:copy-of select="$table_fn_block"/>
         | 
| 4700 | 
            +
            					</xsl:for-each>
         | 
| 4701 | 
            +
            				</xsl:if> -->
         | 
| 4678 4702 |  | 
| 4679 4703 | 
             
            				<xsl:if test="*[local-name()='bookmark']"> <!-- special case: table/bookmark -->
         | 
| 4680 4704 | 
             
            					<fo:block keep-with-previous="always" line-height="0.1">
         | 
| @@ -5381,6 +5405,7 @@ | |
| 5381 5405 | 
             
            						<xsl:with-param name="key">continued</xsl:with-param>
         | 
| 5382 5406 | 
             
            					</xsl:call-template>
         | 
| 5383 5407 | 
             
            				</xsl:variable>
         | 
| 5408 | 
            +
             | 
| 5384 5409 | 
             
            				<xsl:variable name="title_continued_in_parenthesis" select="concat('(',$title_continued_,')')"/>
         | 
| 5385 5410 | 
             
            				<xsl:variable name="title_continued">
         | 
| 5386 5411 | 
             
            					<xsl:value-of select="$title_continued_in_parenthesis"/>
         | 
| @@ -5534,6 +5559,8 @@ | |
| 5534 5559 |  | 
| 5535 5560 | 
             
            	<xsl:template name="setTableRowAttributes">
         | 
| 5536 5561 |  | 
| 5562 | 
            +
            		<xsl:call-template name="setColors"/>
         | 
| 5563 | 
            +
             | 
| 5537 5564 | 
             
            	</xsl:template> <!-- setTableRowAttributes -->
         | 
| 5538 5565 | 
             
            	<!-- ===================== -->
         | 
| 5539 5566 | 
             
            	<!-- END Table's row processing -->
         | 
| @@ -5585,6 +5612,7 @@ | |
| 5585 5612 | 
             
            			</xsl:attribute>
         | 
| 5586 5613 | 
             
            		</xsl:if>
         | 
| 5587 5614 | 
             
            		<xsl:call-template name="display-align"/>
         | 
| 5615 | 
            +
            		<xsl:call-template name="setColors"/>
         | 
| 5588 5616 | 
             
            	</xsl:template>
         | 
| 5589 5617 |  | 
| 5590 5618 | 
             
            	<xsl:template name="display-align">
         | 
| @@ -5600,6 +5628,29 @@ | |
| 5600 5628 | 
             
            		</xsl:if>
         | 
| 5601 5629 | 
             
            	</xsl:template>
         | 
| 5602 5630 |  | 
| 5631 | 
            +
            	<xsl:template name="setColors">
         | 
| 5632 | 
            +
            		<xsl:variable name="styles__">
         | 
| 5633 | 
            +
            			<xsl:call-template name="split">
         | 
| 5634 | 
            +
            				<xsl:with-param name="pText" select="concat(@style,';')"/>
         | 
| 5635 | 
            +
            				<xsl:with-param name="sep" select="';'"/>
         | 
| 5636 | 
            +
            			</xsl:call-template>
         | 
| 5637 | 
            +
            		</xsl:variable>
         | 
| 5638 | 
            +
            		<xsl:variable name="quot">"</xsl:variable>
         | 
| 5639 | 
            +
            		<xsl:variable name="styles_">
         | 
| 5640 | 
            +
            			<xsl:for-each select="xalan:nodeset($styles__)/item">
         | 
| 5641 | 
            +
            				<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
         | 
| 5642 | 
            +
            				<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
         | 
| 5643 | 
            +
            				<xsl:if test="$key = 'color' or $key = 'background-color'">
         | 
| 5644 | 
            +
            					<style name="{$key}"><xsl:value-of select="$value"/></style>
         | 
| 5645 | 
            +
            				</xsl:if>
         | 
| 5646 | 
            +
            			</xsl:for-each>
         | 
| 5647 | 
            +
            		</xsl:variable>
         | 
| 5648 | 
            +
            		<xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
         | 
| 5649 | 
            +
            		<xsl:for-each select="$styles/style">
         | 
| 5650 | 
            +
            			<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
         | 
| 5651 | 
            +
            		</xsl:for-each>
         | 
| 5652 | 
            +
            	</xsl:template>
         | 
| 5653 | 
            +
             | 
| 5603 5654 | 
             
            	<!-- cell in table body, footer -->
         | 
| 5604 5655 | 
             
            	<xsl:template match="*[local-name()='td']" name="td">
         | 
| 5605 5656 | 
             
            		<fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
         | 
| @@ -5611,17 +5662,28 @@ | |
| 5611 5662 |  | 
| 5612 5663 | 
             
            			<xsl:call-template name="refine_table-cell-style"/>
         | 
| 5613 5664 |  | 
| 5665 | 
            +
            			<xsl:call-template name="setTableCellAttributes"/>
         | 
| 5666 | 
            +
             | 
| 5614 5667 | 
             
            			<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
         | 
| 5615 5668 | 
             
            				<xsl:attribute name="padding-right">1mm</xsl:attribute>
         | 
| 5616 5669 | 
             
            			</xsl:if>
         | 
| 5617 5670 |  | 
| 5618 | 
            -
            			<xsl:call-template name="setTableCellAttributes"/>
         | 
| 5619 | 
            -
             | 
| 5620 5671 | 
             
            			<xsl:if test="$isGenerateTableIF = 'true'">
         | 
| 5621 5672 | 
             
            				<xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
         | 
| 5622 5673 | 
             
            				<xsl:attribute name="text-align">left</xsl:attribute>
         | 
| 5623 5674 | 
             
            			</xsl:if>
         | 
| 5624 5675 |  | 
| 5676 | 
            +
            			<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 5677 | 
            +
            				<xsl:if test="@colspan and *[local-name() = 'note'][@type = 'units']">
         | 
| 5678 | 
            +
            					<xsl:attribute name="text-align">right</xsl:attribute>
         | 
| 5679 | 
            +
            					<xsl:attribute name="border">none</xsl:attribute>
         | 
| 5680 | 
            +
            					<xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
         | 
| 5681 | 
            +
            					<xsl:attribute name="border-top">1pt solid white</xsl:attribute>
         | 
| 5682 | 
            +
            					<xsl:attribute name="border-left">1pt solid white</xsl:attribute>
         | 
| 5683 | 
            +
            					<xsl:attribute name="border-right">1pt solid white</xsl:attribute>
         | 
| 5684 | 
            +
            				</xsl:if>
         | 
| 5685 | 
            +
            			</xsl:if>
         | 
| 5686 | 
            +
             | 
| 5625 5687 | 
             
            			<fo:block role="SKIP">
         | 
| 5626 5688 |  | 
| 5627 5689 | 
             
            				<xsl:if test="$isGenerateTableIF = 'true'">
         | 
| @@ -5640,7 +5702,8 @@ | |
| 5640 5702 | 
             
            		</fo:table-cell>
         | 
| 5641 5703 | 
             
            	</xsl:template> <!-- td -->
         | 
| 5642 5704 |  | 
| 5643 | 
            -
            	 | 
| 5705 | 
            +
            	<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
         | 
| 5706 | 
            +
            	<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example'] |       *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name() = 'example']" priority="2">
         | 
| 5644 5707 |  | 
| 5645 5708 | 
             
            				<fo:block xsl:use-attribute-sets="table-note-style">
         | 
| 5646 5709 | 
             
            					<xsl:copy-of select="@id"/>
         | 
| @@ -5661,65 +5724,54 @@ | |
| 5661 5724 |  | 
| 5662 5725 | 
             
            	</xsl:template> <!-- table/note -->
         | 
| 5663 5726 |  | 
| 5664 | 
            -
            	<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
         | 
| 5727 | 
            +
            	<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p'] |  *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
         | 
| 5665 5728 | 
             
            		<xsl:apply-templates/>
         | 
| 5666 5729 | 
             
            	</xsl:template>
         | 
| 5667 5730 |  | 
| 5668 5731 | 
             
            	<!-- ===================== -->
         | 
| 5669 5732 | 
             
            	<!-- Footnotes processing  -->
         | 
| 5670 5733 | 
             
            	<!-- ===================== -->
         | 
| 5734 | 
            +
             | 
| 5735 | 
            +
            	<!-- document text (not figures, or tables) footnotes -->
         | 
| 5736 | 
            +
            	<xsl:variable name="footnotes_">
         | 
| 5737 | 
            +
            		<xsl:for-each select="//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']"> <!-- commented *[local-name() = 'metanorma']/, because there are fn in figure or table name -->
         | 
| 5738 | 
            +
            			<!-- <xsl:copy-of select="."/> -->
         | 
| 5739 | 
            +
            			<xsl:variable name="update_xml_step1">
         | 
| 5740 | 
            +
            				<xsl:apply-templates select="." mode="update_xml_step1"/>
         | 
| 5741 | 
            +
            			</xsl:variable>
         | 
| 5742 | 
            +
            			<xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
         | 
| 5743 | 
            +
            		</xsl:for-each>
         | 
| 5744 | 
            +
            	</xsl:variable>
         | 
| 5745 | 
            +
            	<xsl:variable name="footnotes" select="xalan:nodeset($footnotes_)"/>
         | 
| 5746 | 
            +
             | 
| 5671 5747 | 
             
            	<!--
         | 
| 5672 5748 | 
             
            	<fn reference="1">
         | 
| 5673 5749 | 
             
            			<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
         | 
| 5674 5750 | 
             
            		</fn>
         | 
| 5675 5751 | 
             
            	-->
         | 
| 5676 | 
            -
            	<!-- footnotes in text (title, bibliography, main body, table's, figure's names | 
| 5752 | 
            +
            	<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
         | 
| 5753 | 
            +
            	<!-- fn in text -->
         | 
| 5677 5754 | 
             
            	<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
         | 
| 5678 5755 |  | 
| 5679 | 
            -
            		<!-- list of  | 
| 5756 | 
            +
            		<!-- list of unique footnotes -->
         | 
| 5680 5757 | 
             
            		<xsl:variable name="p_fn_">
         | 
| 5681 5758 | 
             
            			<xsl:call-template name="get_fn_list"/>
         | 
| 5682 | 
            -
            			<!-- <xsl:choose>
         | 
| 5683 | 
            -
            				<xsl:when test="$namespace = 'jis'">
         | 
| 5684 | 
            -
            					<xsl:call-template name="get_fn_list_for_element"/>
         | 
| 5685 | 
            -
            				</xsl:when>
         | 
| 5686 | 
            -
            				<xsl:otherwise>
         | 
| 5687 | 
            -
            					<xsl:call-template name="get_fn_list"/>
         | 
| 5688 | 
            -
            				</xsl:otherwise>
         | 
| 5689 | 
            -
            			</xsl:choose> -->
         | 
| 5690 5759 | 
             
            		</xsl:variable>
         | 
| 5691 5760 | 
             
            		<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
         | 
| 5692 5761 |  | 
| 5693 5762 | 
             
            		<xsl:variable name="gen_id" select="generate-id(.)"/>
         | 
| 5694 | 
            -
             | 
| 5695 | 
            -
            		<xsl:variable name="reference_">
         | 
| 5696 | 
            -
            			<xsl:value-of select="@reference"/>
         | 
| 5697 | 
            -
            			<xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
         | 
| 5698 | 
            -
            		</xsl:variable>
         | 
| 5699 | 
            -
            		<xsl:variable name="reference" select="normalize-space($reference_)"/>
         | 
| 5763 | 
            +
             | 
| 5700 5764 | 
             
            		<!-- fn sequence number in document -->
         | 
| 5701 | 
            -
            		<xsl:variable name="current_fn_number" | 
| 5702 | 
            -
             | 
| 5703 | 
            -
            				<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
         | 
| 5704 | 
            -
            				<xsl:otherwise>
         | 
| 5705 | 
            -
            					<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
         | 
| 5706 | 
            -
            				</xsl:otherwise>
         | 
| 5707 | 
            -
            			</xsl:choose>
         | 
| 5708 | 
            -
            		</xsl:variable>
         | 
| 5765 | 
            +
            		<xsl:variable name="current_fn_number" select="@reference"/>
         | 
| 5766 | 
            +
             | 
| 5709 5767 | 
             
            		<xsl:variable name="current_fn_number_text">
         | 
| 5710 5768 |  | 
| 5711 5769 | 
             
            					<xsl:value-of select="$current_fn_number"/>
         | 
| 5712 5770 |  | 
| 5713 5771 | 
             
            		</xsl:variable>
         | 
| 5714 5772 |  | 
| 5715 | 
            -
            		<xsl:variable name="ref_id" | 
| 5716 | 
            -
             | 
| 5717 | 
            -
            				<xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
         | 
| 5718 | 
            -
            				<xsl:otherwise>
         | 
| 5719 | 
            -
            					<xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
         | 
| 5720 | 
            -
            				</xsl:otherwise>
         | 
| 5721 | 
            -
            			</xsl:choose>
         | 
| 5722 | 
            -
            		</xsl:variable>
         | 
| 5773 | 
            +
            		<xsl:variable name="ref_id" select="@target"/>
         | 
| 5774 | 
            +
             | 
| 5723 5775 | 
             
            		<xsl:variable name="footnote_inline">
         | 
| 5724 5776 | 
             
            			<fo:inline role="Reference">
         | 
| 5725 5777 |  | 
| @@ -5764,7 +5816,9 @@ | |
| 5764 5816 | 
             
            			<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
         | 
| 5765 5817 | 
             
            				<xsl:copy-of select="$footnote_inline"/>
         | 
| 5766 5818 | 
             
            			</xsl:when>
         | 
| 5819 | 
            +
            			<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
         | 
| 5767 5820 | 
             
            			<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
         | 
| 5821 | 
            +
             | 
| 5768 5822 | 
             
            				<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
         | 
| 5769 5823 | 
             
            					<xsl:copy-of select="$footnote_inline"/>
         | 
| 5770 5824 | 
             
            					<fo:footnote-body role="Note">
         | 
| @@ -5781,7 +5835,10 @@ | |
| 5781 5835 | 
             
            									<xsl:value-of select="$current_fn_number_text"/>
         | 
| 5782 5836 |  | 
| 5783 5837 | 
             
            								</fo:inline>
         | 
| 5784 | 
            -
            								<xsl:apply-templates/>
         | 
| 5838 | 
            +
            								<!-- <xsl:apply-templates /> -->
         | 
| 5839 | 
            +
            								<!-- <ref_id><xsl:value-of select="$ref_id"/></ref_id>
         | 
| 5840 | 
            +
            								<here><xsl:copy-of select="$footnotes"/></here> -->
         | 
| 5841 | 
            +
            								<xsl:apply-templates select="$footnotes/*[local-name() = 'fmt-fn-body'][@id = $ref_id]"/>
         | 
| 5785 5842 | 
             
            							</xsl:variable>
         | 
| 5786 5843 |  | 
| 5787 5844 | 
             
            									<fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
         | 
| @@ -5835,77 +5892,136 @@ | |
| 5835 5892 | 
             
            		</xsl:choose>
         | 
| 5836 5893 | 
             
            	</xsl:template>
         | 
| 5837 5894 |  | 
| 5838 | 
            -
            	<xsl:template name="get_fn_list_for_element">
         | 
| 5839 | 
            -
            		<xsl:choose>
         | 
| 5840 | 
            -
            			<xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
         | 
| 5841 | 
            -
            				<fn gen_id="{generate-id(.)}">
         | 
| 5842 | 
            -
            					<xsl:copy-of select="@*"/>
         | 
| 5843 | 
            -
            					<xsl:copy-of select="node()"/>
         | 
| 5844 | 
            -
            				</fn>
         | 
| 5845 | 
            -
            			</xsl:when>
         | 
| 5846 | 
            -
            			<xsl:otherwise>
         | 
| 5847 | 
            -
            				<xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
         | 
| 5848 | 
            -
            					<xsl:variable name="element_id" select="@id"/>
         | 
| 5849 | 
            -
            					<xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
         | 
| 5850 | 
            -
            						<!-- copy unique fn -->
         | 
| 5851 | 
            -
            						<fn gen_id="{generate-id(.)}">
         | 
| 5852 | 
            -
            							<xsl:copy-of select="@*"/>
         | 
| 5853 | 
            -
            							<xsl:copy-of select="node()"/>
         | 
| 5854 | 
            -
            						</fn>
         | 
| 5855 | 
            -
            					</xsl:for-each>
         | 
| 5856 | 
            -
            				</xsl:for-each>
         | 
| 5857 | 
            -
            			</xsl:otherwise>
         | 
| 5858 | 
            -
            		</xsl:choose>
         | 
| 5859 | 
            -
            	</xsl:template>
         | 
| 5860 5895 | 
             
            	<!-- ============================ -->
         | 
| 5861 5896 | 
             
            	<!-- table's footnotes rendering -->
         | 
| 5862 5897 | 
             
            	<!-- ============================ -->
         | 
| 5863 | 
            -
            	<xsl:template name="table_fn_display">
         | 
| 5864 | 
            -
            		<xsl:variable name="references">
         | 
| 5865 5898 |  | 
| 5899 | 
            +
            	<!-- table/fmt-footnote-container -->
         | 
| 5900 | 
            +
            	<xsl:template match="*[local-name() = 'table']/*[local-name() = 'fmt-footnote-container']"/>
         | 
| 5901 | 
            +
             | 
| 5902 | 
            +
            	<xsl:template match="*[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'fmt-footnote-container']">
         | 
| 5903 | 
            +
            		<xsl:for-each select=".">
         | 
| 5904 | 
            +
            			<xsl:call-template name="table_fn_display"/>
         | 
| 5905 | 
            +
            		</xsl:for-each>
         | 
| 5906 | 
            +
            	</xsl:template>
         | 
| 5907 | 
            +
             | 
| 5908 | 
            +
            	<xsl:template name="table_fn_display">
         | 
| 5909 | 
            +
            		<!-- <xsl:variable name="references">
         | 
| 5910 | 
            +
            			<xsl:if test="$namespace = 'bsi'">
         | 
| 5911 | 
            +
            				<xsl:for-each select="..//*[local-name()='fn'][local-name(..) = 'name']">
         | 
| 5912 | 
            +
            					<xsl:call-template name="create_fn" />
         | 
| 5913 | 
            +
            				</xsl:for-each>
         | 
| 5914 | 
            +
            			</xsl:if>
         | 
| 5866 5915 | 
             
            			<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
         | 
| 5867 | 
            -
            				<xsl:call-template name="create_fn"/>
         | 
| 5916 | 
            +
            				<xsl:call-template name="create_fn" />
         | 
| 5868 5917 | 
             
            			</xsl:for-each>
         | 
| 5869 | 
            -
            		</xsl:variable>
         | 
| 5870 | 
            -
             | 
| 5871 | 
            -
            		<xsl:for-each select="xalan:nodeset($references)//fn">
         | 
| 5918 | 
            +
            		</xsl:variable> -->
         | 
| 5919 | 
            +
            		<!-- <xsl:for-each select="xalan:nodeset($references)//fn">
         | 
| 5872 5920 | 
             
            			<xsl:variable name="reference" select="@reference"/>
         | 
| 5873 | 
            -
            			<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
         | 
| 5921 | 
            +
            			<xsl:if test="not(preceding-sibling::*[@reference = $reference])">  --> <!-- only unique reference puts in note-->
         | 
| 5922 | 
            +
            		<xsl:for-each select="..//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
         | 
| 5874 5923 |  | 
| 5875 5924 | 
             
            						<fo:block xsl:use-attribute-sets="table-fn-style">
         | 
| 5925 | 
            +
            							<xsl:copy-of select="@id"/>
         | 
| 5876 5926 | 
             
            							<xsl:call-template name="refine_table-fn-style"/>
         | 
| 5877 | 
            -
            							<fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
         | 
| 5878 | 
            -
            								<xsl:call-template name="refine_table-fn-number-style"/>
         | 
| 5879 | 
            -
             | 
| 5880 | 
            -
            								<xsl:value-of select="@reference"/>
         | 
| 5881 5927 |  | 
| 5882 | 
            -
             | 
| 5883 | 
            -
            								 | 
| 5884 | 
            -
             | 
| 5885 | 
            -
            								</xsl:if> -->
         | 
| 5928 | 
            +
            							<xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']">
         | 
| 5929 | 
            +
            								<xsl:with-param name="process">true</xsl:with-param>
         | 
| 5930 | 
            +
            							</xsl:apply-templates>
         | 
| 5886 5931 |  | 
| 5887 | 
            -
            							</fo:inline>
         | 
| 5888 5932 | 
             
            							<fo:inline xsl:use-attribute-sets="table-fn-body-style">
         | 
| 5889 | 
            -
            								<xsl:copy-of select="./node()"/>
         | 
| 5933 | 
            +
            								<!-- <xsl:copy-of select="./node()"/> -->
         | 
| 5934 | 
            +
            								<xsl:apply-templates/>
         | 
| 5890 5935 | 
             
            							</fo:inline>
         | 
| 5891 5936 |  | 
| 5892 5937 | 
             
            						</fo:block>
         | 
| 5893 5938 |  | 
| 5894 | 
            -
            			</xsl:if>
         | 
| 5939 | 
            +
            			<!-- </xsl:if> -->
         | 
| 5895 5940 | 
             
            		</xsl:for-each>
         | 
| 5896 5941 | 
             
            	</xsl:template> <!-- table_fn_display -->
         | 
| 5897 5942 |  | 
| 5943 | 
            +
            	<!-- fmt-fn-body/fmt-fn-label in text -->
         | 
| 5944 | 
            +
            	<xsl:template match="*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"/>
         | 
| 5945 | 
            +
             | 
| 5946 | 
            +
            	<!-- table//fmt-fn-body//fmt-fn-label -->
         | 
| 5947 | 
            +
            	<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
         | 
| 5948 | 
            +
            		<xsl:param name="process">false</xsl:param>
         | 
| 5949 | 
            +
            		<xsl:if test="$process = 'true'">
         | 
| 5950 | 
            +
            			<fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
         | 
| 5951 | 
            +
             | 
| 5952 | 
            +
            				<!-- tab is padding-right -->
         | 
| 5953 | 
            +
            				<xsl:apply-templates select=".//*[local-name() = 'tab']">
         | 
| 5954 | 
            +
            					<xsl:with-param name="process">true</xsl:with-param>
         | 
| 5955 | 
            +
            				</xsl:apply-templates>
         | 
| 5956 | 
            +
             | 
| 5957 | 
            +
            				<!-- <xsl:if test="$namespace = 'bipm'">
         | 
| 5958 | 
            +
            					<fo:inline font-style="normal">(</fo:inline>
         | 
| 5959 | 
            +
            				</xsl:if> -->
         | 
| 5960 | 
            +
             | 
| 5961 | 
            +
            				<!-- <xsl:if test="$namespace = 'plateau'">
         | 
| 5962 | 
            +
            					<xsl:text>※</xsl:text>
         | 
| 5963 | 
            +
            				</xsl:if> -->
         | 
| 5964 | 
            +
             | 
| 5965 | 
            +
            				<!-- <xsl:value-of select="@reference"/> -->
         | 
| 5966 | 
            +
            				<!-- <xsl:value-of select="normalize-space()"/> -->
         | 
| 5967 | 
            +
            				<xsl:apply-templates/>
         | 
| 5968 | 
            +
             | 
| 5969 | 
            +
            				<!-- <xsl:if test="$namespace = 'bipm'">
         | 
| 5970 | 
            +
            					<fo:inline font-style="normal">)</fo:inline>
         | 
| 5971 | 
            +
            				</xsl:if> -->
         | 
| 5972 | 
            +
             | 
| 5973 | 
            +
            				<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
         | 
| 5974 | 
            +
            				<!-- <xsl:if test="$namespace = 'itu'">
         | 
| 5975 | 
            +
            					<xsl:text>)</xsl:text>
         | 
| 5976 | 
            +
            				</xsl:if> -->
         | 
| 5977 | 
            +
             | 
| 5978 | 
            +
            				<!-- <xsl:if test="$namespace = 'plateau'">
         | 
| 5979 | 
            +
            					<xsl:text>:</xsl:text>
         | 
| 5980 | 
            +
            				</xsl:if> -->
         | 
| 5981 | 
            +
             | 
| 5982 | 
            +
            			</fo:inline>
         | 
| 5983 | 
            +
            		</xsl:if>
         | 
| 5984 | 
            +
            	</xsl:template> <!--  fmt-fn-body//fmt-fn-label -->
         | 
| 5985 | 
            +
             | 
| 5986 | 
            +
            	<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
         | 
| 5987 | 
            +
            		<xsl:param name="process">false</xsl:param>
         | 
| 5988 | 
            +
            		<xsl:if test="$process = 'true'">
         | 
| 5989 | 
            +
            			<xsl:attribute name="padding-right">5mm</xsl:attribute>
         | 
| 5990 | 
            +
             | 
| 5991 | 
            +
            		</xsl:if>
         | 
| 5992 | 
            +
            	</xsl:template>
         | 
| 5993 | 
            +
             | 
| 5994 | 
            +
            	<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
         | 
| 5995 | 
            +
            		<fo:inline xsl:use-attribute-sets="table-fmt-fn-label-style" role="SKIP">
         | 
| 5996 | 
            +
            			<xsl:call-template name="refine_table-fmt-fn-label-style"/>
         | 
| 5997 | 
            +
            			<xsl:apply-templates/>
         | 
| 5998 | 
            +
            		</fo:inline>
         | 
| 5999 | 
            +
            	</xsl:template>
         | 
| 6000 | 
            +
             | 
| 6001 | 
            +
            	<!-- <xsl:template match="*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']"/> -->
         | 
| 6002 | 
            +
            	<!-- 
         | 
| 5898 6003 | 
             
            	<xsl:template name="create_fn">
         | 
| 5899 6004 | 
             
            		<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
         | 
| 5900 | 
            -
            			<xsl:if test="ancestor::*[local-name()='table'][1]/@id">  | 
| 6005 | 
            +
            			<xsl:if test="ancestor::*[local-name()='table'][1]/@id">  - for footnotes in tables -
         | 
| 5901 6006 | 
             
            				<xsl:attribute name="id">
         | 
| 5902 6007 | 
             
            					<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
         | 
| 5903 6008 | 
             
            				</xsl:attribute>
         | 
| 5904 6009 | 
             
            			</xsl:if>
         | 
| 5905 | 
            -
             | 
| 5906 | 
            -
             | 
| 6010 | 
            +
            			<xsl:if test="$namespace = 'itu'">
         | 
| 6011 | 
            +
            				<xsl:if test="ancestor::*[local-name()='preface']">
         | 
| 6012 | 
            +
            					<xsl:attribute name="preface">true</xsl:attribute>
         | 
| 6013 | 
            +
            				</xsl:if>
         | 
| 6014 | 
            +
            			</xsl:if>
         | 
| 6015 | 
            +
            			<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
         | 
| 6016 | 
            +
            				<xsl:attribute name="id">
         | 
| 6017 | 
            +
            					<xsl:value-of select="@reference"/>
         | 
| 6018 | 
            +
            					<xsl:text>_</xsl:text>
         | 
| 6019 | 
            +
            					<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
         | 
| 6020 | 
            +
            				</xsl:attribute>
         | 
| 6021 | 
            +
            			</xsl:if>
         | 
| 6022 | 
            +
            			<xsl:apply-templates />
         | 
| 5907 6023 | 
             
            		</fn>
         | 
| 5908 | 
            -
            	</xsl:template>
         | 
| 6024 | 
            +
            	</xsl:template> -->
         | 
| 5909 6025 |  | 
| 5910 6026 | 
             
            	<!-- footnotes for table's name rendering -->
         | 
| 5911 6027 | 
             
            	<xsl:template name="table_name_fn_display">
         | 
| @@ -5924,123 +6040,171 @@ | |
| 5924 6040 | 
             
            	<!-- ============================ -->
         | 
| 5925 6041 | 
             
            	<!-- figure's footnotes rendering -->
         | 
| 5926 6042 | 
             
            	<!-- ============================ -->
         | 
| 5927 | 
            -
            	<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
         | 
| 5928 6043 |  | 
| 5929 | 
            -
             | 
| 5930 | 
            -
             | 
| 5931 | 
            -
             | 
| 5932 | 
            -
             | 
| 5933 | 
            -
             | 
| 5934 | 
            -
            		<xsl:variable name="figure_id" select="normalize-space($figure_id_)"/>
         | 
| 6044 | 
            +
            	<!-- figure/fmt-footnote-container -->
         | 
| 6045 | 
            +
            	<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-footnote-container']"/>
         | 
| 6046 | 
            +
             | 
| 6047 | 
            +
            	<!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
         | 
| 6048 | 
            +
            	<xsl:template name="figure_fn_display">
         | 
| 5935 6049 |  | 
| 5936 | 
            -
            		<!-- all footnotes relates to the current figure -->
         | 
| 5937 6050 | 
             
            		<xsl:variable name="references">
         | 
| 5938 | 
            -
            			<xsl:for-each select=" | 
| 5939 | 
            -
            				< | 
| 5940 | 
            -
             | 
| 5941 | 
            -
            				 | 
| 6051 | 
            +
            			<xsl:for-each select="./*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
         | 
| 6052 | 
            +
            				<xsl:variable name="curr_id" select="@id"/>
         | 
| 6053 | 
            +
            				<!-- <curr_id><xsl:value-of select="$curr_id"/></curr_id>
         | 
| 6054 | 
            +
            				<curr><xsl:copy-of select="."/></curr>
         | 
| 6055 | 
            +
            				<ancestor><xsl:copy-of select="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn']]]"/></ancestor> -->
         | 
| 6056 | 
            +
            				<xsl:choose>
         | 
| 6057 | 
            +
            					<!-- skip figure/name/fn -->
         | 
| 6058 | 
            +
            					<xsl:when test="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn'][@target = $curr_id]]]"><!-- skip --></xsl:when>
         | 
| 6059 | 
            +
            					<xsl:otherwise>
         | 
| 6060 | 
            +
            						<xsl:element name="figure" namespace="{$namespace_full}">
         | 
| 6061 | 
            +
            							<xsl:element name="fmt-footnote-container" namespace="{$namespace_full}">
         | 
| 6062 | 
            +
            								<xsl:copy-of select="."/>
         | 
| 6063 | 
            +
            							</xsl:element>
         | 
| 6064 | 
            +
            						</xsl:element>
         | 
| 6065 | 
            +
            					</xsl:otherwise>
         | 
| 6066 | 
            +
            				</xsl:choose>
         | 
| 5942 6067 | 
             
            			</xsl:for-each>
         | 
| 5943 6068 | 
             
            		</xsl:variable>
         | 
| 6069 | 
            +
            		<!-- <references><xsl:copy-of select="$references"/></references> -->
         | 
| 5944 6070 |  | 
| 5945 | 
            -
            		<xsl:if test="xalan:nodeset($references) | 
| 6071 | 
            +
            		<xsl:if test="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
         | 
| 5946 6072 |  | 
| 5947 6073 | 
             
            			<xsl:variable name="key_iso">
         | 
| 5948 6074 | 
             
            				true
         | 
| 5949 6075 | 
             
            			</xsl:variable>
         | 
| 5950 6076 |  | 
| 5951 6077 | 
             
            			<fo:block>
         | 
| 6078 | 
            +
            				<!-- current hierarchy is 'figure' element -->
         | 
| 6079 | 
            +
            				<xsl:variable name="following_dl_colwidths">
         | 
| 6080 | 
            +
            					<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
         | 
| 6081 | 
            +
            						<xsl:variable name="simple-table">
         | 
| 6082 | 
            +
            							<!-- <xsl:variable name="doc_ns">
         | 
| 6083 | 
            +
            								<xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
         | 
| 6084 | 
            +
            							</xsl:variable>
         | 
| 6085 | 
            +
            							<xsl:variable name="ns">
         | 
| 6086 | 
            +
            								<xsl:choose>
         | 
| 6087 | 
            +
            									<xsl:when test="normalize-space($doc_ns)  != ''">
         | 
| 6088 | 
            +
            										<xsl:value-of select="normalize-space($doc_ns)"/>
         | 
| 6089 | 
            +
            									</xsl:when>
         | 
| 6090 | 
            +
            									<xsl:otherwise>
         | 
| 6091 | 
            +
            										<xsl:value-of select="substring-before(name(/*), '-')"/>
         | 
| 6092 | 
            +
            									</xsl:otherwise>
         | 
| 6093 | 
            +
            								</xsl:choose>
         | 
| 6094 | 
            +
            							</xsl:variable> -->
         | 
| 5952 6095 |  | 
| 5953 | 
            -
            						<!-- current hierarchy is 'figure' element -->
         | 
| 5954 | 
            -
            						<xsl:variable name="following_dl_colwidths">
         | 
| 5955 | 
            -
            							<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
         | 
| 5956 | 
            -
            								<xsl:variable name="simple-table">
         | 
| 5957 | 
            -
            									<!-- <xsl:variable name="doc_ns">
         | 
| 5958 | 
            -
            										<xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
         | 
| 5959 | 
            -
            									</xsl:variable>
         | 
| 5960 | 
            -
            									<xsl:variable name="ns">
         | 
| 5961 | 
            -
            										<xsl:choose>
         | 
| 5962 | 
            -
            											<xsl:when test="normalize-space($doc_ns)  != ''">
         | 
| 5963 | 
            -
            												<xsl:value-of select="normalize-space($doc_ns)"/>
         | 
| 5964 | 
            -
            											</xsl:when>
         | 
| 5965 | 
            -
            											<xsl:otherwise>
         | 
| 5966 | 
            -
            												<xsl:value-of select="substring-before(name(/*), '-')"/>
         | 
| 5967 | 
            -
            											</xsl:otherwise>
         | 
| 5968 | 
            -
            										</xsl:choose>
         | 
| 5969 | 
            -
            									</xsl:variable> -->
         | 
| 5970 | 
            -
             | 
| 5971 | 
            -
            									<xsl:for-each select="*[local-name() = 'dl'][1]">
         | 
| 5972 | 
            -
            										<tbody>
         | 
| 5973 | 
            -
            											<xsl:apply-templates mode="dl"/>
         | 
| 5974 | 
            -
            										</tbody>
         | 
| 5975 | 
            -
            									</xsl:for-each>
         | 
| 5976 | 
            -
            								</xsl:variable>
         | 
| 5977 | 
            -
             | 
| 5978 | 
            -
            								<xsl:call-template name="calculate-column-widths">
         | 
| 5979 | 
            -
            									<xsl:with-param name="cols-count" select="2"/>
         | 
| 5980 | 
            -
            									<xsl:with-param name="table" select="$simple-table"/>
         | 
| 5981 | 
            -
            								</xsl:call-template>
         | 
| 5982 | 
            -
             | 
| 5983 | 
            -
            							</xsl:if>
         | 
| 5984 | 
            -
            						</xsl:variable>
         | 
| 5985 | 
            -
             | 
| 5986 | 
            -
            						<xsl:variable name="maxlength_dt">
         | 
| 5987 6096 | 
             
            							<xsl:for-each select="*[local-name() = 'dl'][1]">
         | 
| 5988 | 
            -
            								< | 
| 6097 | 
            +
            								<tbody>
         | 
| 6098 | 
            +
            									<xsl:apply-templates mode="dl"/>
         | 
| 6099 | 
            +
            								</tbody>
         | 
| 5989 6100 | 
             
            							</xsl:for-each>
         | 
| 5990 6101 | 
             
            						</xsl:variable>
         | 
| 5991 6102 |  | 
| 5992 | 
            -
            						< | 
| 5993 | 
            -
            							<xsl: | 
| 5994 | 
            -
             | 
| 6103 | 
            +
            						<xsl:call-template name="calculate-column-widths">
         | 
| 6104 | 
            +
            							<xsl:with-param name="cols-count" select="2"/>
         | 
| 6105 | 
            +
            							<xsl:with-param name="table" select="$simple-table"/>
         | 
| 6106 | 
            +
            						</xsl:call-template>
         | 
| 5995 6107 |  | 
| 5996 | 
            -
             | 
| 6108 | 
            +
            					</xsl:if>
         | 
| 6109 | 
            +
            				</xsl:variable>
         | 
| 5997 6110 |  | 
| 5998 | 
            -
             | 
| 5999 | 
            -
             | 
| 6000 | 
            -
             | 
| 6001 | 
            -
             | 
| 6002 | 
            -
             | 
| 6003 | 
            -
             | 
| 6004 | 
            -
             | 
| 6005 | 
            -
             | 
| 6006 | 
            -
             | 
| 6007 | 
            -
             | 
| 6008 | 
            -
             | 
| 6009 | 
            -
             | 
| 6010 | 
            -
             | 
| 6011 | 
            -
             | 
| 6012 | 
            -
             | 
| 6013 | 
            -
             | 
| 6014 | 
            -
             | 
| 6015 | 
            -
             | 
| 6016 | 
            -
             | 
| 6017 | 
            -
             | 
| 6018 | 
            -
             | 
| 6019 | 
            -
             | 
| 6020 | 
            -
             | 
| 6111 | 
            +
            				<xsl:variable name="maxlength_dt">
         | 
| 6112 | 
            +
            					<xsl:for-each select="*[local-name() = 'dl'][1]">
         | 
| 6113 | 
            +
            						<xsl:call-template name="getMaxLength_dt"/>
         | 
| 6114 | 
            +
            					</xsl:for-each>
         | 
| 6115 | 
            +
            				</xsl:variable>
         | 
| 6116 | 
            +
             | 
| 6117 | 
            +
            				<fo:table width="95%" table-layout="fixed">
         | 
| 6118 | 
            +
            					<xsl:if test="normalize-space($key_iso) = 'true'">
         | 
| 6119 | 
            +
            						<xsl:attribute name="font-size">10pt</xsl:attribute>
         | 
| 6120 | 
            +
             | 
| 6121 | 
            +
            							<xsl:attribute name="font-size">8pt</xsl:attribute>
         | 
| 6122 | 
            +
             | 
| 6123 | 
            +
            					</xsl:if>
         | 
| 6124 | 
            +
            					<xsl:choose>
         | 
| 6125 | 
            +
            						<!-- if there 'dl', then set same columns width -->
         | 
| 6126 | 
            +
            						<xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
         | 
| 6127 | 
            +
            							<xsl:call-template name="setColumnWidth_dl">
         | 
| 6128 | 
            +
            								<xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
         | 
| 6129 | 
            +
            								<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
         | 
| 6130 | 
            +
            							</xsl:call-template>
         | 
| 6131 | 
            +
            						</xsl:when>
         | 
| 6132 | 
            +
            						<xsl:otherwise>
         | 
| 6133 | 
            +
            							<fo:table-column column-width="5%"/>
         | 
| 6134 | 
            +
            							<fo:table-column column-width="95%"/>
         | 
| 6135 | 
            +
            						</xsl:otherwise>
         | 
| 6136 | 
            +
            					</xsl:choose>
         | 
| 6137 | 
            +
            					<fo:table-body>
         | 
| 6138 | 
            +
            						<!-- <xsl:for-each select="xalan:nodeset($references)//fn"> -->
         | 
| 6139 | 
            +
            						<xsl:for-each select="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
         | 
| 6140 | 
            +
             | 
| 6141 | 
            +
            							<xsl:variable name="reference" select="@reference"/>
         | 
| 6142 | 
            +
            							<!-- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
         | 
| 6143 | 
            +
            								<fo:table-row>
         | 
| 6144 | 
            +
            									<fo:table-cell>
         | 
| 6145 | 
            +
            										<fo:block>
         | 
| 6146 | 
            +
             | 
| 6147 | 
            +
            													<fo:inline id="{@id}" xsl:use-attribute-sets="figure-fmt-fn-label-style">
         | 
| 6148 | 
            +
            														<!-- <xsl:attribute name="padding-right">0mm</xsl:attribute> -->
         | 
| 6149 | 
            +
            														<!-- <xsl:value-of select="@reference"/> -->
         | 
| 6150 | 
            +
            														<xsl:value-of select="normalize-space(.//*[local-name() = 'fmt-fn-label'])"/>
         | 
| 6021 6151 | 
             
            													</fo:inline>
         | 
| 6022 | 
            -
            												</fo:block>
         | 
| 6023 | 
            -
            											</fo:table-cell>
         | 
| 6024 | 
            -
            											<fo:table-cell>
         | 
| 6025 | 
            -
            												<fo:block xsl:use-attribute-sets="figure-fn-body-style">
         | 
| 6026 | 
            -
            													<xsl:if test="normalize-space($key_iso) = 'true'">
         | 
| 6027 6152 |  | 
| 6028 | 
            -
             | 
| 6029 | 
            -
             | 
| 6030 | 
            -
             | 
| 6031 | 
            -
             | 
| 6032 | 
            -
             | 
| 6033 | 
            -
            									</xsl:if>
         | 
| 6034 | 
            -
            								</xsl:for-each>
         | 
| 6035 | 
            -
            							</fo:table-body>
         | 
| 6036 | 
            -
            						</fo:table>
         | 
| 6153 | 
            +
            										</fo:block>
         | 
| 6154 | 
            +
            									</fo:table-cell>
         | 
| 6155 | 
            +
            									<fo:table-cell>
         | 
| 6156 | 
            +
            										<fo:block xsl:use-attribute-sets="figure-fn-body-style">
         | 
| 6157 | 
            +
            											<xsl:if test="normalize-space($key_iso) = 'true'">
         | 
| 6037 6158 |  | 
| 6159 | 
            +
            											</xsl:if>
         | 
| 6160 | 
            +
             | 
| 6161 | 
            +
            											<!-- <xsl:copy-of select="./node()"/> -->
         | 
| 6162 | 
            +
            											<xsl:apply-templates/>
         | 
| 6163 | 
            +
            										</fo:block>
         | 
| 6164 | 
            +
            									</fo:table-cell>
         | 
| 6165 | 
            +
            								</fo:table-row>
         | 
| 6166 | 
            +
            							<!-- </xsl:if> -->
         | 
| 6167 | 
            +
            						</xsl:for-each>
         | 
| 6168 | 
            +
            					</fo:table-body>
         | 
| 6169 | 
            +
            				</fo:table>
         | 
| 6038 6170 | 
             
            			</fo:block>
         | 
| 6039 6171 | 
             
            		</xsl:if>
         | 
| 6040 | 
            -
            	</xsl:template> <!--  | 
| 6172 | 
            +
            	</xsl:template> <!-- figure_fn_display -->
         | 
| 6173 | 
            +
             | 
| 6174 | 
            +
            	<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
         | 
| 6175 | 
            +
            		<xsl:param name="process">false</xsl:param>
         | 
| 6176 | 
            +
            		<xsl:if test="$process = 'true'">
         | 
| 6177 | 
            +
            			<fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
         | 
| 6178 | 
            +
            				<xsl:attribute name="padding-right">0mm</xsl:attribute>
         | 
| 6179 | 
            +
             | 
| 6180 | 
            +
            				<!-- tab is padding-right -->
         | 
| 6181 | 
            +
            				<xsl:apply-templates select=".//*[local-name() = 'tab']">
         | 
| 6182 | 
            +
            					<xsl:with-param name="process">true</xsl:with-param>
         | 
| 6183 | 
            +
            				</xsl:apply-templates>
         | 
| 6184 | 
            +
             | 
| 6185 | 
            +
            				<xsl:apply-templates/>
         | 
| 6186 | 
            +
             | 
| 6187 | 
            +
            			</fo:inline>
         | 
| 6188 | 
            +
            		</xsl:if>
         | 
| 6189 | 
            +
            	</xsl:template> <!--  figure//fmt-fn-body//fmt-fn-label -->
         | 
| 6190 | 
            +
             | 
| 6191 | 
            +
            	<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
         | 
| 6192 | 
            +
            		<xsl:param name="process">false</xsl:param>
         | 
| 6193 | 
            +
            		<xsl:if test="$process = 'true'">
         | 
| 6194 | 
            +
             | 
| 6195 | 
            +
            		</xsl:if>
         | 
| 6196 | 
            +
            	</xsl:template>
         | 
| 6197 | 
            +
             | 
| 6198 | 
            +
            	<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
         | 
| 6199 | 
            +
            		<fo:inline xsl:use-attribute-sets="figure-fmt-fn-label-style" role="SKIP">
         | 
| 6200 | 
            +
            			<xsl:call-template name="refine_figure-fmt-fn-label-style"/>
         | 
| 6201 | 
            +
            			<xsl:apply-templates/>
         | 
| 6202 | 
            +
            		</fo:inline>
         | 
| 6203 | 
            +
            	</xsl:template>
         | 
| 6041 6204 |  | 
| 6042 6205 | 
             
            	<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
         | 
| 6043 6206 | 
             
            	<!-- figure's footnote label -->
         | 
| 6207 | 
            +
            	<!-- figure/dl[@key = 'true']/dt/p/sup -->
         | 
| 6044 6208 | 
             
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/     *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
         | 
| 6045 6209 | 
             
            		<xsl:variable name="key_iso">
         | 
| 6046 6210 | 
             
            			true
         | 
| @@ -6051,7 +6215,7 @@ | |
| 6051 6215 | 
             
            				<xsl:attribute name="font-size">8pt</xsl:attribute>
         | 
| 6052 6216 |  | 
| 6053 6217 | 
             
            		</xsl:if>
         | 
| 6054 | 
            -
            		<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}"  -->
         | 
| 6218 | 
            +
            		<fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}"  -->
         | 
| 6055 6219 | 
             
            			<!-- <xsl:value-of select="@reference"/> -->
         | 
| 6056 6220 | 
             
            			<xsl:apply-templates/>
         | 
| 6057 6221 | 
             
            		</fo:inline>
         | 
| @@ -6061,38 +6225,65 @@ | |
| 6061 6225 | 
             
            	<!-- END: figure's footnotes rendering -->
         | 
| 6062 6226 | 
             
            	<!-- ============================ -->
         | 
| 6063 6227 |  | 
| 6064 | 
            -
            	<!-- fn reference in the  | 
| 6228 | 
            +
            	<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
         | 
| 6229 | 
            +
            	<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
         | 
| 6065 6230 | 
             
            	<xsl:template match="*[local-name()='fn']">
         | 
| 6066 6231 | 
             
            		<fo:inline xsl:use-attribute-sets="fn-reference-style">
         | 
| 6067 6232 |  | 
| 6068 6233 | 
             
            			<xsl:call-template name="refine_fn-reference-style"/>
         | 
| 6069 6234 |  | 
| 6070 | 
            -
            			<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference   | ancestor::*[local-name()='clause'][1]/@id-->
         | 
| 6071 | 
            -
             | 
| 6072 | 
            -
             | 
| 6235 | 
            +
            			<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference   | ancestor::*[local-name()='clause'][1]/@id-->
         | 
| 6236 | 
            +
            			<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
         | 
| 6237 | 
            +
            				<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
         | 
| 6238 | 
            +
            				<!-- 	<xsl:attribute name="internal-destination">
         | 
| 6073 6239 | 
             
            						<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
         | 
| 6074 6240 | 
             
            					</xsl:attribute>
         | 
| 6075 6241 | 
             
            				</xsl:if>
         | 
| 6242 | 
            +
            				<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
         | 
| 6243 | 
            +
            					<xsl:attribute name="internal-destination">
         | 
| 6244 | 
            +
            						<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
         | 
| 6245 | 
            +
            						<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
         | 
| 6246 | 
            +
            					</xsl:attribute>
         | 
| 6247 | 
            +
            				</xsl:if> -->
         | 
| 6248 | 
            +
            				<!-- <xsl:if test="$namespace = 'plateau'">
         | 
| 6249 | 
            +
            					<xsl:text>※</xsl:text>
         | 
| 6250 | 
            +
            				</xsl:if> -->
         | 
| 6251 | 
            +
            				<!-- <xsl:value-of select="@reference"/> -->
         | 
| 6076 6252 |  | 
| 6077 | 
            -
             | 
| 6253 | 
            +
            						<xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
         | 
| 6078 6254 |  | 
| 6255 | 
            +
            				<!-- <xsl:if test="$namespace = 'bsi'">
         | 
| 6256 | 
            +
            					<xsl:text>)</xsl:text>
         | 
| 6257 | 
            +
            				</xsl:if> -->
         | 
| 6079 6258 | 
             
            				<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
         | 
| 6080 6259 | 
             
            				<!-- <xsl:if test="$namespace = 'jis'">
         | 
| 6081 6260 | 
             
            					<fo:inline font-weight="normal">)</fo:inline>
         | 
| 6082 6261 | 
             
            				</xsl:if> -->
         | 
| 6083 6262 | 
             
            			</fo:basic-link>
         | 
| 6084 6263 | 
             
            		</fo:inline>
         | 
| 6085 | 
            -
            	</xsl:template>
         | 
| 6264 | 
            +
            	</xsl:template> <!-- fn -->
         | 
| 6086 6265 |  | 
| 6266 | 
            +
            	<!-- fn/text() -->
         | 
| 6087 6267 | 
             
            	<xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
         | 
| 6088 6268 | 
             
            		<fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
         | 
| 6089 6269 | 
             
            	</xsl:template>
         | 
| 6090 6270 |  | 
| 6091 | 
            -
            	 | 
| 6271 | 
            +
            	<!-- fn//p fmt-fn-body//p -->
         | 
| 6272 | 
            +
            	<xsl:template match="*[local-name()='fn']//*[local-name()='p'] | *[local-name() = 'fmt-fn-body']//*[local-name()='p']">
         | 
| 6092 6273 | 
             
            		<fo:inline role="P">
         | 
| 6093 6274 | 
             
            			<xsl:apply-templates/>
         | 
| 6094 6275 | 
             
            		</fo:inline>
         | 
| 6095 6276 | 
             
            	</xsl:template>
         | 
| 6277 | 
            +
             | 
| 6278 | 
            +
            	<xsl:template name="insertFootnoteSeparatorCommon">
         | 
| 6279 | 
            +
            		<xsl:param name="leader_length">30%</xsl:param>
         | 
| 6280 | 
            +
            		<fo:static-content flow-name="xsl-footnote-separator">
         | 
| 6281 | 
            +
            			<fo:block>
         | 
| 6282 | 
            +
            				<fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
         | 
| 6283 | 
            +
            			</fo:block>
         | 
| 6284 | 
            +
            		</fo:static-content>
         | 
| 6285 | 
            +
            	</xsl:template>
         | 
| 6286 | 
            +
             | 
| 6096 6287 | 
             
            	<!-- ===================== -->
         | 
| 6097 6288 | 
             
            	<!-- END Footnotes processing  -->
         | 
| 6098 6289 | 
             
            	<!-- ===================== -->
         | 
| @@ -6376,11 +6567,11 @@ | |
| 6376 6567 | 
             
            										<xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
         | 
| 6377 6568 | 
             
            										<!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
         | 
| 6378 6569 |  | 
| 6379 | 
            -
             | 
| 6380 | 
            -
             | 
| 6381 | 
            -
             | 
| 6382 | 
            -
             | 
| 6383 | 
            -
             | 
| 6570 | 
            +
            												<xsl:call-template name="setColumnWidth_dl">
         | 
| 6571 | 
            +
            													<xsl:with-param name="colwidths" select="$colwidths"/>
         | 
| 6572 | 
            +
            													<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
         | 
| 6573 | 
            +
            													<xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
         | 
| 6574 | 
            +
            												</xsl:call-template>
         | 
| 6384 6575 |  | 
| 6385 6576 | 
             
            										<fo:table-body>
         | 
| 6386 6577 |  | 
| @@ -6414,6 +6605,14 @@ | |
| 6414 6605 |  | 
| 6415 6606 | 
             
            	</xsl:template> <!-- END: dl -->
         | 
| 6416 6607 |  | 
| 6608 | 
            +
            	<xsl:template match="@*|node()" mode="dt_clean">
         | 
| 6609 | 
            +
            		<xsl:copy>
         | 
| 6610 | 
            +
            			<xsl:apply-templates select="@*|node()" mode="dt_clean"/>
         | 
| 6611 | 
            +
            		</xsl:copy>
         | 
| 6612 | 
            +
            	</xsl:template>
         | 
| 6613 | 
            +
             | 
| 6614 | 
            +
            	<xsl:template match="*[local-name() = 'asciimath']" mode="dt_clean"/>
         | 
| 6615 | 
            +
             | 
| 6417 6616 | 
             
            	<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
         | 
| 6418 6617 | 
             
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
         | 
| 6419 6618 | 
             
            		<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
         | 
| @@ -6448,10 +6647,12 @@ | |
| 6448 6647 | 
             
            	<!-- ignore 'p' with 'where' in formula, before 'dl' -->
         | 
| 6449 6648 | 
             
            	<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
         | 
| 6450 6649 |  | 
| 6650 | 
            +
            	<!-- dl/name -->
         | 
| 6451 6651 | 
             
            	<xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
         | 
| 6452 6652 | 
             
            		<xsl:param name="process">false</xsl:param>
         | 
| 6453 6653 | 
             
            		<xsl:if test="$process = 'true'">
         | 
| 6454 6654 | 
             
            			<fo:block xsl:use-attribute-sets="dl-name-style">
         | 
| 6655 | 
            +
             | 
| 6455 6656 | 
             
            				<xsl:apply-templates/>
         | 
| 6456 6657 | 
             
            			</fo:block>
         | 
| 6457 6658 | 
             
            		</xsl:if>
         | 
| @@ -6465,6 +6666,10 @@ | |
| 6465 6666 | 
             
            		<!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
         | 
| 6466 6667 |  | 
| 6467 6668 | 
             
            		<xsl:choose>
         | 
| 6669 | 
            +
            			<!-- <xsl:when test="@class = 'formula_dl' and local-name(..) = 'figure'">
         | 
| 6670 | 
            +
            				<fo:table-column column-width="10%"/>
         | 
| 6671 | 
            +
            				<fo:table-column column-width="90%"/>
         | 
| 6672 | 
            +
            			</xsl:when> -->
         | 
| 6468 6673 | 
             
            			<xsl:when test="xalan:nodeset($colwidths)/autolayout">
         | 
| 6469 6674 | 
             
            				<xsl:call-template name="insertTableColumnWidth">
         | 
| 6470 6675 | 
             
            					<xsl:with-param name="colwidths" select="$colwidths"/>
         | 
| @@ -7331,7 +7536,7 @@ | |
| 7331 7536 | 
             
            		<xsl:choose>
         | 
| 7332 7537 | 
             
            			<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
         | 
| 7333 7538 | 
             
            			<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
         | 
| 7334 | 
            -
            				<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
         | 
| 7539 | 
            +
            				<fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
         | 
| 7335 7540 | 
             
            			</xsl:when>
         | 
| 7336 7541 | 
             
            			<xsl:otherwise>
         | 
| 7337 7542 | 
             
            				<xsl:apply-templates/>
         | 
| @@ -7339,7 +7544,7 @@ | |
| 7339 7544 | 
             
            		</xsl:choose>
         | 
| 7340 7545 | 
             
            	</xsl:template>
         | 
| 7341 7546 | 
             
            	<xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and   following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
         | 
| 7342 | 
            -
            		<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
         | 
| 7547 | 
            +
            		<fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:value-of select="."/></fo:inline>
         | 
| 7343 7548 | 
             
            	</xsl:template>
         | 
| 7344 7549 |  | 
| 7345 7550 | 
             
            	<xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
         | 
| @@ -8379,24 +8584,26 @@ | |
| 8379 8584 | 
             
            			<xsl:apply-templates select="." mode="mathml"/>
         | 
| 8380 8585 | 
             
            		</xsl:variable>
         | 
| 8381 8586 |  | 
| 8382 | 
            -
            		<fo:instream-foreign-object fox:alt-text="Math">
         | 
| 8587 | 
            +
            		<fo:instream-foreign-object fox:alt-text="Math" fox:actual-text="Math">
         | 
| 8383 8588 |  | 
| 8384 8589 | 
             
            			<xsl:call-template name="refine_mathml_insteam_object_style"/>
         | 
| 8385 8590 |  | 
| 8386 | 
            -
            			 | 
| 8387 | 
            -
             | 
| 8388 | 
            -
             | 
| 8389 | 
            -
            				<xsl: | 
| 8390 | 
            -
             | 
| 8391 | 
            -
             | 
| 8392 | 
            -
            			<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
         | 
| 8393 | 
            -
            			<xsl:if test="normalize-space($asciimath_text_) != ''">
         | 
| 8394 | 
            -
            			<!-- put Mathin Alternate Text -->
         | 
| 8395 | 
            -
            				<xsl:attribute name="fox:alt-text">
         | 
| 8396 | 
            -
            					<xsl:value-of select="$asciimath_text_"/>
         | 
| 8591 | 
            +
            			<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 8592 | 
            +
            				<!-- put MathML in Actual Text -->
         | 
| 8593 | 
            +
            				<!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
         | 
| 8594 | 
            +
            				<xsl:attribute name="fox:actual-text">
         | 
| 8595 | 
            +
            					<xsl:value-of select="$mathml_content"/>
         | 
| 8397 8596 | 
             
            				</xsl:attribute>
         | 
| 8597 | 
            +
             | 
| 8598 | 
            +
            				<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
         | 
| 8599 | 
            +
            				<xsl:if test="normalize-space($asciimath_text_) != ''">
         | 
| 8600 | 
            +
            				<!-- put Mathin Alternate Text -->
         | 
| 8601 | 
            +
            					<xsl:attribute name="fox:alt-text">
         | 
| 8602 | 
            +
            						<xsl:value-of select="$asciimath_text_"/>
         | 
| 8603 | 
            +
            					</xsl:attribute>
         | 
| 8604 | 
            +
            				</xsl:if>
         | 
| 8605 | 
            +
            				<!-- </xsl:if> -->
         | 
| 8398 8606 | 
             
            			</xsl:if>
         | 
| 8399 | 
            -
            			<!-- </xsl:if> -->
         | 
| 8400 8607 |  | 
| 8401 8608 | 
             
            			<xsl:copy-of select="xalan:nodeset($mathml)"/>
         | 
| 8402 8609 |  | 
| @@ -8659,6 +8866,27 @@ | |
| 8659 8866 | 
             
            					<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
         | 
| 8660 8867 | 
             
            					<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
         | 
| 8661 8868 | 
             
            				</xsl:when> -->
         | 
| 8869 | 
            +
             | 
| 8870 | 
            +
            				<!-- <xsl:when test="not(starts-with(@target, 'http:') or starts-with(@target, 'https') or starts-with(@target, 'www') or starts-with(@target, 'mailto') or starts-with(@target, 'ftp'))">
         | 
| 8871 | 
            +
            					<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
         | 
| 8872 | 
            +
            					<xsl:variable name="filename">
         | 
| 8873 | 
            +
            						<xsl:call-template name="substring-after-last">
         | 
| 8874 | 
            +
            							<xsl:with-param name="value" select="$target_"/>
         | 
| 8875 | 
            +
            							<xsl:with-param name="delimiter" select="'/'"/>
         | 
| 8876 | 
            +
            						</xsl:call-template>
         | 
| 8877 | 
            +
            					</xsl:variable>
         | 
| 8878 | 
            +
            					<xsl:variable name="target_filepath" select="concat($inputxml_basepath, @target)"/>
         | 
| 8879 | 
            +
            					<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($target_filepath)))"/>
         | 
| 8880 | 
            +
            					<xsl:choose>
         | 
| 8881 | 
            +
            						<xsl:when test="$file_exists = 'true'">
         | 
| 8882 | 
            +
            							<xsl:value-of select="concat('url(embedded-file:', $filename, ')')"/>
         | 
| 8883 | 
            +
            						</xsl:when>
         | 
| 8884 | 
            +
            						<xsl:otherwise>
         | 
| 8885 | 
            +
            							<xsl:value-of select="normalize-space(@target)"/>
         | 
| 8886 | 
            +
            						</xsl:otherwise>
         | 
| 8887 | 
            +
            					</xsl:choose>
         | 
| 8888 | 
            +
            				</xsl:when> -->
         | 
| 8889 | 
            +
             | 
| 8662 8890 | 
             
            				<xsl:otherwise>
         | 
| 8663 8891 | 
             
            					<xsl:value-of select="normalize-space(@target)"/>
         | 
| 8664 8892 | 
             
            				</xsl:otherwise>
         | 
| @@ -8963,7 +9191,7 @@ | |
| 8963 9191 |  | 
| 8964 9192 | 
             
            	<xsl:template name="refine_note_block_style">
         | 
| 8965 9193 |  | 
| 8966 | 
            -
            	</xsl:template>
         | 
| 9194 | 
            +
            	</xsl:template> <!-- refine_note_block_style -->
         | 
| 8967 9195 |  | 
| 8968 9196 | 
             
            	<xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
         | 
| 8969 9197 | 
             
            		<xsl:variable name="num"><xsl:number/></xsl:variable>
         | 
| @@ -9155,10 +9383,21 @@ | |
| 9155 9383 | 
             
            	</xsl:template>
         | 
| 9156 9384 |  | 
| 9157 9385 | 
             
            	<xsl:template name="showFigureKey">
         | 
| 9158 | 
            -
            		<xsl:for-each select="*[local-name() = 'note' | 
| 9159 | 
            -
            			<xsl: | 
| 9386 | 
            +
            		<xsl:for-each select="*[(local-name() = 'note' and not(@type = 'units')) or local-name() = 'example']">
         | 
| 9387 | 
            +
            			<xsl:choose>
         | 
| 9388 | 
            +
            				<xsl:when test="local-name() = 'note'">
         | 
| 9389 | 
            +
            					<xsl:call-template name="note"/>
         | 
| 9390 | 
            +
            				</xsl:when>
         | 
| 9391 | 
            +
            				<xsl:when test="local-name() = 'example'">
         | 
| 9392 | 
            +
            					<xsl:call-template name="example"/>
         | 
| 9393 | 
            +
            				</xsl:when>
         | 
| 9394 | 
            +
            				<xsl:otherwise>
         | 
| 9395 | 
            +
            					<xsl:apply-templates select="."/>
         | 
| 9396 | 
            +
            				</xsl:otherwise>
         | 
| 9397 | 
            +
            			</xsl:choose>
         | 
| 9160 9398 | 
             
            		</xsl:for-each>
         | 
| 9161 | 
            -
            		 | 
| 9399 | 
            +
            		<!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
         | 
| 9400 | 
            +
            		<xsl:call-template name="figure_fn_display"/>
         | 
| 9162 9401 | 
             
            	</xsl:template>
         | 
| 9163 9402 |  | 
| 9164 9403 | 
             
            	<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
         | 
| @@ -10054,10 +10293,10 @@ | |
| 10054 10293 | 
             
            							<xsl:when test="@type = 'section-title'">
         | 
| 10055 10294 | 
             
            								<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
         | 
| 10056 10295 | 
             
            								<xsl:text>: </xsl:text>
         | 
| 10057 | 
            -
            								<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
         | 
| 10296 | 
            +
            								<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
         | 
| 10058 10297 | 
             
            							</xsl:when>
         | 
| 10059 10298 | 
             
            							<xsl:otherwise>
         | 
| 10060 | 
            -
            								<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
         | 
| 10299 | 
            +
            								<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
         | 
| 10061 10300 | 
             
            							</xsl:otherwise>
         | 
| 10062 10301 | 
             
            						</xsl:choose>
         | 
| 10063 10302 | 
             
            					</xsl:when>
         | 
| @@ -10122,6 +10361,8 @@ | |
| 10122 10361 | 
             
            	<xsl:template match="*[local-name() = 'origin']" mode="contents"/>
         | 
| 10123 10362 | 
             
            	<xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
         | 
| 10124 10363 |  | 
| 10364 | 
            +
            	<xsl:template match="*[local-name() = 'requirement'] |             *[local-name() = 'recommendation'] |              *[local-name() = 'permission']" mode="contents" priority="3"/>
         | 
| 10365 | 
            +
             | 
| 10125 10366 | 
             
            	<xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
         | 
| 10126 10367 | 
             
            	<xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
         | 
| 10127 10368 | 
             
            		<xsl:apply-templates mode="bookmarks"/>
         | 
| @@ -10143,6 +10384,8 @@ | |
| 10143 10384 | 
             
            	<xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
         | 
| 10144 10385 | 
             
            	<xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
         | 
| 10145 10386 |  | 
| 10387 | 
            +
            	<xsl:template match="*[local-name() = 'requirement'] |             *[local-name() = 'recommendation'] |              *[local-name() = 'permission']" mode="bookmarks" priority="3"/>
         | 
| 10388 | 
            +
             | 
| 10146 10389 | 
             
            	<!-- Bookmarks -->
         | 
| 10147 10390 | 
             
            	<xsl:template name="addBookmarks">
         | 
| 10148 10391 | 
             
            		<xsl:param name="contents"/>
         | 
| @@ -10399,9 +10642,15 @@ | |
| 10399 10642 | 
             
            		</xsl:if>
         | 
| 10400 10643 | 
             
            	</xsl:template>
         | 
| 10401 10644 |  | 
| 10645 | 
            +
            	<!-- figure/fn -->
         | 
| 10402 10646 | 
             
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
         | 
| 10403 | 
            -
            	 | 
| 10647 | 
            +
            	<!-- figure/note -->
         | 
| 10648 | 
            +
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
         | 
| 10649 | 
            +
            	<!-- figure/example -->
         | 
| 10650 | 
            +
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
         | 
| 10404 10651 |  | 
| 10652 | 
            +
            	<!-- figure/note[@type = 'units'] -->
         | 
| 10653 | 
            +
            	<!-- image/note[@type = 'units'] -->
         | 
| 10405 10654 | 
             
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] |         *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
         | 
| 10406 10655 | 
             
            		<fo:block text-align="right" keep-with-next="always">
         | 
| 10407 10656 | 
             
            			<xsl:apply-templates/>
         | 
| @@ -10522,6 +10771,7 @@ | |
| 10522 10771 | 
             
            			</xsl:choose>
         | 
| 10523 10772 | 
             
            	</xsl:template>
         | 
| 10524 10773 |  | 
| 10774 | 
            +
            	<!-- fn -->
         | 
| 10525 10775 | 
             
            	<xsl:template match="*[local-name() = 'fn']" mode="contents"/>
         | 
| 10526 10776 | 
             
            	<xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/>
         | 
| 10527 10777 |  | 
| @@ -11419,7 +11669,7 @@ | |
| 11419 11669 | 
             
            	     text line 1
         | 
| 11420 11670 | 
             
            			 text line 2
         | 
| 11421 11671 | 
             
            	-->
         | 
| 11422 | 
            -
            	<xsl:template match="*[local-name() = 'example']">
         | 
| 11672 | 
            +
            	<xsl:template match="*[local-name() = 'example']" name="example">
         | 
| 11423 11673 |  | 
| 11424 11674 | 
             
            				<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
         | 
| 11425 11675 |  | 
| @@ -11531,6 +11781,7 @@ | |
| 11531 11781 |  | 
| 11532 11782 | 
             
            	</xsl:template>
         | 
| 11533 11783 |  | 
| 11784 | 
            +
            	<!-- example/name -->
         | 
| 11534 11785 | 
             
            	<xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
         | 
| 11535 11786 | 
             
            		<xsl:param name="fo_element">block</xsl:param>
         | 
| 11536 11787 |  | 
| @@ -11556,7 +11807,8 @@ | |
| 11556 11807 |  | 
| 11557 11808 | 
             
            	</xsl:template>
         | 
| 11558 11809 |  | 
| 11559 | 
            -
            	 | 
| 11810 | 
            +
            	<!-- table/example/name, table/tfoot//example/name -->
         | 
| 11811 | 
            +
            	<xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name'] |  *[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'example']/*[local-name() = 'name']">
         | 
| 11560 11812 | 
             
            		<fo:inline xsl:use-attribute-sets="example-name-style">
         | 
| 11561 11813 |  | 
| 11562 11814 | 
             
            			<xsl:apply-templates/>
         | 
| @@ -12032,21 +12284,32 @@ | |
| 12032 12284 | 
             
            	<!-- ========== -->
         | 
| 12033 12285 |  | 
| 12034 12286 | 
             
            	<xsl:variable name="reviews_">
         | 
| 12035 | 
            -
            		<xsl:for-each select="//*[local-name() = 'review'][@from]">
         | 
| 12287 | 
            +
            		<xsl:for-each select="//*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])][@from]">
         | 
| 12036 12288 | 
             
            			<xsl:copy>
         | 
| 12037 12289 | 
             
            				<xsl:copy-of select="@from"/>
         | 
| 12038 12290 | 
             
            				<xsl:copy-of select="@id"/>
         | 
| 12039 12291 | 
             
            			</xsl:copy>
         | 
| 12040 12292 | 
             
            		</xsl:for-each>
         | 
| 12293 | 
            +
            		<xsl:for-each select="//*[local-name() = 'fmt-review-start'][@source]">
         | 
| 12294 | 
            +
            			<xsl:copy>
         | 
| 12295 | 
            +
            				<xsl:copy-of select="@source"/>
         | 
| 12296 | 
            +
            				<xsl:copy-of select="@id"/>
         | 
| 12297 | 
            +
            			</xsl:copy>
         | 
| 12298 | 
            +
            		</xsl:for-each>
         | 
| 12041 12299 | 
             
            	</xsl:variable>
         | 
| 12042 12300 | 
             
            	<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
         | 
| 12043 12301 |  | 
| 12044 12302 | 
             
            	<xsl:template name="addReviewHelper">
         | 
| 12045 | 
            -
            		 | 
| 12046 | 
            -
             | 
| 12047 | 
            -
             | 
| 12048 | 
            -
             | 
| 12049 | 
            -
            			< | 
| 12303 | 
            +
            		<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 12304 | 
            +
            			<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
         | 
| 12305 | 
            +
            			<xsl:variable name="curr_id" select="@id"/>
         | 
| 12306 | 
            +
            			<!-- <xsl:variable name="review_id" select="normalize-space(/@id)"/> -->
         | 
| 12307 | 
            +
            			<xsl:for-each select="$reviews//*[local-name() = 'review'][@from = $curr_id]"> <!-- $reviews//*[local-name() = 'fmt-review-start'][@source = $curr_id] -->
         | 
| 12308 | 
            +
            				<xsl:variable name="review_id" select="normalize-space(@id)"/>
         | 
| 12309 | 
            +
            				<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
         | 
| 12310 | 
            +
            					<fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
         | 
| 12311 | 
            +
            				</xsl:if>
         | 
| 12312 | 
            +
            			</xsl:for-each>
         | 
| 12050 12313 | 
             
            		</xsl:if>
         | 
| 12051 12314 | 
             
            		<!-- <fo:block>
         | 
| 12052 12315 | 
             
            			<curr_id><xsl:value-of select="$curr_id"/></curr_id>
         | 
| @@ -12183,14 +12446,61 @@ | |
| 12183 12446 |  | 
| 12184 12447 | 
             
            	</xsl:template>
         | 
| 12185 12448 |  | 
| 12186 | 
            -
            	 | 
| 12449 | 
            +
            	<!-- document text (not figures, or tables) footnotes -->
         | 
| 12450 | 
            +
            	<xsl:variable name="reviews_container_">
         | 
| 12451 | 
            +
            		<xsl:for-each select="//*[local-name() = 'review-container']/*[local-name() = 'fmt-review-body']">
         | 
| 12452 | 
            +
            			<xsl:variable name="update_xml_step1">
         | 
| 12453 | 
            +
            				<xsl:apply-templates select="." mode="update_xml_step1"/>
         | 
| 12454 | 
            +
            			</xsl:variable>
         | 
| 12455 | 
            +
            			<xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
         | 
| 12456 | 
            +
            		</xsl:for-each>
         | 
| 12457 | 
            +
            	</xsl:variable>
         | 
| 12458 | 
            +
            	<xsl:variable name="reviews_container" select="xalan:nodeset($reviews_container_)"/>
         | 
| 12459 | 
            +
             | 
| 12460 | 
            +
            	<xsl:template match="*[local-name() = 'review-container']"/>
         | 
| 12461 | 
            +
             | 
| 12462 | 
            +
            	<!-- for old Presentation XML (before https://github.com/metanorma/isodoc/issues/670) -->
         | 
| 12463 | 
            +
            	<xsl:template match="*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])]">  <!-- 'review' will be processed in mn2pdf/review.xsl -->
         | 
| 12464 | 
            +
            		<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
         | 
| 12465 | 
            +
            		<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 12466 | 
            +
            		<xsl:choose>
         | 
| 12467 | 
            +
            			<!-- if there isn't the attribute '@from', then -->
         | 
| 12468 | 
            +
            			<xsl:when test="$id_from = ''">
         | 
| 12469 | 
            +
            				<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
         | 
| 12470 | 
            +
            			</xsl:when>
         | 
| 12471 | 
            +
            			<!-- if there isn't element with id 'from', then create 'bookmark' here -->
         | 
| 12472 | 
            +
            			<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
         | 
| 12473 | 
            +
            				<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
         | 
| 12474 | 
            +
            			</xsl:when>
         | 
| 12475 | 
            +
            			<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
         | 
| 12476 | 
            +
            				<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
         | 
| 12477 | 
            +
            			</xsl:when>
         | 
| 12478 | 
            +
            		</xsl:choose>
         | 
| 12479 | 
            +
            		</xsl:if>
         | 
| 12480 | 
            +
            	</xsl:template>
         | 
| 12481 | 
            +
             | 
| 12482 | 
            +
            	<!-- for new Presentation XML (https://github.com/metanorma/isodoc/issues/670) -->
         | 
| 12483 | 
            +
            	<xsl:template match="*[local-name() = 'fmt-review-start']" name="fmt-review-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
         | 
| 12187 12484 | 
             
            		<!-- comment 2019-11-29 -->
         | 
| 12188 12485 | 
             
            		<!-- <fo:block font-weight="bold">Review:</fo:block>
         | 
| 12189 12486 | 
             
            		<xsl:apply-templates /> -->
         | 
| 12190 12487 |  | 
| 12191 | 
            -
            		<xsl:variable name="id_from" select="normalize-space(current()/@ | 
| 12488 | 
            +
            		<xsl:variable name="id_from" select="normalize-space(current()/@source)"/>
         | 
| 12192 12489 |  | 
| 12193 | 
            -
            		<xsl: | 
| 12490 | 
            +
            		<xsl:variable name="source" select="normalize-space(@source)"/>
         | 
| 12491 | 
            +
             | 
| 12492 | 
            +
            		<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 12493 | 
            +
            		<!-- <xsl:variable name="id_from" select="normalize-space(current()/@from)"/> -->
         | 
| 12494 | 
            +
             | 
| 12495 | 
            +
            		<!-- <xsl:if test="@source = @end"> -->
         | 
| 12496 | 
            +
            		<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
         | 
| 12497 | 
            +
            				following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
         | 
| 12498 | 
            +
            			<!-- <fo:block id="{$source}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$source}" fox:alt-text="Annot___{$source}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block> -->
         | 
| 12499 | 
            +
            			<fo:block id="{@id}" font-size="1pt" role="SKIP" keep-with-next="always" line-height="0.1"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
         | 
| 12500 | 
            +
            		<!-- </xsl:if> -->
         | 
| 12501 | 
            +
            		</xsl:if>
         | 
| 12502 | 
            +
             | 
| 12503 | 
            +
            		<xsl:if test="1 = 2">
         | 
| 12194 12504 | 
             
            		<xsl:choose>
         | 
| 12195 12505 | 
             
            			<!-- if there isn't the attribute '@from', then -->
         | 
| 12196 12506 | 
             
            			<xsl:when test="$id_from = ''">
         | 
| @@ -12198,10 +12508,10 @@ | |
| 12198 12508 | 
             
            			</xsl:when>
         | 
| 12199 12509 | 
             
            			<!-- if there isn't element with id 'from', then create 'bookmark' here -->
         | 
| 12200 12510 | 
             
            			<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
         | 
| 12201 | 
            -
            				<fo:block id="{ | 
| 12511 | 
            +
            				<fo:block id="{$id_from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$id_from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
         | 
| 12202 12512 | 
             
            			</xsl:when>
         | 
| 12203 12513 | 
             
            			<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
         | 
| 12204 | 
            -
            				<fo:block id="{ | 
| 12514 | 
            +
            				<fo:block id="{$id_from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$id_from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
         | 
| 12205 12515 | 
             
            			</xsl:when>
         | 
| 12206 12516 | 
             
            		</xsl:choose>
         | 
| 12207 12517 | 
             
            		</xsl:if>
         | 
| @@ -12252,16 +12562,21 @@ | |
| 12252 12562 | 
             
            		<xsl:variable name="list_level">
         | 
| 12253 12563 | 
             
            			<xsl:choose>
         | 
| 12254 12564 | 
             
            				<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
         | 
| 12255 | 
            -
            				<xsl: | 
| 12565 | 
            +
            				<xsl:when test="$ul_labels/label[@level = 3]"><xsl:value-of select="$list_level_ mod 3"/></xsl:when>
         | 
| 12566 | 
            +
            				<xsl:when test="$list_level_ mod 2 = 0">2</xsl:when>
         | 
| 12567 | 
            +
            				<xsl:otherwise><xsl:value-of select="$list_level_ mod 2"/></xsl:otherwise>
         | 
| 12256 12568 | 
             
            			</xsl:choose>
         | 
| 12257 12569 | 
             
            		</xsl:variable>
         | 
| 12258 12570 | 
             
            		<xsl:choose>
         | 
| 12259 12571 | 
             
            			<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
         | 
| 12260 12572 | 
             
            				<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
         | 
| 12261 12573 | 
             
            			</xsl:when>
         | 
| 12262 | 
            -
            			<xsl:when test="$list_level mod 3 = 0">
         | 
| 12574 | 
            +
            			<xsl:when test="$list_level mod 3 = 0 and $ul_labels/label[@level = 3]">
         | 
| 12263 12575 | 
             
            				<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
         | 
| 12264 12576 | 
             
            			</xsl:when>
         | 
| 12577 | 
            +
            			<xsl:when test="$list_level mod 3 = 0">
         | 
| 12578 | 
            +
            				<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
         | 
| 12579 | 
            +
            			</xsl:when>
         | 
| 12265 12580 | 
             
            			<xsl:when test="$list_level mod 2 = 0">
         | 
| 12266 12581 | 
             
            				<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
         | 
| 12267 12582 | 
             
            			</xsl:when>
         | 
| @@ -12808,10 +13123,22 @@ | |
| 12808 13123 | 
             
            	<xsl:template match="*[local-name() = 'table']/*[local-name() = 'bookmark']" priority="2"/>
         | 
| 12809 13124 |  | 
| 12810 13125 | 
             
            	<xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
         | 
| 12811 | 
            -
            		 | 
| 12812 | 
            -
            		< | 
| 12813 | 
            -
             | 
| 12814 | 
            -
             | 
| 13126 | 
            +
            		<xsl:variable name="bookmark_id" select="@id"/>
         | 
| 13127 | 
            +
            		<xsl:choose>
         | 
| 13128 | 
            +
            			<!-- Example:
         | 
| 13129 | 
            +
            				<fmt-review-start id="_7ef81cf7-3f6c-4ed4-9c1f-1ba092052bbd" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" end="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/>
         | 
| 13130 | 
            +
            				<bookmark id="_dda23915-8574-ef1e-29a1-822d465a5b97"/>
         | 
| 13131 | 
            +
            				<fmt-review-end id="_f336a8d0-08a8-4b7f-a1aa-b04688ed40c1" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" start="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/> -->
         | 
| 13132 | 
            +
            			<xsl:when test="1 = 2 and preceding-sibling::node()[local-name() = 'fmt-review-start'][@source = $bookmark_id] and        following-sibling::node()[local-name() = 'fmt-review-end'][@source = $bookmark_id]">
         | 
| 13133 | 
            +
            				<!-- skip here, see the template 'fmt-review-start' -->
         | 
| 13134 | 
            +
            			</xsl:when>
         | 
| 13135 | 
            +
            			<xsl:otherwise>
         | 
| 13136 | 
            +
            				<!-- <fo:inline id="{@id}" font-size="1pt"/> -->
         | 
| 13137 | 
            +
            				<fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[local-name() = 'fmt-review-start'][@source = $bookmark_id] and        following-sibling::node()[local-name() = 'fmt-review-end'][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
         | 
| 13138 | 
            +
            				<!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
         | 
| 13139 | 
            +
            				<xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
         | 
| 13140 | 
            +
            			</xsl:otherwise>
         | 
| 13141 | 
            +
            		</xsl:choose>
         | 
| 12815 13142 | 
             
            	</xsl:template>
         | 
| 12816 13143 | 
             
            	<!-- =================== -->
         | 
| 12817 13144 | 
             
            	<!-- End of Index processing -->
         | 
| @@ -13198,8 +13525,33 @@ | |
| 13198 13525 |  | 
| 13199 13526 | 
             
            	<xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
         | 
| 13200 13527 | 
             
            		<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
         | 
| 13528 | 
            +
            		<!-- New format: one tab <xref target="cgpm9th1948r6">“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
         | 
| 13529 | 
            +
            		<!-- <test><xsl:copy-of select="."/></test> -->
         | 
| 13530 | 
            +
             | 
| 13201 13531 | 
             
            		<xsl:variable name="target" select="@target"/>
         | 
| 13532 | 
            +
             | 
| 13202 13533 | 
             
            		<xsl:for-each select="*[local-name() = 'tab']">
         | 
| 13534 | 
            +
             | 
| 13535 | 
            +
            			<xsl:if test="position() = 1">
         | 
| 13536 | 
            +
            				<!-- first column (data before first `tab`) -->
         | 
| 13537 | 
            +
            				<fo:table-cell>
         | 
| 13538 | 
            +
            					<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
         | 
| 13539 | 
            +
            						<xsl:call-template name="insert_basic_link">
         | 
| 13540 | 
            +
            							<xsl:with-param name="element">
         | 
| 13541 | 
            +
            								<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
         | 
| 13542 | 
            +
            									<xsl:for-each select="preceding-sibling::node()">
         | 
| 13543 | 
            +
            										<xsl:choose>
         | 
| 13544 | 
            +
            											<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
         | 
| 13545 | 
            +
            											<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
         | 
| 13546 | 
            +
            										</xsl:choose>
         | 
| 13547 | 
            +
            									</xsl:for-each>
         | 
| 13548 | 
            +
            								</fo:basic-link>
         | 
| 13549 | 
            +
            							</xsl:with-param>
         | 
| 13550 | 
            +
            						</xsl:call-template>
         | 
| 13551 | 
            +
            					</fo:block>
         | 
| 13552 | 
            +
            				</fo:table-cell>
         | 
| 13553 | 
            +
            			</xsl:if>
         | 
| 13554 | 
            +
             | 
| 13203 13555 | 
             
            			<xsl:variable name="current_id" select="generate-id()"/>
         | 
| 13204 13556 | 
             
            			<fo:table-cell>
         | 
| 13205 13557 | 
             
            				<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
         | 
| @@ -13250,11 +13602,25 @@ | |
| 13250 13602 |  | 
| 13251 13603 | 
             
            	<xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
         | 
| 13252 13604 | 
             
            		<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
         | 
| 13605 | 
            +
            		<!-- New format - one tab <xref target="cgpm9th1948r6">“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
         | 
| 13253 13606 | 
             
            		<xsl:for-each select="*[local-name() = 'tab']">
         | 
| 13607 | 
            +
            			<xsl:if test="position() = 1">
         | 
| 13608 | 
            +
            				<td>
         | 
| 13609 | 
            +
            					<xsl:for-each select="preceding-sibling::node()">
         | 
| 13610 | 
            +
            						<xsl:choose>
         | 
| 13611 | 
            +
            							<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
         | 
| 13612 | 
            +
            							<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
         | 
| 13613 | 
            +
            						</xsl:choose>
         | 
| 13614 | 
            +
            					</xsl:for-each>
         | 
| 13615 | 
            +
            				</td>
         | 
| 13616 | 
            +
            			</xsl:if>
         | 
| 13254 13617 | 
             
            			<xsl:variable name="current_id" select="generate-id()"/>
         | 
| 13255 13618 | 
             
            			<td>
         | 
| 13256 13619 | 
             
            				<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
         | 
| 13257 | 
            -
            					<xsl: | 
| 13620 | 
            +
            					<xsl:choose>
         | 
| 13621 | 
            +
            						<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
         | 
| 13622 | 
            +
            						<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
         | 
| 13623 | 
            +
            					</xsl:choose>
         | 
| 13258 13624 | 
             
            				</xsl:for-each>
         | 
| 13259 13625 | 
             
            			</td>
         | 
| 13260 13626 | 
             
            		</xsl:for-each>
         | 
| @@ -13328,9 +13694,9 @@ | |
| 13328 13694 |  | 
| 13329 13695 | 
             
            										<fo:block text-align="justify">
         | 
| 13330 13696 | 
             
            											<fo:inline>
         | 
| 13331 | 
            -
            												<xsl:call-template name="displayAdmonitionName" | 
| 13332 | 
            -
            													<xsl:with-param name="sep"> – </xsl:with-param>
         | 
| 13333 | 
            -
            												</xsl:call-template>
         | 
| 13697 | 
            +
            												<xsl:call-template name="displayAdmonitionName"/>
         | 
| 13698 | 
            +
            													<!-- <xsl:with-param name="sep"> – </xsl:with-param>
         | 
| 13699 | 
            +
            												</xsl:call-template> -->
         | 
| 13334 13700 | 
             
            											</fo:inline>
         | 
| 13335 13701 | 
             
            											<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
         | 
| 13336 13702 | 
             
            										</fo:block>
         | 
| @@ -14124,6 +14490,9 @@ | |
| 14124 14490 | 
             
            	<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
         | 
| 14125 14491 | 
             
            	<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
         | 
| 14126 14492 |  | 
| 14493 | 
            +
            	<xsl:template match="*[local-name() = 'review-container']" mode="update_xml_step1"/>
         | 
| 14494 | 
            +
            	<xsl:template match="*[local-name() = 'review-container']" mode="update_xml_pres"/>
         | 
| 14495 | 
            +
             | 
| 14127 14496 | 
             
            	<!-- END: update new Presentation XML -->
         | 
| 14128 14497 |  | 
| 14129 14498 | 
             
            	<!-- =========================================================================== -->
         | 
| @@ -14647,6 +15016,7 @@ | |
| 14647 15016 | 
             
            			<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
         | 
| 14648 15017 | 
             
            		</fn>
         | 
| 14649 15018 | 
             
            	-->
         | 
| 15019 | 
            +
            	<!-- fn in text -->
         | 
| 14650 15020 | 
             
            	<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
         | 
| 14651 15021 | 
             
            		<xsl:variable name="p_fn_">
         | 
| 14652 15022 | 
             
            			<xsl:call-template name="get_fn_list"/>
         |