metanorma-ieee 1.4.1 → 1.4.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/html2doc/ieee/notes.rb +5 -4
- data/lib/isodoc/ieee/html/htmlstyle.css +7 -0
- data/lib/isodoc/ieee/ieee.amendment.xsl +622 -255
- data/lib/isodoc/ieee/ieee.standard.xsl +622 -255
- data/lib/isodoc/ieee/presentation_ref.rb +14 -7
- data/lib/isodoc/ieee/word_convert.rb +21 -15
- data/lib/isodoc/ieee/word_wp_convert.rb +2 -2
- data/lib/metanorma/ieee/basicdoc.rng +71 -59
- data/lib/metanorma/ieee/converter.rb +3 -2
- data/lib/metanorma/ieee/isodoc.rng +60 -18
- data/lib/metanorma/ieee/version.rb +1 -1
- metadata +2 -2
| @@ -2182,21 +2182,9 @@ | |
| 2182 2182 | 
             
            		</xsl:variable>
         | 
| 2183 2183 | 
             
            		<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
         | 
| 2184 2184 | 
             
            		<xsl:variable name="gen_id" select="generate-id(.)"/>
         | 
| 2185 | 
            -
            		<xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
         | 
| 2186 | 
            -
            		<xsl:variable name="reference_">
         | 
| 2187 | 
            -
            			<xsl:value-of select="@reference"/>
         | 
| 2188 | 
            -
            			<xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
         | 
| 2189 | 
            -
            		</xsl:variable>
         | 
| 2190 | 
            -
            		<xsl:variable name="reference" select="normalize-space($reference_)"/>
         | 
| 2191 | 
            -
            		<!-- fn sequence number in document -->
         | 
| 2192 | 
            -
            		<xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
         | 
| 2193 2185 |  | 
| 2194 2186 | 
             
            		<xsl:copy>
         | 
| 2195 2187 | 
             
            			<xsl:apply-templates select="@*" mode="flatxml"/>
         | 
| 2196 | 
            -
            			<!-- put actual reference number -->
         | 
| 2197 | 
            -
            			<xsl:attribute name="current_fn_number">
         | 
| 2198 | 
            -
            				<xsl:value-of select="$current_fn_number"/>
         | 
| 2199 | 
            -
            			</xsl:attribute>
         | 
| 2200 2188 | 
             
            			<xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
         | 
| 2201 2189 | 
             
            				<xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
         | 
| 2202 2190 | 
             
            			</xsl:attribute>
         | 
| @@ -2745,7 +2733,7 @@ | |
| 2745 2733 | 
             
            		<xsl:call-template name="fn"/>
         | 
| 2746 2734 | 
             
            	</xsl:template>
         | 
| 2747 2735 |  | 
| 2748 | 
            -
            	<xsl:template match="ieee:p/ieee:fn/ieee:p" priority="2">
         | 
| 2736 | 
            +
            	<xsl:template match="ieee:p/ieee:fn/ieee:p | *[local-name() = 'fmt-fn-body']//*[local-name()='p']" priority="2">
         | 
| 2749 2737 | 
             
            		<xsl:choose>
         | 
| 2750 2738 | 
             
            			<xsl:when test="preceding-sibling::ieee:p"> <!-- for multi-paragraphs footnotes -->
         | 
| 2751 2739 | 
             
            				<fo:block>
         | 
| @@ -2754,7 +2742,9 @@ | |
| 2754 2742 | 
             
            				</fo:block>
         | 
| 2755 2743 | 
             
            			</xsl:when>
         | 
| 2756 2744 | 
             
            			<xsl:otherwise>
         | 
| 2757 | 
            -
            				< | 
| 2745 | 
            +
            				<fo:inline role="P">
         | 
| 2746 | 
            +
            					<xsl:apply-templates/>
         | 
| 2747 | 
            +
            				</fo:inline>
         | 
| 2758 2748 | 
             
            			</xsl:otherwise>
         | 
| 2759 2749 | 
             
            		</xsl:choose>
         | 
| 2760 2750 | 
             
            	</xsl:template>
         | 
| @@ -4675,15 +4665,19 @@ | |
| 4675 4665 | 
             
            	</xsl:template>
         | 
| 4676 4666 |  | 
| 4677 4667 | 
             
            	<xsl:attribute-set name="table-fn-number-style">
         | 
| 4668 | 
            +
            		<!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
         | 
| 4669 | 
            +
             | 
| 4670 | 
            +
            	</xsl:attribute-set> <!-- table-fn-number-style -->
         | 
| 4671 | 
            +
             | 
| 4672 | 
            +
            	<xsl:attribute-set name="table-fmt-fn-label-style">
         | 
| 4678 4673 | 
             
            		<xsl:attribute name="font-size">80%</xsl:attribute>
         | 
| 4679 | 
            -
            		<xsl:attribute name="padding-right">5mm</xsl:attribute>
         | 
| 4680 4674 |  | 
| 4681 4675 | 
             
            			<xsl:attribute name="baseline-shift">30%</xsl:attribute>
         | 
| 4682 4676 | 
             
            			<xsl:attribute name="font-size">6.5pt</xsl:attribute>
         | 
| 4683 4677 |  | 
| 4684 | 
            -
            	</xsl:attribute-set> <!-- table-fn- | 
| 4678 | 
            +
            	</xsl:attribute-set> <!-- table-fmt-fn-label-style -->
         | 
| 4685 4679 |  | 
| 4686 | 
            -
            	<xsl:template name="refine_table-fn- | 
| 4680 | 
            +
            	<xsl:template name="refine_table-fmt-fn-label-style">
         | 
| 4687 4681 |  | 
| 4688 4682 | 
             
            	</xsl:template>
         | 
| 4689 4683 |  | 
| @@ -4698,11 +4692,18 @@ | |
| 4698 4692 | 
             
            	</xsl:attribute-set>
         | 
| 4699 4693 |  | 
| 4700 4694 | 
             
            	<xsl:attribute-set name="figure-fn-number-style">
         | 
| 4701 | 
            -
            		<xsl:attribute name="font-size">80%</xsl:attribute>
         | 
| 4702 4695 | 
             
            		<xsl:attribute name="padding-right">5mm</xsl:attribute>
         | 
| 4696 | 
            +
            	</xsl:attribute-set> <!-- figure-fn-number-style -->
         | 
| 4697 | 
            +
             | 
| 4698 | 
            +
            	<xsl:attribute-set name="figure-fmt-fn-label-style">
         | 
| 4699 | 
            +
            		<xsl:attribute name="font-size">80%</xsl:attribute>
         | 
| 4703 4700 | 
             
            		<xsl:attribute name="vertical-align">super</xsl:attribute>
         | 
| 4704 4701 |  | 
| 4705 | 
            -
            	</xsl:attribute-set>
         | 
| 4702 | 
            +
            	</xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
         | 
| 4703 | 
            +
             | 
| 4704 | 
            +
            	<xsl:template name="refine_figure-fmt-fn-label-style">
         | 
| 4705 | 
            +
             | 
| 4706 | 
            +
            	</xsl:template>
         | 
| 4706 4707 |  | 
| 4707 4708 | 
             
            	<xsl:attribute-set name="figure-fn-body-style">
         | 
| 4708 4709 | 
             
            		<xsl:attribute name="text-align">justify</xsl:attribute>
         | 
| @@ -5140,6 +5141,9 @@ | |
| 5140 5141 | 
             
            		<xsl:attribute name="font-size">80%</xsl:attribute>
         | 
| 5141 5142 | 
             
            		<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
         | 
| 5142 5143 |  | 
| 5144 | 
            +
            			<xsl:attribute name="font-size">65%</xsl:attribute>
         | 
| 5145 | 
            +
            			<xsl:attribute name="vertical-align">super</xsl:attribute>
         | 
| 5146 | 
            +
             | 
| 5143 5147 | 
             
            	</xsl:attribute-set>
         | 
| 5144 5148 |  | 
| 5145 5149 | 
             
            	<xsl:template name="refine_fn-reference-style">
         | 
| @@ -6233,9 +6237,13 @@ | |
| 6233 6237 |  | 
| 6234 6238 | 
             
            					<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']"/>
         | 
| 6235 6239 | 
             
            					<xsl:if test="$isNoteOrFnExist = 'true'">
         | 
| 6236 | 
            -
             | 
| 6237 | 
            -
             | 
| 6238 | 
            -
             | 
| 6240 | 
            +
            						<!-- <xsl:choose>
         | 
| 6241 | 
            +
            							<xsl:when test="$namespace = 'plateau'"></xsl:when>
         | 
| 6242 | 
            +
            							<xsl:otherwise>
         | 
| 6243 | 
            +
            								
         | 
| 6244 | 
            +
            							</xsl:otherwise>
         | 
| 6245 | 
            +
            						</xsl:choose> -->
         | 
| 6246 | 
            +
            						<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
         | 
| 6239 6247 | 
             
            					</xsl:if>
         | 
| 6240 6248 |  | 
| 6241 6249 | 
             
            					<xsl:choose>
         | 
| @@ -6282,7 +6290,7 @@ | |
| 6282 6290 | 
             
            									<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
         | 
| 6283 6291 | 
             
            								</xsl:when>
         | 
| 6284 6292 | 
             
            								<xsl:otherwise>
         | 
| 6285 | 
            -
            									<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 -->
         | 
| 6293 | 
            +
            									<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 -->
         | 
| 6286 6294 | 
             
            								</xsl:otherwise>
         | 
| 6287 6295 | 
             
            							</xsl:choose>
         | 
| 6288 6296 |  | 
| @@ -6293,13 +6301,26 @@ | |
| 6293 6301 |  | 
| 6294 6302 | 
             
            				<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
         | 
| 6295 6303 |  | 
| 6296 | 
            -
             | 
| 6297 | 
            -
             | 
| 6298 | 
            -
             | 
| 6299 | 
            -
             | 
| 6300 | 
            -
             | 
| 6301 | 
            -
             | 
| 6302 | 
            -
            						 | 
| 6304 | 
            +
            				<!-- https://github.com/metanorma/metanorma-plateau/issues/171 -->
         | 
| 6305 | 
            +
             | 
| 6306 | 
            +
            				<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
         | 
| 6307 | 
            +
            					<xsl:call-template name="insertTableFooterInSeparateTable">
         | 
| 6308 | 
            +
            						<xsl:with-param name="table_attributes" select="$table_attributes"/>
         | 
| 6309 | 
            +
            						<xsl:with-param name="colwidths" select="$colwidths"/>
         | 
| 6310 | 
            +
            						<xsl:with-param name="colgroup" select="$colgroup"/>
         | 
| 6311 | 
            +
            					</xsl:call-template>
         | 
| 6312 | 
            +
            				</xsl:for-each>
         | 
| 6313 | 
            +
             | 
| 6314 | 
            +
            				<!-- https://github.com/metanorma/metanorma-plateau/issues/171
         | 
| 6315 | 
            +
            				<xsl:if test="$namespace = 'plateau'">
         | 
| 6316 | 
            +
            					<xsl:apply-templates select="*[not(local-name()='thead') and not(local-name()='tbody') and not(local-name()='tfoot') and not(local-name()='name')]" />
         | 
| 6317 | 
            +
            					<xsl:for-each select="*[local-name()='tbody']"> - select context to tbody -
         | 
| 6318 | 
            +
            						<xsl:variable name="table_fn_block">
         | 
| 6319 | 
            +
            							<xsl:call-template name="table_fn_display" />
         | 
| 6320 | 
            +
            						</xsl:variable>
         | 
| 6321 | 
            +
            						<xsl:copy-of select="$table_fn_block"/>
         | 
| 6322 | 
            +
            					</xsl:for-each>
         | 
| 6323 | 
            +
            				</xsl:if> -->
         | 
| 6303 6324 |  | 
| 6304 6325 | 
             
            				<xsl:if test="*[local-name()='bookmark']"> <!-- special case: table/bookmark -->
         | 
| 6305 6326 | 
             
            					<fo:block keep-with-previous="always" line-height="0.1">
         | 
| @@ -6954,6 +6975,7 @@ | |
| 6954 6975 | 
             
            						<xsl:with-param name="key">continued</xsl:with-param>
         | 
| 6955 6976 | 
             
            					</xsl:call-template>
         | 
| 6956 6977 | 
             
            				</xsl:variable>
         | 
| 6978 | 
            +
             | 
| 6957 6979 | 
             
            				<xsl:variable name="title_continued_in_parenthesis" select="concat('(',$title_continued_,')')"/>
         | 
| 6958 6980 | 
             
            				<xsl:variable name="title_continued">
         | 
| 6959 6981 | 
             
            					<xsl:value-of select="$title_continued_in_parenthesis"/>
         | 
| @@ -7104,6 +7126,8 @@ | |
| 7104 7126 |  | 
| 7105 7127 | 
             
            	<xsl:template name="setTableRowAttributes">
         | 
| 7106 7128 |  | 
| 7129 | 
            +
            		<xsl:call-template name="setColors"/>
         | 
| 7130 | 
            +
             | 
| 7107 7131 | 
             
            	</xsl:template> <!-- setTableRowAttributes -->
         | 
| 7108 7132 | 
             
            	<!-- ===================== -->
         | 
| 7109 7133 | 
             
            	<!-- END Table's row processing -->
         | 
| @@ -7155,6 +7179,7 @@ | |
| 7155 7179 | 
             
            			</xsl:attribute>
         | 
| 7156 7180 | 
             
            		</xsl:if>
         | 
| 7157 7181 | 
             
            		<xsl:call-template name="display-align"/>
         | 
| 7182 | 
            +
            		<xsl:call-template name="setColors"/>
         | 
| 7158 7183 | 
             
            	</xsl:template>
         | 
| 7159 7184 |  | 
| 7160 7185 | 
             
            	<xsl:template name="display-align">
         | 
| @@ -7170,6 +7195,29 @@ | |
| 7170 7195 | 
             
            		</xsl:if>
         | 
| 7171 7196 | 
             
            	</xsl:template>
         | 
| 7172 7197 |  | 
| 7198 | 
            +
            	<xsl:template name="setColors">
         | 
| 7199 | 
            +
            		<xsl:variable name="styles__">
         | 
| 7200 | 
            +
            			<xsl:call-template name="split">
         | 
| 7201 | 
            +
            				<xsl:with-param name="pText" select="concat(@style,';')"/>
         | 
| 7202 | 
            +
            				<xsl:with-param name="sep" select="';'"/>
         | 
| 7203 | 
            +
            			</xsl:call-template>
         | 
| 7204 | 
            +
            		</xsl:variable>
         | 
| 7205 | 
            +
            		<xsl:variable name="quot">"</xsl:variable>
         | 
| 7206 | 
            +
            		<xsl:variable name="styles_">
         | 
| 7207 | 
            +
            			<xsl:for-each select="xalan:nodeset($styles__)/item">
         | 
| 7208 | 
            +
            				<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
         | 
| 7209 | 
            +
            				<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
         | 
| 7210 | 
            +
            				<xsl:if test="$key = 'color' or $key = 'background-color'">
         | 
| 7211 | 
            +
            					<style name="{$key}"><xsl:value-of select="$value"/></style>
         | 
| 7212 | 
            +
            				</xsl:if>
         | 
| 7213 | 
            +
            			</xsl:for-each>
         | 
| 7214 | 
            +
            		</xsl:variable>
         | 
| 7215 | 
            +
            		<xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
         | 
| 7216 | 
            +
            		<xsl:for-each select="$styles/style">
         | 
| 7217 | 
            +
            			<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
         | 
| 7218 | 
            +
            		</xsl:for-each>
         | 
| 7219 | 
            +
            	</xsl:template>
         | 
| 7220 | 
            +
             | 
| 7173 7221 | 
             
            	<!-- cell in table body, footer -->
         | 
| 7174 7222 | 
             
            	<xsl:template match="*[local-name()='td']" name="td">
         | 
| 7175 7223 | 
             
            		<fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
         | 
| @@ -7181,17 +7229,28 @@ | |
| 7181 7229 |  | 
| 7182 7230 | 
             
            			<xsl:call-template name="refine_table-cell-style"/>
         | 
| 7183 7231 |  | 
| 7232 | 
            +
            			<xsl:call-template name="setTableCellAttributes"/>
         | 
| 7233 | 
            +
             | 
| 7184 7234 | 
             
            			<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
         | 
| 7185 7235 | 
             
            				<xsl:attribute name="padding-right">1mm</xsl:attribute>
         | 
| 7186 7236 | 
             
            			</xsl:if>
         | 
| 7187 7237 |  | 
| 7188 | 
            -
            			<xsl:call-template name="setTableCellAttributes"/>
         | 
| 7189 | 
            -
             | 
| 7190 7238 | 
             
            			<xsl:if test="$isGenerateTableIF = 'true'">
         | 
| 7191 7239 | 
             
            				<xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
         | 
| 7192 7240 | 
             
            				<xsl:attribute name="text-align">left</xsl:attribute>
         | 
| 7193 7241 | 
             
            			</xsl:if>
         | 
| 7194 7242 |  | 
| 7243 | 
            +
            			<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 7244 | 
            +
            				<xsl:if test="@colspan and *[local-name() = 'note'][@type = 'units']">
         | 
| 7245 | 
            +
            					<xsl:attribute name="text-align">right</xsl:attribute>
         | 
| 7246 | 
            +
            					<xsl:attribute name="border">none</xsl:attribute>
         | 
| 7247 | 
            +
            					<xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
         | 
| 7248 | 
            +
            					<xsl:attribute name="border-top">1pt solid white</xsl:attribute>
         | 
| 7249 | 
            +
            					<xsl:attribute name="border-left">1pt solid white</xsl:attribute>
         | 
| 7250 | 
            +
            					<xsl:attribute name="border-right">1pt solid white</xsl:attribute>
         | 
| 7251 | 
            +
            				</xsl:if>
         | 
| 7252 | 
            +
            			</xsl:if>
         | 
| 7253 | 
            +
             | 
| 7195 7254 | 
             
            			<fo:block role="SKIP">
         | 
| 7196 7255 |  | 
| 7197 7256 | 
             
            				<xsl:if test="$isGenerateTableIF = 'true'">
         | 
| @@ -7210,7 +7269,8 @@ | |
| 7210 7269 | 
             
            		</fo:table-cell>
         | 
| 7211 7270 | 
             
            	</xsl:template> <!-- td -->
         | 
| 7212 7271 |  | 
| 7213 | 
            -
            	 | 
| 7272 | 
            +
            	<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
         | 
| 7273 | 
            +
            	<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">
         | 
| 7214 7274 |  | 
| 7215 7275 | 
             
            				<fo:block xsl:use-attribute-sets="table-note-style">
         | 
| 7216 7276 | 
             
            					<xsl:copy-of select="@id"/>
         | 
| @@ -7231,65 +7291,54 @@ | |
| 7231 7291 |  | 
| 7232 7292 | 
             
            	</xsl:template> <!-- table/note -->
         | 
| 7233 7293 |  | 
| 7234 | 
            -
            	<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
         | 
| 7294 | 
            +
            	<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">
         | 
| 7235 7295 | 
             
            		<xsl:apply-templates/>
         | 
| 7236 7296 | 
             
            	</xsl:template>
         | 
| 7237 7297 |  | 
| 7238 7298 | 
             
            	<!-- ===================== -->
         | 
| 7239 7299 | 
             
            	<!-- Footnotes processing  -->
         | 
| 7240 7300 | 
             
            	<!-- ===================== -->
         | 
| 7301 | 
            +
             | 
| 7302 | 
            +
            	<!-- document text (not figures, or tables) footnotes -->
         | 
| 7303 | 
            +
            	<xsl:variable name="footnotes_">
         | 
| 7304 | 
            +
            		<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 -->
         | 
| 7305 | 
            +
            			<!-- <xsl:copy-of select="."/> -->
         | 
| 7306 | 
            +
            			<xsl:variable name="update_xml_step1">
         | 
| 7307 | 
            +
            				<xsl:apply-templates select="." mode="update_xml_step1"/>
         | 
| 7308 | 
            +
            			</xsl:variable>
         | 
| 7309 | 
            +
            			<xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
         | 
| 7310 | 
            +
            		</xsl:for-each>
         | 
| 7311 | 
            +
            	</xsl:variable>
         | 
| 7312 | 
            +
            	<xsl:variable name="footnotes" select="xalan:nodeset($footnotes_)"/>
         | 
| 7313 | 
            +
             | 
| 7241 7314 | 
             
            	<!--
         | 
| 7242 7315 | 
             
            	<fn reference="1">
         | 
| 7243 7316 | 
             
            			<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
         | 
| 7244 7317 | 
             
            		</fn>
         | 
| 7245 7318 | 
             
            	-->
         | 
| 7246 | 
            -
            	<!-- footnotes in text (title, bibliography, main body, table's, figure's names | 
| 7319 | 
            +
            	<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
         | 
| 7320 | 
            +
            	<!-- fn in text -->
         | 
| 7247 7321 | 
             
            	<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">
         | 
| 7248 7322 |  | 
| 7249 | 
            -
            		<!-- list of  | 
| 7323 | 
            +
            		<!-- list of unique footnotes -->
         | 
| 7250 7324 | 
             
            		<xsl:variable name="p_fn_">
         | 
| 7251 7325 | 
             
            			<xsl:call-template name="get_fn_list"/>
         | 
| 7252 | 
            -
            			<!-- <xsl:choose>
         | 
| 7253 | 
            -
            				<xsl:when test="$namespace = 'jis'">
         | 
| 7254 | 
            -
            					<xsl:call-template name="get_fn_list_for_element"/>
         | 
| 7255 | 
            -
            				</xsl:when>
         | 
| 7256 | 
            -
            				<xsl:otherwise>
         | 
| 7257 | 
            -
            					<xsl:call-template name="get_fn_list"/>
         | 
| 7258 | 
            -
            				</xsl:otherwise>
         | 
| 7259 | 
            -
            			</xsl:choose> -->
         | 
| 7260 7326 | 
             
            		</xsl:variable>
         | 
| 7261 7327 | 
             
            		<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
         | 
| 7262 7328 |  | 
| 7263 7329 | 
             
            		<xsl:variable name="gen_id" select="generate-id(.)"/>
         | 
| 7264 | 
            -
             | 
| 7265 | 
            -
            		<xsl:variable name="reference_">
         | 
| 7266 | 
            -
            			<xsl:value-of select="@reference"/>
         | 
| 7267 | 
            -
            			<xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
         | 
| 7268 | 
            -
            		</xsl:variable>
         | 
| 7269 | 
            -
            		<xsl:variable name="reference" select="normalize-space($reference_)"/>
         | 
| 7330 | 
            +
             | 
| 7270 7331 | 
             
            		<!-- fn sequence number in document -->
         | 
| 7271 | 
            -
            		<xsl:variable name="current_fn_number" | 
| 7272 | 
            -
             | 
| 7273 | 
            -
            				<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
         | 
| 7274 | 
            -
            				<xsl:otherwise>
         | 
| 7275 | 
            -
            					<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
         | 
| 7276 | 
            -
            				</xsl:otherwise>
         | 
| 7277 | 
            -
            			</xsl:choose>
         | 
| 7278 | 
            -
            		</xsl:variable>
         | 
| 7332 | 
            +
            		<xsl:variable name="current_fn_number" select="@reference"/>
         | 
| 7333 | 
            +
             | 
| 7279 7334 | 
             
            		<xsl:variable name="current_fn_number_text">
         | 
| 7280 7335 |  | 
| 7281 7336 | 
             
            					<xsl:value-of select="$current_fn_number"/>
         | 
| 7282 7337 |  | 
| 7283 7338 | 
             
            		</xsl:variable>
         | 
| 7284 7339 |  | 
| 7285 | 
            -
            		<xsl:variable name="ref_id" | 
| 7286 | 
            -
             | 
| 7287 | 
            -
            				<xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
         | 
| 7288 | 
            -
            				<xsl:otherwise>
         | 
| 7289 | 
            -
            					<xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
         | 
| 7290 | 
            -
            				</xsl:otherwise>
         | 
| 7291 | 
            -
            			</xsl:choose>
         | 
| 7292 | 
            -
            		</xsl:variable>
         | 
| 7340 | 
            +
            		<xsl:variable name="ref_id" select="@target"/>
         | 
| 7341 | 
            +
             | 
| 7293 7342 | 
             
            		<xsl:variable name="footnote_inline">
         | 
| 7294 7343 | 
             
            			<fo:inline role="Reference">
         | 
| 7295 7344 |  | 
| @@ -7334,7 +7383,9 @@ | |
| 7334 7383 | 
             
            			<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
         | 
| 7335 7384 | 
             
            				<xsl:copy-of select="$footnote_inline"/>
         | 
| 7336 7385 | 
             
            			</xsl:when>
         | 
| 7386 | 
            +
            			<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
         | 
| 7337 7387 | 
             
            			<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
         | 
| 7388 | 
            +
             | 
| 7338 7389 | 
             
            				<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
         | 
| 7339 7390 | 
             
            					<xsl:copy-of select="$footnote_inline"/>
         | 
| 7340 7391 | 
             
            					<fo:footnote-body role="Note">
         | 
| @@ -7351,7 +7402,10 @@ | |
| 7351 7402 | 
             
            									<xsl:value-of select="$current_fn_number_text"/>
         | 
| 7352 7403 |  | 
| 7353 7404 | 
             
            								</fo:inline>
         | 
| 7354 | 
            -
            								<xsl:apply-templates/>
         | 
| 7405 | 
            +
            								<!-- <xsl:apply-templates /> -->
         | 
| 7406 | 
            +
            								<!-- <ref_id><xsl:value-of select="$ref_id"/></ref_id>
         | 
| 7407 | 
            +
            								<here><xsl:copy-of select="$footnotes"/></here> -->
         | 
| 7408 | 
            +
            								<xsl:apply-templates select="$footnotes/*[local-name() = 'fmt-fn-body'][@id = $ref_id]"/>
         | 
| 7355 7409 | 
             
            							</xsl:variable>
         | 
| 7356 7410 |  | 
| 7357 7411 | 
             
            									<fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
         | 
| @@ -7405,77 +7459,136 @@ | |
| 7405 7459 | 
             
            		</xsl:choose>
         | 
| 7406 7460 | 
             
            	</xsl:template>
         | 
| 7407 7461 |  | 
| 7408 | 
            -
            	<xsl:template name="get_fn_list_for_element">
         | 
| 7409 | 
            -
            		<xsl:choose>
         | 
| 7410 | 
            -
            			<xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
         | 
| 7411 | 
            -
            				<fn gen_id="{generate-id(.)}">
         | 
| 7412 | 
            -
            					<xsl:copy-of select="@*"/>
         | 
| 7413 | 
            -
            					<xsl:copy-of select="node()"/>
         | 
| 7414 | 
            -
            				</fn>
         | 
| 7415 | 
            -
            			</xsl:when>
         | 
| 7416 | 
            -
            			<xsl:otherwise>
         | 
| 7417 | 
            -
            				<xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
         | 
| 7418 | 
            -
            					<xsl:variable name="element_id" select="@id"/>
         | 
| 7419 | 
            -
            					<xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
         | 
| 7420 | 
            -
            						<!-- copy unique fn -->
         | 
| 7421 | 
            -
            						<fn gen_id="{generate-id(.)}">
         | 
| 7422 | 
            -
            							<xsl:copy-of select="@*"/>
         | 
| 7423 | 
            -
            							<xsl:copy-of select="node()"/>
         | 
| 7424 | 
            -
            						</fn>
         | 
| 7425 | 
            -
            					</xsl:for-each>
         | 
| 7426 | 
            -
            				</xsl:for-each>
         | 
| 7427 | 
            -
            			</xsl:otherwise>
         | 
| 7428 | 
            -
            		</xsl:choose>
         | 
| 7429 | 
            -
            	</xsl:template>
         | 
| 7430 7462 | 
             
            	<!-- ============================ -->
         | 
| 7431 7463 | 
             
            	<!-- table's footnotes rendering -->
         | 
| 7432 7464 | 
             
            	<!-- ============================ -->
         | 
| 7433 | 
            -
            	<xsl:template name="table_fn_display">
         | 
| 7434 | 
            -
            		<xsl:variable name="references">
         | 
| 7435 7465 |  | 
| 7466 | 
            +
            	<!-- table/fmt-footnote-container -->
         | 
| 7467 | 
            +
            	<xsl:template match="*[local-name() = 'table']/*[local-name() = 'fmt-footnote-container']"/>
         | 
| 7468 | 
            +
             | 
| 7469 | 
            +
            	<xsl:template match="*[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'fmt-footnote-container']">
         | 
| 7470 | 
            +
            		<xsl:for-each select=".">
         | 
| 7471 | 
            +
            			<xsl:call-template name="table_fn_display"/>
         | 
| 7472 | 
            +
            		</xsl:for-each>
         | 
| 7473 | 
            +
            	</xsl:template>
         | 
| 7474 | 
            +
             | 
| 7475 | 
            +
            	<xsl:template name="table_fn_display">
         | 
| 7476 | 
            +
            		<!-- <xsl:variable name="references">
         | 
| 7477 | 
            +
            			<xsl:if test="$namespace = 'bsi'">
         | 
| 7478 | 
            +
            				<xsl:for-each select="..//*[local-name()='fn'][local-name(..) = 'name']">
         | 
| 7479 | 
            +
            					<xsl:call-template name="create_fn" />
         | 
| 7480 | 
            +
            				</xsl:for-each>
         | 
| 7481 | 
            +
            			</xsl:if>
         | 
| 7436 7482 | 
             
            			<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
         | 
| 7437 | 
            -
            				<xsl:call-template name="create_fn"/>
         | 
| 7483 | 
            +
            				<xsl:call-template name="create_fn" />
         | 
| 7438 7484 | 
             
            			</xsl:for-each>
         | 
| 7439 | 
            -
            		</xsl:variable>
         | 
| 7440 | 
            -
             | 
| 7441 | 
            -
            		<xsl:for-each select="xalan:nodeset($references)//fn">
         | 
| 7485 | 
            +
            		</xsl:variable> -->
         | 
| 7486 | 
            +
            		<!-- <xsl:for-each select="xalan:nodeset($references)//fn">
         | 
| 7442 7487 | 
             
            			<xsl:variable name="reference" select="@reference"/>
         | 
| 7443 | 
            -
            			<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
         | 
| 7488 | 
            +
            			<xsl:if test="not(preceding-sibling::*[@reference = $reference])">  --> <!-- only unique reference puts in note-->
         | 
| 7489 | 
            +
            		<xsl:for-each select="..//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
         | 
| 7444 7490 |  | 
| 7445 7491 | 
             
            						<fo:block xsl:use-attribute-sets="table-fn-style">
         | 
| 7492 | 
            +
            							<xsl:copy-of select="@id"/>
         | 
| 7446 7493 | 
             
            							<xsl:call-template name="refine_table-fn-style"/>
         | 
| 7447 | 
            -
            							<fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
         | 
| 7448 | 
            -
            								<xsl:call-template name="refine_table-fn-number-style"/>
         | 
| 7449 | 
            -
             | 
| 7450 | 
            -
            								<xsl:value-of select="@reference"/>
         | 
| 7451 7494 |  | 
| 7452 | 
            -
             | 
| 7453 | 
            -
            								 | 
| 7454 | 
            -
             | 
| 7455 | 
            -
            								</xsl:if> -->
         | 
| 7495 | 
            +
            							<xsl:apply-templates select=".//*[local-name() = 'fmt-fn-label']">
         | 
| 7496 | 
            +
            								<xsl:with-param name="process">true</xsl:with-param>
         | 
| 7497 | 
            +
            							</xsl:apply-templates>
         | 
| 7456 7498 |  | 
| 7457 | 
            -
            							</fo:inline>
         | 
| 7458 7499 | 
             
            							<fo:inline xsl:use-attribute-sets="table-fn-body-style">
         | 
| 7459 | 
            -
            								<xsl:copy-of select="./node()"/>
         | 
| 7500 | 
            +
            								<!-- <xsl:copy-of select="./node()"/> -->
         | 
| 7501 | 
            +
            								<xsl:apply-templates/>
         | 
| 7460 7502 | 
             
            							</fo:inline>
         | 
| 7461 7503 |  | 
| 7462 7504 | 
             
            						</fo:block>
         | 
| 7463 7505 |  | 
| 7464 | 
            -
            			</xsl:if>
         | 
| 7506 | 
            +
            			<!-- </xsl:if> -->
         | 
| 7465 7507 | 
             
            		</xsl:for-each>
         | 
| 7466 7508 | 
             
            	</xsl:template> <!-- table_fn_display -->
         | 
| 7467 7509 |  | 
| 7510 | 
            +
            	<!-- fmt-fn-body/fmt-fn-label in text -->
         | 
| 7511 | 
            +
            	<xsl:template match="*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"/>
         | 
| 7512 | 
            +
             | 
| 7513 | 
            +
            	<!-- table//fmt-fn-body//fmt-fn-label -->
         | 
| 7514 | 
            +
            	<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
         | 
| 7515 | 
            +
            		<xsl:param name="process">false</xsl:param>
         | 
| 7516 | 
            +
            		<xsl:if test="$process = 'true'">
         | 
| 7517 | 
            +
            			<fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
         | 
| 7518 | 
            +
             | 
| 7519 | 
            +
            				<!-- tab is padding-right -->
         | 
| 7520 | 
            +
            				<xsl:apply-templates select=".//*[local-name() = 'tab']">
         | 
| 7521 | 
            +
            					<xsl:with-param name="process">true</xsl:with-param>
         | 
| 7522 | 
            +
            				</xsl:apply-templates>
         | 
| 7523 | 
            +
             | 
| 7524 | 
            +
            				<!-- <xsl:if test="$namespace = 'bipm'">
         | 
| 7525 | 
            +
            					<fo:inline font-style="normal">(</fo:inline>
         | 
| 7526 | 
            +
            				</xsl:if> -->
         | 
| 7527 | 
            +
             | 
| 7528 | 
            +
            				<!-- <xsl:if test="$namespace = 'plateau'">
         | 
| 7529 | 
            +
            					<xsl:text>※</xsl:text>
         | 
| 7530 | 
            +
            				</xsl:if> -->
         | 
| 7531 | 
            +
             | 
| 7532 | 
            +
            				<!-- <xsl:value-of select="@reference"/> -->
         | 
| 7533 | 
            +
            				<!-- <xsl:value-of select="normalize-space()"/> -->
         | 
| 7534 | 
            +
            				<xsl:apply-templates/>
         | 
| 7535 | 
            +
             | 
| 7536 | 
            +
            				<!-- <xsl:if test="$namespace = 'bipm'">
         | 
| 7537 | 
            +
            					<fo:inline font-style="normal">)</fo:inline>
         | 
| 7538 | 
            +
            				</xsl:if> -->
         | 
| 7539 | 
            +
             | 
| 7540 | 
            +
            				<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
         | 
| 7541 | 
            +
            				<!-- <xsl:if test="$namespace = 'itu'">
         | 
| 7542 | 
            +
            					<xsl:text>)</xsl:text>
         | 
| 7543 | 
            +
            				</xsl:if> -->
         | 
| 7544 | 
            +
             | 
| 7545 | 
            +
            				<!-- <xsl:if test="$namespace = 'plateau'">
         | 
| 7546 | 
            +
            					<xsl:text>:</xsl:text>
         | 
| 7547 | 
            +
            				</xsl:if> -->
         | 
| 7548 | 
            +
             | 
| 7549 | 
            +
            			</fo:inline>
         | 
| 7550 | 
            +
            		</xsl:if>
         | 
| 7551 | 
            +
            	</xsl:template> <!--  fmt-fn-body//fmt-fn-label -->
         | 
| 7552 | 
            +
             | 
| 7553 | 
            +
            	<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
         | 
| 7554 | 
            +
            		<xsl:param name="process">false</xsl:param>
         | 
| 7555 | 
            +
            		<xsl:if test="$process = 'true'">
         | 
| 7556 | 
            +
            			<xsl:attribute name="padding-right">5mm</xsl:attribute>
         | 
| 7557 | 
            +
             | 
| 7558 | 
            +
            		</xsl:if>
         | 
| 7559 | 
            +
            	</xsl:template>
         | 
| 7560 | 
            +
             | 
| 7561 | 
            +
            	<xsl:template match="*[local-name() = 'table']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
         | 
| 7562 | 
            +
            		<fo:inline xsl:use-attribute-sets="table-fmt-fn-label-style" role="SKIP">
         | 
| 7563 | 
            +
            			<xsl:call-template name="refine_table-fmt-fn-label-style"/>
         | 
| 7564 | 
            +
            			<xsl:apply-templates/>
         | 
| 7565 | 
            +
            		</fo:inline>
         | 
| 7566 | 
            +
            	</xsl:template>
         | 
| 7567 | 
            +
             | 
| 7568 | 
            +
            	<!-- <xsl:template match="*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']"/> -->
         | 
| 7569 | 
            +
            	<!-- 
         | 
| 7468 7570 | 
             
            	<xsl:template name="create_fn">
         | 
| 7469 7571 | 
             
            		<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
         | 
| 7470 | 
            -
            			<xsl:if test="ancestor::*[local-name()='table'][1]/@id">  | 
| 7572 | 
            +
            			<xsl:if test="ancestor::*[local-name()='table'][1]/@id">  - for footnotes in tables -
         | 
| 7471 7573 | 
             
            				<xsl:attribute name="id">
         | 
| 7472 7574 | 
             
            					<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
         | 
| 7473 7575 | 
             
            				</xsl:attribute>
         | 
| 7474 7576 | 
             
            			</xsl:if>
         | 
| 7475 | 
            -
             | 
| 7476 | 
            -
             | 
| 7577 | 
            +
            			<xsl:if test="$namespace = 'itu'">
         | 
| 7578 | 
            +
            				<xsl:if test="ancestor::*[local-name()='preface']">
         | 
| 7579 | 
            +
            					<xsl:attribute name="preface">true</xsl:attribute>
         | 
| 7580 | 
            +
            				</xsl:if>
         | 
| 7581 | 
            +
            			</xsl:if>
         | 
| 7582 | 
            +
            			<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
         | 
| 7583 | 
            +
            				<xsl:attribute name="id">
         | 
| 7584 | 
            +
            					<xsl:value-of select="@reference"/>
         | 
| 7585 | 
            +
            					<xsl:text>_</xsl:text>
         | 
| 7586 | 
            +
            					<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
         | 
| 7587 | 
            +
            				</xsl:attribute>
         | 
| 7588 | 
            +
            			</xsl:if>
         | 
| 7589 | 
            +
            			<xsl:apply-templates />
         | 
| 7477 7590 | 
             
            		</fn>
         | 
| 7478 | 
            -
            	</xsl:template>
         | 
| 7591 | 
            +
            	</xsl:template> -->
         | 
| 7479 7592 |  | 
| 7480 7593 | 
             
            	<!-- footnotes for table's name rendering -->
         | 
| 7481 7594 | 
             
            	<xsl:template name="table_name_fn_display">
         | 
| @@ -7494,123 +7607,171 @@ | |
| 7494 7607 | 
             
            	<!-- ============================ -->
         | 
| 7495 7608 | 
             
            	<!-- figure's footnotes rendering -->
         | 
| 7496 7609 | 
             
            	<!-- ============================ -->
         | 
| 7497 | 
            -
            	<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
         | 
| 7498 7610 |  | 
| 7499 | 
            -
             | 
| 7500 | 
            -
             | 
| 7501 | 
            -
             | 
| 7502 | 
            -
             | 
| 7503 | 
            -
             | 
| 7504 | 
            -
            		<xsl:variable name="figure_id" select="normalize-space($figure_id_)"/>
         | 
| 7611 | 
            +
            	<!-- figure/fmt-footnote-container -->
         | 
| 7612 | 
            +
            	<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-footnote-container']"/>
         | 
| 7613 | 
            +
             | 
| 7614 | 
            +
            	<!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
         | 
| 7615 | 
            +
            	<xsl:template name="figure_fn_display">
         | 
| 7505 7616 |  | 
| 7506 | 
            -
            		<!-- all footnotes relates to the current figure -->
         | 
| 7507 7617 | 
             
            		<xsl:variable name="references">
         | 
| 7508 | 
            -
            			<xsl:for-each select=" | 
| 7509 | 
            -
            				< | 
| 7510 | 
            -
             | 
| 7511 | 
            -
            				 | 
| 7618 | 
            +
            			<xsl:for-each select="./*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body']">
         | 
| 7619 | 
            +
            				<xsl:variable name="curr_id" select="@id"/>
         | 
| 7620 | 
            +
            				<!-- <curr_id><xsl:value-of select="$curr_id"/></curr_id>
         | 
| 7621 | 
            +
            				<curr><xsl:copy-of select="."/></curr>
         | 
| 7622 | 
            +
            				<ancestor><xsl:copy-of select="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn']]]"/></ancestor> -->
         | 
| 7623 | 
            +
            				<xsl:choose>
         | 
| 7624 | 
            +
            					<!-- skip figure/name/fn -->
         | 
| 7625 | 
            +
            					<xsl:when test="ancestor::*[local-name() = 'figure'][.//*[local-name() = 'name'][.//*[local-name() = 'fn'][@target = $curr_id]]]"><!-- skip --></xsl:when>
         | 
| 7626 | 
            +
            					<xsl:otherwise>
         | 
| 7627 | 
            +
            						<xsl:element name="figure" namespace="{$namespace_full}">
         | 
| 7628 | 
            +
            							<xsl:element name="fmt-footnote-container" namespace="{$namespace_full}">
         | 
| 7629 | 
            +
            								<xsl:copy-of select="."/>
         | 
| 7630 | 
            +
            							</xsl:element>
         | 
| 7631 | 
            +
            						</xsl:element>
         | 
| 7632 | 
            +
            					</xsl:otherwise>
         | 
| 7633 | 
            +
            				</xsl:choose>
         | 
| 7512 7634 | 
             
            			</xsl:for-each>
         | 
| 7513 7635 | 
             
            		</xsl:variable>
         | 
| 7636 | 
            +
            		<!-- <references><xsl:copy-of select="$references"/></references> -->
         | 
| 7514 7637 |  | 
| 7515 | 
            -
            		<xsl:if test="xalan:nodeset($references) | 
| 7638 | 
            +
            		<xsl:if test="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
         | 
| 7516 7639 |  | 
| 7517 7640 | 
             
            			<xsl:variable name="key_iso">
         | 
| 7518 7641 |  | 
| 7519 7642 | 
             
            			</xsl:variable>
         | 
| 7520 7643 |  | 
| 7521 7644 | 
             
            			<fo:block>
         | 
| 7645 | 
            +
            				<!-- current hierarchy is 'figure' element -->
         | 
| 7646 | 
            +
            				<xsl:variable name="following_dl_colwidths">
         | 
| 7647 | 
            +
            					<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
         | 
| 7648 | 
            +
            						<xsl:variable name="simple-table">
         | 
| 7649 | 
            +
            							<!-- <xsl:variable name="doc_ns">
         | 
| 7650 | 
            +
            								<xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
         | 
| 7651 | 
            +
            							</xsl:variable>
         | 
| 7652 | 
            +
            							<xsl:variable name="ns">
         | 
| 7653 | 
            +
            								<xsl:choose>
         | 
| 7654 | 
            +
            									<xsl:when test="normalize-space($doc_ns)  != ''">
         | 
| 7655 | 
            +
            										<xsl:value-of select="normalize-space($doc_ns)"/>
         | 
| 7656 | 
            +
            									</xsl:when>
         | 
| 7657 | 
            +
            									<xsl:otherwise>
         | 
| 7658 | 
            +
            										<xsl:value-of select="substring-before(name(/*), '-')"/>
         | 
| 7659 | 
            +
            									</xsl:otherwise>
         | 
| 7660 | 
            +
            								</xsl:choose>
         | 
| 7661 | 
            +
            							</xsl:variable> -->
         | 
| 7522 7662 |  | 
| 7523 | 
            -
             | 
| 7524 | 
            -
             | 
| 7525 | 
            -
             | 
| 7526 | 
            -
            								 | 
| 7527 | 
            -
             | 
| 7528 | 
            -
             | 
| 7529 | 
            -
            									</xsl:variable>
         | 
| 7530 | 
            -
            									<xsl:variable name="ns">
         | 
| 7531 | 
            -
            										<xsl:choose>
         | 
| 7532 | 
            -
            											<xsl:when test="normalize-space($doc_ns)  != ''">
         | 
| 7533 | 
            -
            												<xsl:value-of select="normalize-space($doc_ns)"/>
         | 
| 7534 | 
            -
            											</xsl:when>
         | 
| 7535 | 
            -
            											<xsl:otherwise>
         | 
| 7536 | 
            -
            												<xsl:value-of select="substring-before(name(/*), '-')"/>
         | 
| 7537 | 
            -
            											</xsl:otherwise>
         | 
| 7538 | 
            -
            										</xsl:choose>
         | 
| 7539 | 
            -
            									</xsl:variable> -->
         | 
| 7663 | 
            +
            							<xsl:for-each select="*[local-name() = 'dl'][1]">
         | 
| 7664 | 
            +
            								<tbody>
         | 
| 7665 | 
            +
            									<xsl:apply-templates mode="dl"/>
         | 
| 7666 | 
            +
            								</tbody>
         | 
| 7667 | 
            +
            							</xsl:for-each>
         | 
| 7668 | 
            +
            						</xsl:variable>
         | 
| 7540 7669 |  | 
| 7541 | 
            -
             | 
| 7542 | 
            -
             | 
| 7543 | 
            -
             | 
| 7544 | 
            -
             | 
| 7545 | 
            -
            									</xsl:for-each>
         | 
| 7546 | 
            -
            								</xsl:variable>
         | 
| 7670 | 
            +
            						<xsl:call-template name="calculate-column-widths">
         | 
| 7671 | 
            +
            							<xsl:with-param name="cols-count" select="2"/>
         | 
| 7672 | 
            +
            							<xsl:with-param name="table" select="$simple-table"/>
         | 
| 7673 | 
            +
            						</xsl:call-template>
         | 
| 7547 7674 |  | 
| 7548 | 
            -
             | 
| 7549 | 
            -
             | 
| 7550 | 
            -
            									<xsl:with-param name="table" select="$simple-table"/>
         | 
| 7551 | 
            -
            								</xsl:call-template>
         | 
| 7675 | 
            +
            					</xsl:if>
         | 
| 7676 | 
            +
            				</xsl:variable>
         | 
| 7552 7677 |  | 
| 7553 | 
            -
             | 
| 7554 | 
            -
             | 
| 7678 | 
            +
            				<xsl:variable name="maxlength_dt">
         | 
| 7679 | 
            +
            					<xsl:for-each select="*[local-name() = 'dl'][1]">
         | 
| 7680 | 
            +
            						<xsl:call-template name="getMaxLength_dt"/>
         | 
| 7681 | 
            +
            					</xsl:for-each>
         | 
| 7682 | 
            +
            				</xsl:variable>
         | 
| 7555 7683 |  | 
| 7556 | 
            -
             | 
| 7557 | 
            -
             | 
| 7558 | 
            -
             | 
| 7559 | 
            -
             | 
| 7560 | 
            -
             | 
| 7684 | 
            +
            				<fo:table width="95%" table-layout="fixed">
         | 
| 7685 | 
            +
            					<xsl:if test="normalize-space($key_iso) = 'true'">
         | 
| 7686 | 
            +
            						<xsl:attribute name="font-size">10pt</xsl:attribute>
         | 
| 7687 | 
            +
             | 
| 7688 | 
            +
            					</xsl:if>
         | 
| 7689 | 
            +
            					<xsl:choose>
         | 
| 7690 | 
            +
            						<!-- if there 'dl', then set same columns width -->
         | 
| 7691 | 
            +
            						<xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
         | 
| 7692 | 
            +
            							<xsl:call-template name="setColumnWidth_dl">
         | 
| 7693 | 
            +
            								<xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
         | 
| 7694 | 
            +
            								<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
         | 
| 7695 | 
            +
            							</xsl:call-template>
         | 
| 7696 | 
            +
            						</xsl:when>
         | 
| 7697 | 
            +
            						<xsl:otherwise>
         | 
| 7698 | 
            +
            							<fo:table-column column-width="5%"/>
         | 
| 7699 | 
            +
            							<fo:table-column column-width="95%"/>
         | 
| 7700 | 
            +
            						</xsl:otherwise>
         | 
| 7701 | 
            +
            					</xsl:choose>
         | 
| 7702 | 
            +
            					<fo:table-body>
         | 
| 7703 | 
            +
            						<!-- <xsl:for-each select="xalan:nodeset($references)//fn"> -->
         | 
| 7704 | 
            +
            						<xsl:for-each select="xalan:nodeset($references)//*[local-name() = 'fmt-fn-body']">
         | 
| 7561 7705 |  | 
| 7562 | 
            -
             | 
| 7563 | 
            -
            							<xsl:if test=" | 
| 7564 | 
            -
            								< | 
| 7706 | 
            +
            							<xsl:variable name="reference" select="@reference"/>
         | 
| 7707 | 
            +
            							<!-- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> --> <!-- only unique reference puts in note-->
         | 
| 7708 | 
            +
            								<fo:table-row>
         | 
| 7709 | 
            +
            									<fo:table-cell>
         | 
| 7710 | 
            +
            										<fo:block>
         | 
| 7565 7711 |  | 
| 7566 | 
            -
             | 
| 7567 | 
            -
             | 
| 7568 | 
            -
             | 
| 7569 | 
            -
             | 
| 7570 | 
            -
            									<xsl:call-template name="setColumnWidth_dl">
         | 
| 7571 | 
            -
            										<xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
         | 
| 7572 | 
            -
            										<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
         | 
| 7573 | 
            -
            									</xsl:call-template>
         | 
| 7574 | 
            -
            								</xsl:when>
         | 
| 7575 | 
            -
            								<xsl:otherwise>
         | 
| 7576 | 
            -
            									<fo:table-column column-width="5%"/>
         | 
| 7577 | 
            -
            									<fo:table-column column-width="95%"/>
         | 
| 7578 | 
            -
            								</xsl:otherwise>
         | 
| 7579 | 
            -
            							</xsl:choose>
         | 
| 7580 | 
            -
            							<fo:table-body>
         | 
| 7581 | 
            -
            								<xsl:for-each select="xalan:nodeset($references)//fn">
         | 
| 7582 | 
            -
            									<xsl:variable name="reference" select="@reference"/>
         | 
| 7583 | 
            -
            									<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
         | 
| 7584 | 
            -
            										<fo:table-row>
         | 
| 7585 | 
            -
            											<fo:table-cell>
         | 
| 7586 | 
            -
            												<fo:block>
         | 
| 7587 | 
            -
            													<fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style">
         | 
| 7588 | 
            -
            														<xsl:value-of select="@reference"/>
         | 
| 7712 | 
            +
            													<fo:inline id="{@id}" xsl:use-attribute-sets="figure-fmt-fn-label-style">
         | 
| 7713 | 
            +
            														<!-- <xsl:attribute name="padding-right">0mm</xsl:attribute> -->
         | 
| 7714 | 
            +
            														<!-- <xsl:value-of select="@reference"/> -->
         | 
| 7715 | 
            +
            														<xsl:value-of select="normalize-space(.//*[local-name() = 'fmt-fn-label'])"/>
         | 
| 7589 7716 | 
             
            													</fo:inline>
         | 
| 7590 | 
            -
            												</fo:block>
         | 
| 7591 | 
            -
            											</fo:table-cell>
         | 
| 7592 | 
            -
            											<fo:table-cell>
         | 
| 7593 | 
            -
            												<fo:block xsl:use-attribute-sets="figure-fn-body-style">
         | 
| 7594 | 
            -
            													<xsl:if test="normalize-space($key_iso) = 'true'">
         | 
| 7595 7717 |  | 
| 7596 | 
            -
             | 
| 7718 | 
            +
            										</fo:block>
         | 
| 7719 | 
            +
            									</fo:table-cell>
         | 
| 7720 | 
            +
            									<fo:table-cell>
         | 
| 7721 | 
            +
            										<fo:block xsl:use-attribute-sets="figure-fn-body-style">
         | 
| 7722 | 
            +
            											<xsl:if test="normalize-space($key_iso) = 'true'">
         | 
| 7723 | 
            +
             | 
| 7724 | 
            +
            														<xsl:attribute name="margin-bottom">0</xsl:attribute>
         | 
| 7597 7725 |  | 
| 7598 | 
            -
             | 
| 7599 | 
            -
            													<xsl:copy-of select="./node()"/>
         | 
| 7600 | 
            -
            												</fo:block>
         | 
| 7601 | 
            -
            											</fo:table-cell>
         | 
| 7602 | 
            -
            										</fo:table-row>
         | 
| 7603 | 
            -
            									</xsl:if>
         | 
| 7604 | 
            -
            								</xsl:for-each>
         | 
| 7605 | 
            -
            							</fo:table-body>
         | 
| 7606 | 
            -
            						</fo:table>
         | 
| 7726 | 
            +
            											</xsl:if>
         | 
| 7607 7727 |  | 
| 7728 | 
            +
            											<!-- <xsl:copy-of select="./node()"/> -->
         | 
| 7729 | 
            +
            											<xsl:apply-templates/>
         | 
| 7730 | 
            +
            										</fo:block>
         | 
| 7731 | 
            +
            									</fo:table-cell>
         | 
| 7732 | 
            +
            								</fo:table-row>
         | 
| 7733 | 
            +
            							<!-- </xsl:if> -->
         | 
| 7734 | 
            +
            						</xsl:for-each>
         | 
| 7735 | 
            +
            					</fo:table-body>
         | 
| 7736 | 
            +
            				</fo:table>
         | 
| 7608 7737 | 
             
            			</fo:block>
         | 
| 7609 7738 | 
             
            		</xsl:if>
         | 
| 7610 | 
            -
            	</xsl:template> <!--  | 
| 7739 | 
            +
            	</xsl:template> <!-- figure_fn_display -->
         | 
| 7740 | 
            +
             | 
| 7741 | 
            +
            	<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']"> <!-- *[local-name() = 'fmt-footnote-container']/ -->
         | 
| 7742 | 
            +
            		<xsl:param name="process">false</xsl:param>
         | 
| 7743 | 
            +
            		<xsl:if test="$process = 'true'">
         | 
| 7744 | 
            +
            			<fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
         | 
| 7745 | 
            +
            				<xsl:attribute name="padding-right">0mm</xsl:attribute>
         | 
| 7746 | 
            +
             | 
| 7747 | 
            +
            				<!-- tab is padding-right -->
         | 
| 7748 | 
            +
            				<xsl:apply-templates select=".//*[local-name() = 'tab']">
         | 
| 7749 | 
            +
            					<xsl:with-param name="process">true</xsl:with-param>
         | 
| 7750 | 
            +
            				</xsl:apply-templates>
         | 
| 7751 | 
            +
             | 
| 7752 | 
            +
            				<xsl:apply-templates/>
         | 
| 7753 | 
            +
             | 
| 7754 | 
            +
            			</fo:inline>
         | 
| 7755 | 
            +
            		</xsl:if>
         | 
| 7756 | 
            +
            	</xsl:template> <!--  figure//fmt-fn-body//fmt-fn-label -->
         | 
| 7757 | 
            +
             | 
| 7758 | 
            +
            	<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'tab']" priority="5">
         | 
| 7759 | 
            +
            		<xsl:param name="process">false</xsl:param>
         | 
| 7760 | 
            +
            		<xsl:if test="$process = 'true'">
         | 
| 7761 | 
            +
             | 
| 7762 | 
            +
            		</xsl:if>
         | 
| 7763 | 
            +
            	</xsl:template>
         | 
| 7764 | 
            +
             | 
| 7765 | 
            +
            	<xsl:template match="*[local-name() = 'figure']//*[local-name() = 'fmt-fn-body']//*[local-name() = 'fmt-fn-label']//*[local-name() = 'sup']" priority="5">
         | 
| 7766 | 
            +
            		<fo:inline xsl:use-attribute-sets="figure-fmt-fn-label-style" role="SKIP">
         | 
| 7767 | 
            +
            			<xsl:call-template name="refine_figure-fmt-fn-label-style"/>
         | 
| 7768 | 
            +
            			<xsl:apply-templates/>
         | 
| 7769 | 
            +
            		</fo:inline>
         | 
| 7770 | 
            +
            	</xsl:template>
         | 
| 7611 7771 |  | 
| 7612 7772 | 
             
            	<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
         | 
| 7613 7773 | 
             
            	<!-- figure's footnote label -->
         | 
| 7774 | 
            +
            	<!-- figure/dl[@key = 'true']/dt/p/sup -->
         | 
| 7614 7775 | 
             
            	<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">
         | 
| 7615 7776 | 
             
            		<xsl:variable name="key_iso">
         | 
| 7616 7777 |  | 
| @@ -7619,7 +7780,7 @@ | |
| 7619 7780 | 
             
            			<xsl:attribute name="font-size">10pt</xsl:attribute>
         | 
| 7620 7781 |  | 
| 7621 7782 | 
             
            		</xsl:if>
         | 
| 7622 | 
            -
            		<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}"  -->
         | 
| 7783 | 
            +
            		<fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}"  -->
         | 
| 7623 7784 | 
             
            			<!-- <xsl:value-of select="@reference"/> -->
         | 
| 7624 7785 | 
             
            			<xsl:apply-templates/>
         | 
| 7625 7786 | 
             
            		</fo:inline>
         | 
| @@ -7629,38 +7790,65 @@ | |
| 7629 7790 | 
             
            	<!-- END: figure's footnotes rendering -->
         | 
| 7630 7791 | 
             
            	<!-- ============================ -->
         | 
| 7631 7792 |  | 
| 7632 | 
            -
            	<!-- fn reference in the  | 
| 7793 | 
            +
            	<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
         | 
| 7794 | 
            +
            	<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
         | 
| 7633 7795 | 
             
            	<xsl:template match="*[local-name()='fn']">
         | 
| 7634 7796 | 
             
            		<fo:inline xsl:use-attribute-sets="fn-reference-style">
         | 
| 7635 7797 |  | 
| 7636 7798 | 
             
            			<xsl:call-template name="refine_fn-reference-style"/>
         | 
| 7637 7799 |  | 
| 7638 | 
            -
            			<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference   | ancestor::*[local-name()='clause'][1]/@id-->
         | 
| 7639 | 
            -
             | 
| 7640 | 
            -
             | 
| 7800 | 
            +
            			<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference   | ancestor::*[local-name()='clause'][1]/@id-->
         | 
| 7801 | 
            +
            			<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
         | 
| 7802 | 
            +
            				<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
         | 
| 7803 | 
            +
            				<!-- 	<xsl:attribute name="internal-destination">
         | 
| 7641 7804 | 
             
            						<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
         | 
| 7642 7805 | 
             
            					</xsl:attribute>
         | 
| 7643 7806 | 
             
            				</xsl:if>
         | 
| 7807 | 
            +
            				<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
         | 
| 7808 | 
            +
            					<xsl:attribute name="internal-destination">
         | 
| 7809 | 
            +
            						<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
         | 
| 7810 | 
            +
            						<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
         | 
| 7811 | 
            +
            					</xsl:attribute>
         | 
| 7812 | 
            +
            				</xsl:if> -->
         | 
| 7813 | 
            +
            				<!-- <xsl:if test="$namespace = 'plateau'">
         | 
| 7814 | 
            +
            					<xsl:text>※</xsl:text>
         | 
| 7815 | 
            +
            				</xsl:if> -->
         | 
| 7816 | 
            +
            				<!-- <xsl:value-of select="@reference"/> -->
         | 
| 7644 7817 |  | 
| 7645 | 
            -
             | 
| 7818 | 
            +
            						<xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
         | 
| 7646 7819 |  | 
| 7820 | 
            +
            				<!-- <xsl:if test="$namespace = 'bsi'">
         | 
| 7821 | 
            +
            					<xsl:text>)</xsl:text>
         | 
| 7822 | 
            +
            				</xsl:if> -->
         | 
| 7647 7823 | 
             
            				<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
         | 
| 7648 7824 | 
             
            				<!-- <xsl:if test="$namespace = 'jis'">
         | 
| 7649 7825 | 
             
            					<fo:inline font-weight="normal">)</fo:inline>
         | 
| 7650 7826 | 
             
            				</xsl:if> -->
         | 
| 7651 7827 | 
             
            			</fo:basic-link>
         | 
| 7652 7828 | 
             
            		</fo:inline>
         | 
| 7653 | 
            -
            	</xsl:template>
         | 
| 7829 | 
            +
            	</xsl:template> <!-- fn -->
         | 
| 7654 7830 |  | 
| 7831 | 
            +
            	<!-- fn/text() -->
         | 
| 7655 7832 | 
             
            	<xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
         | 
| 7656 7833 | 
             
            		<fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
         | 
| 7657 7834 | 
             
            	</xsl:template>
         | 
| 7658 7835 |  | 
| 7659 | 
            -
            	 | 
| 7836 | 
            +
            	<!-- fn//p fmt-fn-body//p -->
         | 
| 7837 | 
            +
            	<xsl:template match="*[local-name()='fn']//*[local-name()='p'] | *[local-name() = 'fmt-fn-body']//*[local-name()='p']">
         | 
| 7660 7838 | 
             
            		<fo:inline role="P">
         | 
| 7661 7839 | 
             
            			<xsl:apply-templates/>
         | 
| 7662 7840 | 
             
            		</fo:inline>
         | 
| 7663 7841 | 
             
            	</xsl:template>
         | 
| 7842 | 
            +
             | 
| 7843 | 
            +
            	<xsl:template name="insertFootnoteSeparatorCommon">
         | 
| 7844 | 
            +
            		<xsl:param name="leader_length">30%</xsl:param>
         | 
| 7845 | 
            +
            		<fo:static-content flow-name="xsl-footnote-separator">
         | 
| 7846 | 
            +
            			<fo:block>
         | 
| 7847 | 
            +
            				<fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
         | 
| 7848 | 
            +
            			</fo:block>
         | 
| 7849 | 
            +
            		</fo:static-content>
         | 
| 7850 | 
            +
            	</xsl:template>
         | 
| 7851 | 
            +
             | 
| 7664 7852 | 
             
            	<!-- ===================== -->
         | 
| 7665 7853 | 
             
            	<!-- END Footnotes processing  -->
         | 
| 7666 7854 | 
             
            	<!-- ===================== -->
         | 
| @@ -7937,11 +8125,11 @@ | |
| 7937 8125 | 
             
            										<xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
         | 
| 7938 8126 | 
             
            										<!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
         | 
| 7939 8127 |  | 
| 7940 | 
            -
             | 
| 7941 | 
            -
             | 
| 7942 | 
            -
             | 
| 7943 | 
            -
             | 
| 7944 | 
            -
             | 
| 8128 | 
            +
            												<xsl:call-template name="setColumnWidth_dl">
         | 
| 8129 | 
            +
            													<xsl:with-param name="colwidths" select="$colwidths"/>
         | 
| 8130 | 
            +
            													<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
         | 
| 8131 | 
            +
            													<xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
         | 
| 8132 | 
            +
            												</xsl:call-template>
         | 
| 7945 8133 |  | 
| 7946 8134 | 
             
            										<fo:table-body>
         | 
| 7947 8135 |  | 
| @@ -7975,6 +8163,14 @@ | |
| 7975 8163 |  | 
| 7976 8164 | 
             
            	</xsl:template> <!-- END: dl -->
         | 
| 7977 8165 |  | 
| 8166 | 
            +
            	<xsl:template match="@*|node()" mode="dt_clean">
         | 
| 8167 | 
            +
            		<xsl:copy>
         | 
| 8168 | 
            +
            			<xsl:apply-templates select="@*|node()" mode="dt_clean"/>
         | 
| 8169 | 
            +
            		</xsl:copy>
         | 
| 8170 | 
            +
            	</xsl:template>
         | 
| 8171 | 
            +
             | 
| 8172 | 
            +
            	<xsl:template match="*[local-name() = 'asciimath']" mode="dt_clean"/>
         | 
| 8173 | 
            +
             | 
| 7978 8174 | 
             
            	<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
         | 
| 7979 8175 | 
             
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
         | 
| 7980 8176 | 
             
            		<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
         | 
| @@ -8004,10 +8200,12 @@ | |
| 8004 8200 | 
             
            	<!-- ignore 'p' with 'where' in formula, before 'dl' -->
         | 
| 8005 8201 | 
             
            	<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
         | 
| 8006 8202 |  | 
| 8203 | 
            +
            	<!-- dl/name -->
         | 
| 8007 8204 | 
             
            	<xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
         | 
| 8008 8205 | 
             
            		<xsl:param name="process">false</xsl:param>
         | 
| 8009 8206 | 
             
            		<xsl:if test="$process = 'true'">
         | 
| 8010 8207 | 
             
            			<fo:block xsl:use-attribute-sets="dl-name-style">
         | 
| 8208 | 
            +
             | 
| 8011 8209 | 
             
            				<xsl:apply-templates/>
         | 
| 8012 8210 | 
             
            			</fo:block>
         | 
| 8013 8211 | 
             
            		</xsl:if>
         | 
| @@ -8021,6 +8219,10 @@ | |
| 8021 8219 | 
             
            		<!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
         | 
| 8022 8220 |  | 
| 8023 8221 | 
             
            		<xsl:choose>
         | 
| 8222 | 
            +
            			<!-- <xsl:when test="@class = 'formula_dl' and local-name(..) = 'figure'">
         | 
| 8223 | 
            +
            				<fo:table-column column-width="10%"/>
         | 
| 8224 | 
            +
            				<fo:table-column column-width="90%"/>
         | 
| 8225 | 
            +
            			</xsl:when> -->
         | 
| 8024 8226 | 
             
            			<xsl:when test="xalan:nodeset($colwidths)/autolayout">
         | 
| 8025 8227 | 
             
            				<xsl:call-template name="insertTableColumnWidth">
         | 
| 8026 8228 | 
             
            					<xsl:with-param name="colwidths" select="$colwidths"/>
         | 
| @@ -8814,7 +9016,7 @@ | |
| 8814 9016 | 
             
            		<xsl:choose>
         | 
| 8815 9017 | 
             
            			<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
         | 
| 8816 9018 | 
             
            			<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
         | 
| 8817 | 
            -
            				<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
         | 
| 9019 | 
            +
            				<fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
         | 
| 8818 9020 | 
             
            			</xsl:when>
         | 
| 8819 9021 | 
             
            			<xsl:otherwise>
         | 
| 8820 9022 | 
             
            				<xsl:apply-templates/>
         | 
| @@ -8822,7 +9024,7 @@ | |
| 8822 9024 | 
             
            		</xsl:choose>
         | 
| 8823 9025 | 
             
            	</xsl:template>
         | 
| 8824 9026 | 
             
            	<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">
         | 
| 8825 | 
            -
            		<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
         | 
| 9027 | 
            +
            		<fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:value-of select="."/></fo:inline>
         | 
| 8826 9028 | 
             
            	</xsl:template>
         | 
| 8827 9029 |  | 
| 8828 9030 | 
             
            	<xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
         | 
| @@ -9864,24 +10066,26 @@ | |
| 9864 10066 | 
             
            			<xsl:apply-templates select="." mode="mathml"/>
         | 
| 9865 10067 | 
             
            		</xsl:variable>
         | 
| 9866 10068 |  | 
| 9867 | 
            -
            		<fo:instream-foreign-object fox:alt-text="Math">
         | 
| 10069 | 
            +
            		<fo:instream-foreign-object fox:alt-text="Math" fox:actual-text="Math">
         | 
| 9868 10070 |  | 
| 9869 10071 | 
             
            			<xsl:call-template name="refine_mathml_insteam_object_style"/>
         | 
| 9870 10072 |  | 
| 9871 | 
            -
            			 | 
| 9872 | 
            -
             | 
| 9873 | 
            -
             | 
| 9874 | 
            -
            				<xsl: | 
| 9875 | 
            -
             | 
| 9876 | 
            -
             | 
| 9877 | 
            -
            			<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
         | 
| 9878 | 
            -
            			<xsl:if test="normalize-space($asciimath_text_) != ''">
         | 
| 9879 | 
            -
            			<!-- put Mathin Alternate Text -->
         | 
| 9880 | 
            -
            				<xsl:attribute name="fox:alt-text">
         | 
| 9881 | 
            -
            					<xsl:value-of select="$asciimath_text_"/>
         | 
| 10073 | 
            +
            			<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 10074 | 
            +
            				<!-- put MathML in Actual Text -->
         | 
| 10075 | 
            +
            				<!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
         | 
| 10076 | 
            +
            				<xsl:attribute name="fox:actual-text">
         | 
| 10077 | 
            +
            					<xsl:value-of select="$mathml_content"/>
         | 
| 9882 10078 | 
             
            				</xsl:attribute>
         | 
| 10079 | 
            +
             | 
| 10080 | 
            +
            				<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
         | 
| 10081 | 
            +
            				<xsl:if test="normalize-space($asciimath_text_) != ''">
         | 
| 10082 | 
            +
            				<!-- put Mathin Alternate Text -->
         | 
| 10083 | 
            +
            					<xsl:attribute name="fox:alt-text">
         | 
| 10084 | 
            +
            						<xsl:value-of select="$asciimath_text_"/>
         | 
| 10085 | 
            +
            					</xsl:attribute>
         | 
| 10086 | 
            +
            				</xsl:if>
         | 
| 10087 | 
            +
            				<!-- </xsl:if> -->
         | 
| 9883 10088 | 
             
            			</xsl:if>
         | 
| 9884 | 
            -
            			<!-- </xsl:if> -->
         | 
| 9885 10089 |  | 
| 9886 10090 | 
             
            			<xsl:copy-of select="xalan:nodeset($mathml)"/>
         | 
| 9887 10091 |  | 
| @@ -10144,6 +10348,27 @@ | |
| 10144 10348 | 
             
            					<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
         | 
| 10145 10349 | 
             
            					<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
         | 
| 10146 10350 | 
             
            				</xsl:when> -->
         | 
| 10351 | 
            +
             | 
| 10352 | 
            +
            				<!-- <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'))">
         | 
| 10353 | 
            +
            					<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
         | 
| 10354 | 
            +
            					<xsl:variable name="filename">
         | 
| 10355 | 
            +
            						<xsl:call-template name="substring-after-last">
         | 
| 10356 | 
            +
            							<xsl:with-param name="value" select="$target_"/>
         | 
| 10357 | 
            +
            							<xsl:with-param name="delimiter" select="'/'"/>
         | 
| 10358 | 
            +
            						</xsl:call-template>
         | 
| 10359 | 
            +
            					</xsl:variable>
         | 
| 10360 | 
            +
            					<xsl:variable name="target_filepath" select="concat($inputxml_basepath, @target)"/>
         | 
| 10361 | 
            +
            					<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($target_filepath)))"/>
         | 
| 10362 | 
            +
            					<xsl:choose>
         | 
| 10363 | 
            +
            						<xsl:when test="$file_exists = 'true'">
         | 
| 10364 | 
            +
            							<xsl:value-of select="concat('url(embedded-file:', $filename, ')')"/>
         | 
| 10365 | 
            +
            						</xsl:when>
         | 
| 10366 | 
            +
            						<xsl:otherwise>
         | 
| 10367 | 
            +
            							<xsl:value-of select="normalize-space(@target)"/>
         | 
| 10368 | 
            +
            						</xsl:otherwise>
         | 
| 10369 | 
            +
            					</xsl:choose>
         | 
| 10370 | 
            +
            				</xsl:when> -->
         | 
| 10371 | 
            +
             | 
| 10147 10372 | 
             
            				<xsl:otherwise>
         | 
| 10148 10373 | 
             
            					<xsl:value-of select="normalize-space(@target)"/>
         | 
| 10149 10374 | 
             
            				</xsl:otherwise>
         | 
| @@ -10448,7 +10673,7 @@ | |
| 10448 10673 |  | 
| 10449 10674 | 
             
            	<xsl:template name="refine_note_block_style">
         | 
| 10450 10675 |  | 
| 10451 | 
            -
            	</xsl:template>
         | 
| 10676 | 
            +
            	</xsl:template> <!-- refine_note_block_style -->
         | 
| 10452 10677 |  | 
| 10453 10678 | 
             
            	<xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
         | 
| 10454 10679 | 
             
            		<xsl:variable name="num"><xsl:number/></xsl:variable>
         | 
| @@ -10640,10 +10865,21 @@ | |
| 10640 10865 | 
             
            	</xsl:template>
         | 
| 10641 10866 |  | 
| 10642 10867 | 
             
            	<xsl:template name="showFigureKey">
         | 
| 10643 | 
            -
            		<xsl:for-each select="*[local-name() = 'note' | 
| 10644 | 
            -
            			<xsl: | 
| 10868 | 
            +
            		<xsl:for-each select="*[(local-name() = 'note' and not(@type = 'units')) or local-name() = 'example']">
         | 
| 10869 | 
            +
            			<xsl:choose>
         | 
| 10870 | 
            +
            				<xsl:when test="local-name() = 'note'">
         | 
| 10871 | 
            +
            					<xsl:call-template name="note"/>
         | 
| 10872 | 
            +
            				</xsl:when>
         | 
| 10873 | 
            +
            				<xsl:when test="local-name() = 'example'">
         | 
| 10874 | 
            +
            					<xsl:call-template name="example"/>
         | 
| 10875 | 
            +
            				</xsl:when>
         | 
| 10876 | 
            +
            				<xsl:otherwise>
         | 
| 10877 | 
            +
            					<xsl:apply-templates select="."/>
         | 
| 10878 | 
            +
            				</xsl:otherwise>
         | 
| 10879 | 
            +
            			</xsl:choose>
         | 
| 10645 10880 | 
             
            		</xsl:for-each>
         | 
| 10646 | 
            -
            		 | 
| 10881 | 
            +
            		<!-- TO DO: remove, now the figure fn in figure/dl/... https://github.com/metanorma/isodoc/issues/658 -->
         | 
| 10882 | 
            +
            		<xsl:call-template name="figure_fn_display"/>
         | 
| 10647 10883 | 
             
            	</xsl:template>
         | 
| 10648 10884 |  | 
| 10649 10885 | 
             
            	<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
         | 
| @@ -11537,10 +11773,10 @@ | |
| 11537 11773 | 
             
            							<xsl:when test="@type = 'section-title'">
         | 
| 11538 11774 | 
             
            								<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
         | 
| 11539 11775 | 
             
            								<xsl:text>: </xsl:text>
         | 
| 11540 | 
            -
            								<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
         | 
| 11776 | 
            +
            								<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
         | 
| 11541 11777 | 
             
            							</xsl:when>
         | 
| 11542 11778 | 
             
            							<xsl:otherwise>
         | 
| 11543 | 
            -
            								<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
         | 
| 11779 | 
            +
            								<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name() = 'fmt-xref-label')]"/>
         | 
| 11544 11780 | 
             
            							</xsl:otherwise>
         | 
| 11545 11781 | 
             
            						</xsl:choose>
         | 
| 11546 11782 | 
             
            					</xsl:when>
         | 
| @@ -11605,6 +11841,8 @@ | |
| 11605 11841 | 
             
            	<xsl:template match="*[local-name() = 'origin']" mode="contents"/>
         | 
| 11606 11842 | 
             
            	<xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
         | 
| 11607 11843 |  | 
| 11844 | 
            +
            	<xsl:template match="*[local-name() = 'requirement'] |             *[local-name() = 'recommendation'] |              *[local-name() = 'permission']" mode="contents" priority="3"/>
         | 
| 11845 | 
            +
             | 
| 11608 11846 | 
             
            	<xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
         | 
| 11609 11847 | 
             
            	<xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
         | 
| 11610 11848 | 
             
            		<xsl:apply-templates mode="bookmarks"/>
         | 
| @@ -11626,6 +11864,8 @@ | |
| 11626 11864 | 
             
            	<xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
         | 
| 11627 11865 | 
             
            	<xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
         | 
| 11628 11866 |  | 
| 11867 | 
            +
            	<xsl:template match="*[local-name() = 'requirement'] |             *[local-name() = 'recommendation'] |              *[local-name() = 'permission']" mode="bookmarks" priority="3"/>
         | 
| 11868 | 
            +
             | 
| 11629 11869 | 
             
            	<!-- Bookmarks -->
         | 
| 11630 11870 | 
             
            	<xsl:template name="addBookmarks">
         | 
| 11631 11871 | 
             
            		<xsl:param name="contents"/>
         | 
| @@ -11871,9 +12111,15 @@ | |
| 11871 12111 | 
             
            		</xsl:if>
         | 
| 11872 12112 | 
             
            	</xsl:template>
         | 
| 11873 12113 |  | 
| 12114 | 
            +
            	<!-- figure/fn -->
         | 
| 11874 12115 | 
             
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
         | 
| 11875 | 
            -
            	 | 
| 12116 | 
            +
            	<!-- figure/note -->
         | 
| 12117 | 
            +
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
         | 
| 12118 | 
            +
            	<!-- figure/example -->
         | 
| 12119 | 
            +
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
         | 
| 11876 12120 |  | 
| 12121 | 
            +
            	<!-- figure/note[@type = 'units'] -->
         | 
| 12122 | 
            +
            	<!-- image/note[@type = 'units'] -->
         | 
| 11877 12123 | 
             
            	<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] |         *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
         | 
| 11878 12124 | 
             
            		<fo:block text-align="right" keep-with-next="always">
         | 
| 11879 12125 | 
             
            			<xsl:apply-templates/>
         | 
| @@ -11994,6 +12240,7 @@ | |
| 11994 12240 | 
             
            			</xsl:choose>
         | 
| 11995 12241 | 
             
            	</xsl:template>
         | 
| 11996 12242 |  | 
| 12243 | 
            +
            	<!-- fn -->
         | 
| 11997 12244 | 
             
            	<xsl:template match="*[local-name() = 'fn']" mode="contents"/>
         | 
| 11998 12245 | 
             
            	<xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/>
         | 
| 11999 12246 |  | 
| @@ -12893,7 +13140,7 @@ | |
| 12893 13140 | 
             
            	     text line 1
         | 
| 12894 13141 | 
             
            			 text line 2
         | 
| 12895 13142 | 
             
            	-->
         | 
| 12896 | 
            -
            	<xsl:template match="*[local-name() = 'example']">
         | 
| 13143 | 
            +
            	<xsl:template match="*[local-name() = 'example']" name="example">
         | 
| 12897 13144 |  | 
| 12898 13145 | 
             
            				<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
         | 
| 12899 13146 |  | 
| @@ -12999,6 +13246,7 @@ | |
| 12999 13246 |  | 
| 13000 13247 | 
             
            	</xsl:template>
         | 
| 13001 13248 |  | 
| 13249 | 
            +
            	<!-- example/name -->
         | 
| 13002 13250 | 
             
            	<xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
         | 
| 13003 13251 | 
             
            		<xsl:param name="fo_element">block</xsl:param>
         | 
| 13004 13252 |  | 
| @@ -13024,7 +13272,8 @@ | |
| 13024 13272 |  | 
| 13025 13273 | 
             
            	</xsl:template>
         | 
| 13026 13274 |  | 
| 13027 | 
            -
            	 | 
| 13275 | 
            +
            	<!-- table/example/name, table/tfoot//example/name -->
         | 
| 13276 | 
            +
            	<xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name'] |  *[local-name() = 'table']/*[local-name() = 'tfoot']//*[local-name() = 'example']/*[local-name() = 'name']">
         | 
| 13028 13277 | 
             
            		<fo:inline xsl:use-attribute-sets="example-name-style">
         | 
| 13029 13278 |  | 
| 13030 13279 | 
             
            			<xsl:apply-templates/>
         | 
| @@ -13490,21 +13739,32 @@ | |
| 13490 13739 | 
             
            	<!-- ========== -->
         | 
| 13491 13740 |  | 
| 13492 13741 | 
             
            	<xsl:variable name="reviews_">
         | 
| 13493 | 
            -
            		<xsl:for-each select="//*[local-name() = 'review'][@from]">
         | 
| 13742 | 
            +
            		<xsl:for-each select="//*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])][@from]">
         | 
| 13494 13743 | 
             
            			<xsl:copy>
         | 
| 13495 13744 | 
             
            				<xsl:copy-of select="@from"/>
         | 
| 13496 13745 | 
             
            				<xsl:copy-of select="@id"/>
         | 
| 13497 13746 | 
             
            			</xsl:copy>
         | 
| 13498 13747 | 
             
            		</xsl:for-each>
         | 
| 13748 | 
            +
            		<xsl:for-each select="//*[local-name() = 'fmt-review-start'][@source]">
         | 
| 13749 | 
            +
            			<xsl:copy>
         | 
| 13750 | 
            +
            				<xsl:copy-of select="@source"/>
         | 
| 13751 | 
            +
            				<xsl:copy-of select="@id"/>
         | 
| 13752 | 
            +
            			</xsl:copy>
         | 
| 13753 | 
            +
            		</xsl:for-each>
         | 
| 13499 13754 | 
             
            	</xsl:variable>
         | 
| 13500 13755 | 
             
            	<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
         | 
| 13501 13756 |  | 
| 13502 13757 | 
             
            	<xsl:template name="addReviewHelper">
         | 
| 13503 | 
            -
            		 | 
| 13504 | 
            -
             | 
| 13505 | 
            -
             | 
| 13506 | 
            -
             | 
| 13507 | 
            -
            			< | 
| 13758 | 
            +
            		<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 13759 | 
            +
            			<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
         | 
| 13760 | 
            +
            			<xsl:variable name="curr_id" select="@id"/>
         | 
| 13761 | 
            +
            			<!-- <xsl:variable name="review_id" select="normalize-space(/@id)"/> -->
         | 
| 13762 | 
            +
            			<xsl:for-each select="$reviews//*[local-name() = 'review'][@from = $curr_id]"> <!-- $reviews//*[local-name() = 'fmt-review-start'][@source = $curr_id] -->
         | 
| 13763 | 
            +
            				<xsl:variable name="review_id" select="normalize-space(@id)"/>
         | 
| 13764 | 
            +
            				<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
         | 
| 13765 | 
            +
            					<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>
         | 
| 13766 | 
            +
            				</xsl:if>
         | 
| 13767 | 
            +
            			</xsl:for-each>
         | 
| 13508 13768 | 
             
            		</xsl:if>
         | 
| 13509 13769 | 
             
            		<!-- <fo:block>
         | 
| 13510 13770 | 
             
            			<curr_id><xsl:value-of select="$curr_id"/></curr_id>
         | 
| @@ -13641,14 +13901,61 @@ | |
| 13641 13901 |  | 
| 13642 13902 | 
             
            	</xsl:template>
         | 
| 13643 13903 |  | 
| 13644 | 
            -
            	 | 
| 13904 | 
            +
            	<!-- document text (not figures, or tables) footnotes -->
         | 
| 13905 | 
            +
            	<xsl:variable name="reviews_container_">
         | 
| 13906 | 
            +
            		<xsl:for-each select="//*[local-name() = 'review-container']/*[local-name() = 'fmt-review-body']">
         | 
| 13907 | 
            +
            			<xsl:variable name="update_xml_step1">
         | 
| 13908 | 
            +
            				<xsl:apply-templates select="." mode="update_xml_step1"/>
         | 
| 13909 | 
            +
            			</xsl:variable>
         | 
| 13910 | 
            +
            			<xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
         | 
| 13911 | 
            +
            		</xsl:for-each>
         | 
| 13912 | 
            +
            	</xsl:variable>
         | 
| 13913 | 
            +
            	<xsl:variable name="reviews_container" select="xalan:nodeset($reviews_container_)"/>
         | 
| 13914 | 
            +
             | 
| 13915 | 
            +
            	<xsl:template match="*[local-name() = 'review-container']"/>
         | 
| 13916 | 
            +
             | 
| 13917 | 
            +
            	<!-- for old Presentation XML (before https://github.com/metanorma/isodoc/issues/670) -->
         | 
| 13918 | 
            +
            	<xsl:template match="*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])]">  <!-- 'review' will be processed in mn2pdf/review.xsl -->
         | 
| 13919 | 
            +
            		<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
         | 
| 13920 | 
            +
            		<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 13921 | 
            +
            		<xsl:choose>
         | 
| 13922 | 
            +
            			<!-- if there isn't the attribute '@from', then -->
         | 
| 13923 | 
            +
            			<xsl:when test="$id_from = ''">
         | 
| 13924 | 
            +
            				<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>
         | 
| 13925 | 
            +
            			</xsl:when>
         | 
| 13926 | 
            +
            			<!-- if there isn't element with id 'from', then create 'bookmark' here -->
         | 
| 13927 | 
            +
            			<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
         | 
| 13928 | 
            +
            				<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>
         | 
| 13929 | 
            +
            			</xsl:when>
         | 
| 13930 | 
            +
            			<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
         | 
| 13931 | 
            +
            				<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>
         | 
| 13932 | 
            +
            			</xsl:when>
         | 
| 13933 | 
            +
            		</xsl:choose>
         | 
| 13934 | 
            +
            		</xsl:if>
         | 
| 13935 | 
            +
            	</xsl:template>
         | 
| 13936 | 
            +
             | 
| 13937 | 
            +
            	<!-- for new Presentation XML (https://github.com/metanorma/isodoc/issues/670) -->
         | 
| 13938 | 
            +
            	<xsl:template match="*[local-name() = 'fmt-review-start']" name="fmt-review-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
         | 
| 13645 13939 | 
             
            		<!-- comment 2019-11-29 -->
         | 
| 13646 13940 | 
             
            		<!-- <fo:block font-weight="bold">Review:</fo:block>
         | 
| 13647 13941 | 
             
            		<xsl:apply-templates /> -->
         | 
| 13648 13942 |  | 
| 13649 | 
            -
            		<xsl:variable name="id_from" select="normalize-space(current()/@ | 
| 13943 | 
            +
            		<xsl:variable name="id_from" select="normalize-space(current()/@source)"/>
         | 
| 13650 13944 |  | 
| 13651 | 
            -
            		<xsl: | 
| 13945 | 
            +
            		<xsl:variable name="source" select="normalize-space(@source)"/>
         | 
| 13946 | 
            +
             | 
| 13947 | 
            +
            		<xsl:if test="$isGenerateTableIF = 'false'">
         | 
| 13948 | 
            +
            		<!-- <xsl:variable name="id_from" select="normalize-space(current()/@from)"/> -->
         | 
| 13949 | 
            +
             | 
| 13950 | 
            +
            		<!-- <xsl:if test="@source = @end"> -->
         | 
| 13951 | 
            +
            		<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
         | 
| 13952 | 
            +
            				following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
         | 
| 13953 | 
            +
            			<!-- <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> -->
         | 
| 13954 | 
            +
            			<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>
         | 
| 13955 | 
            +
            		<!-- </xsl:if> -->
         | 
| 13956 | 
            +
            		</xsl:if>
         | 
| 13957 | 
            +
             | 
| 13958 | 
            +
            		<xsl:if test="1 = 2">
         | 
| 13652 13959 | 
             
            		<xsl:choose>
         | 
| 13653 13960 | 
             
            			<!-- if there isn't the attribute '@from', then -->
         | 
| 13654 13961 | 
             
            			<xsl:when test="$id_from = ''">
         | 
| @@ -13656,10 +13963,10 @@ | |
| 13656 13963 | 
             
            			</xsl:when>
         | 
| 13657 13964 | 
             
            			<!-- if there isn't element with id 'from', then create 'bookmark' here -->
         | 
| 13658 13965 | 
             
            			<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
         | 
| 13659 | 
            -
            				<fo:block id="{ | 
| 13966 | 
            +
            				<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>
         | 
| 13660 13967 | 
             
            			</xsl:when>
         | 
| 13661 13968 | 
             
            			<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
         | 
| 13662 | 
            -
            				<fo:block id="{ | 
| 13969 | 
            +
            				<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>
         | 
| 13663 13970 | 
             
            			</xsl:when>
         | 
| 13664 13971 | 
             
            		</xsl:choose>
         | 
| 13665 13972 | 
             
            		</xsl:if>
         | 
| @@ -13719,16 +14026,21 @@ | |
| 13719 14026 | 
             
            		<xsl:variable name="list_level">
         | 
| 13720 14027 | 
             
            			<xsl:choose>
         | 
| 13721 14028 | 
             
            				<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
         | 
| 13722 | 
            -
            				<xsl: | 
| 14029 | 
            +
            				<xsl:when test="$ul_labels/label[@level = 3]"><xsl:value-of select="$list_level_ mod 3"/></xsl:when>
         | 
| 14030 | 
            +
            				<xsl:when test="$list_level_ mod 2 = 0">2</xsl:when>
         | 
| 14031 | 
            +
            				<xsl:otherwise><xsl:value-of select="$list_level_ mod 2"/></xsl:otherwise>
         | 
| 13723 14032 | 
             
            			</xsl:choose>
         | 
| 13724 14033 | 
             
            		</xsl:variable>
         | 
| 13725 14034 | 
             
            		<xsl:choose>
         | 
| 13726 14035 | 
             
            			<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
         | 
| 13727 14036 | 
             
            				<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
         | 
| 13728 14037 | 
             
            			</xsl:when>
         | 
| 13729 | 
            -
            			<xsl:when test="$list_level mod 3 = 0">
         | 
| 14038 | 
            +
            			<xsl:when test="$list_level mod 3 = 0 and $ul_labels/label[@level = 3]">
         | 
| 13730 14039 | 
             
            				<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
         | 
| 13731 14040 | 
             
            			</xsl:when>
         | 
| 14041 | 
            +
            			<xsl:when test="$list_level mod 3 = 0">
         | 
| 14042 | 
            +
            				<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
         | 
| 14043 | 
            +
            			</xsl:when>
         | 
| 13732 14044 | 
             
            			<xsl:when test="$list_level mod 2 = 0">
         | 
| 13733 14045 | 
             
            				<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
         | 
| 13734 14046 | 
             
            			</xsl:when>
         | 
| @@ -14271,10 +14583,22 @@ | |
| 14271 14583 | 
             
            	<xsl:template match="*[local-name() = 'table']/*[local-name() = 'bookmark']" priority="2"/>
         | 
| 14272 14584 |  | 
| 14273 14585 | 
             
            	<xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
         | 
| 14274 | 
            -
            		 | 
| 14275 | 
            -
            		< | 
| 14276 | 
            -
             | 
| 14277 | 
            -
             | 
| 14586 | 
            +
            		<xsl:variable name="bookmark_id" select="@id"/>
         | 
| 14587 | 
            +
            		<xsl:choose>
         | 
| 14588 | 
            +
            			<!-- Example:
         | 
| 14589 | 
            +
            				<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"/>
         | 
| 14590 | 
            +
            				<bookmark id="_dda23915-8574-ef1e-29a1-822d465a5b97"/>
         | 
| 14591 | 
            +
            				<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"/> -->
         | 
| 14592 | 
            +
            			<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]">
         | 
| 14593 | 
            +
            				<!-- skip here, see the template 'fmt-review-start' -->
         | 
| 14594 | 
            +
            			</xsl:when>
         | 
| 14595 | 
            +
            			<xsl:otherwise>
         | 
| 14596 | 
            +
            				<!-- <fo:inline id="{@id}" font-size="1pt"/> -->
         | 
| 14597 | 
            +
            				<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>
         | 
| 14598 | 
            +
            				<!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
         | 
| 14599 | 
            +
            				<xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
         | 
| 14600 | 
            +
            			</xsl:otherwise>
         | 
| 14601 | 
            +
            		</xsl:choose>
         | 
| 14278 14602 | 
             
            	</xsl:template>
         | 
| 14279 14603 | 
             
            	<!-- =================== -->
         | 
| 14280 14604 | 
             
            	<!-- End of Index processing -->
         | 
| @@ -14672,8 +14996,33 @@ | |
| 14672 14996 |  | 
| 14673 14997 | 
             
            	<xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
         | 
| 14674 14998 | 
             
            		<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
         | 
| 14999 | 
            +
            		<!-- New format: one tab <xref target="cgpm9th1948r6">“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
         | 
| 15000 | 
            +
            		<!-- <test><xsl:copy-of select="."/></test> -->
         | 
| 15001 | 
            +
             | 
| 14675 15002 | 
             
            		<xsl:variable name="target" select="@target"/>
         | 
| 15003 | 
            +
             | 
| 14676 15004 | 
             
            		<xsl:for-each select="*[local-name() = 'tab']">
         | 
| 15005 | 
            +
             | 
| 15006 | 
            +
            			<xsl:if test="position() = 1">
         | 
| 15007 | 
            +
            				<!-- first column (data before first `tab`) -->
         | 
| 15008 | 
            +
            				<fo:table-cell>
         | 
| 15009 | 
            +
            					<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
         | 
| 15010 | 
            +
            						<xsl:call-template name="insert_basic_link">
         | 
| 15011 | 
            +
            							<xsl:with-param name="element">
         | 
| 15012 | 
            +
            								<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
         | 
| 15013 | 
            +
            									<xsl:for-each select="preceding-sibling::node()">
         | 
| 15014 | 
            +
            										<xsl:choose>
         | 
| 15015 | 
            +
            											<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
         | 
| 15016 | 
            +
            											<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
         | 
| 15017 | 
            +
            										</xsl:choose>
         | 
| 15018 | 
            +
            									</xsl:for-each>
         | 
| 15019 | 
            +
            								</fo:basic-link>
         | 
| 15020 | 
            +
            							</xsl:with-param>
         | 
| 15021 | 
            +
            						</xsl:call-template>
         | 
| 15022 | 
            +
            					</fo:block>
         | 
| 15023 | 
            +
            				</fo:table-cell>
         | 
| 15024 | 
            +
            			</xsl:if>
         | 
| 15025 | 
            +
             | 
| 14677 15026 | 
             
            			<xsl:variable name="current_id" select="generate-id()"/>
         | 
| 14678 15027 | 
             
            			<fo:table-cell>
         | 
| 14679 15028 | 
             
            				<fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
         | 
| @@ -14724,11 +15073,25 @@ | |
| 14724 15073 |  | 
| 14725 15074 | 
             
            	<xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
         | 
| 14726 15075 | 
             
            		<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
         | 
| 15076 | 
            +
            		<!-- New format - one tab <xref target="cgpm9th1948r6">“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
         | 
| 14727 15077 | 
             
            		<xsl:for-each select="*[local-name() = 'tab']">
         | 
| 15078 | 
            +
            			<xsl:if test="position() = 1">
         | 
| 15079 | 
            +
            				<td>
         | 
| 15080 | 
            +
            					<xsl:for-each select="preceding-sibling::node()">
         | 
| 15081 | 
            +
            						<xsl:choose>
         | 
| 15082 | 
            +
            							<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
         | 
| 15083 | 
            +
            							<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
         | 
| 15084 | 
            +
            						</xsl:choose>
         | 
| 15085 | 
            +
            					</xsl:for-each>
         | 
| 15086 | 
            +
            				</td>
         | 
| 15087 | 
            +
            			</xsl:if>
         | 
| 14728 15088 | 
             
            			<xsl:variable name="current_id" select="generate-id()"/>
         | 
| 14729 15089 | 
             
            			<td>
         | 
| 14730 15090 | 
             
            				<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
         | 
| 14731 | 
            -
            					<xsl: | 
| 15091 | 
            +
            					<xsl:choose>
         | 
| 15092 | 
            +
            						<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
         | 
| 15093 | 
            +
            						<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
         | 
| 15094 | 
            +
            					</xsl:choose>
         | 
| 14732 15095 | 
             
            				</xsl:for-each>
         | 
| 14733 15096 | 
             
            			</td>
         | 
| 14734 15097 | 
             
            		</xsl:for-each>
         | 
| @@ -15632,6 +15995,9 @@ | |
| 15632 15995 | 
             
            	<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
         | 
| 15633 15996 | 
             
            	<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
         | 
| 15634 15997 |  | 
| 15998 | 
            +
            	<xsl:template match="*[local-name() = 'review-container']" mode="update_xml_step1"/>
         | 
| 15999 | 
            +
            	<xsl:template match="*[local-name() = 'review-container']" mode="update_xml_pres"/>
         | 
| 16000 | 
            +
             | 
| 15635 16001 | 
             
            	<!-- END: update new Presentation XML -->
         | 
| 15636 16002 |  | 
| 15637 16003 | 
             
            	<!-- =========================================================================== -->
         | 
| @@ -16259,6 +16625,7 @@ | |
| 16259 16625 | 
             
            			<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
         | 
| 16260 16626 | 
             
            		</fn>
         | 
| 16261 16627 | 
             
            	-->
         | 
| 16628 | 
            +
            	<!-- fn in text -->
         | 
| 16262 16629 | 
             
            	<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">
         | 
| 16263 16630 | 
             
            		<xsl:variable name="p_fn_">
         | 
| 16264 16631 | 
             
            			<xsl:call-template name="get_fn_list"/>
         |