metanorma-iec 2.6.3 → 2.6.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ccd01c3f1f56470992e66fd61dd23ea52f134df9b7f0368f5373b99e3a40cf9
4
- data.tar.gz: 493a899b9534db1c2282dfd12045e0feb581f7954e1bf0c5ed0caf4f18f3328c
3
+ metadata.gz: d645d0456c36e2e19ebbd941038de52eec9fc67290d093ff6dac57d07f405daa
4
+ data.tar.gz: d9e0901468f752d0de9ad4643f0cc5098f61ea729b4f88ec0af158a391ce03b3
5
5
  SHA512:
6
- metadata.gz: 60b0d7a25d2c843087d1ccc701d3f48d7706563cc691851394866305d9ee3887bdc25577b9300c1cfb94c861d5bdcde300fe969758a04a5ceaeca3087bda0f65
7
- data.tar.gz: c3bb3faec8bafd2ba6fc47e88bdb6584696b0ea158fdcb8e49bcf9fdf953e2fb8f8a0f9194144f2dc531583b43c246e7d681ddf54824695e852f407a7d13cd1b
6
+ metadata.gz: bbcb2ffa1835118482ed4887ac89e7f3ff444df83cbf3ef6a8c51b2e7e4ec4951b788b545b26bce6ff50b28bbd12791491acf147d72e0ba039b4ac89220136f4
7
+ data.tar.gz: e1b0276f83a63434a4dad3dbd7bfcb3854b41c37e256d1473ad61591f6e4f1dc8a484bf94e323455c04e6bf9eaf3cd2f7ca2bfdebbdeba643081bbadc820d2ef
@@ -2872,6 +2872,7 @@
2872
2872
  </xsl:template> <!-- refine_table-style -->
2873
2873
 
2874
2874
  <xsl:attribute-set name="table-name-style">
2875
+ <xsl:attribute name="role">Caption</xsl:attribute>
2875
2876
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2876
2877
 
2877
2878
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -2884,6 +2885,9 @@
2884
2885
 
2885
2886
  <xsl:template name="refine_table-name-style">
2886
2887
  <xsl:param name="continued"/>
2888
+ <xsl:if test="$continued = 'true'">
2889
+ <xsl:attribute name="role">SKIP</xsl:attribute>
2890
+ </xsl:if>
2887
2891
 
2888
2892
  <xsl:if test="$continued = 'true'">
2889
2893
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -4709,7 +4713,7 @@
4709
4713
  </xsl:if>
4710
4714
 
4711
4715
  </fo:block-container>
4712
- </xsl:variable>
4716
+ </xsl:variable> <!-- END: variable name="table" -->
4713
4717
 
4714
4718
  <xsl:variable name="isAdded" select="@added"/>
4715
4719
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4719,14 +4723,14 @@
4719
4723
 
4720
4724
  <!-- centered table when table name is centered (see table-name-style) -->
4721
4725
 
4722
- <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
4726
+ <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
4723
4727
 
4724
4728
  <fo:table-column column-width="proportional-column-width(1)"/>
4725
4729
  <fo:table-column column-width="{@width}"/>
4726
4730
  <fo:table-column column-width="proportional-column-width(1)"/>
4727
- <fo:table-body>
4728
- <fo:table-row>
4729
- <fo:table-cell column-number="2">
4731
+ <fo:table-body role="SKIP">
4732
+ <fo:table-row role="SKIP">
4733
+ <fo:table-cell column-number="2" role="SKIP">
4730
4734
  <xsl:copy-of select="$table-preamble"/>
4731
4735
  <fo:block role="SKIP">
4732
4736
  <xsl:call-template name="setTrackChangesStyles">
@@ -4772,11 +4776,12 @@
4772
4776
 
4773
4777
  </xsl:template>
4774
4778
 
4779
+ <!-- table/name-->
4775
4780
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
4776
4781
  <xsl:param name="continued"/>
4777
4782
  <xsl:if test="normalize-space() != ''">
4778
4783
 
4779
- <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
4784
+ <fo:block xsl:use-attribute-sets="table-name-style">
4780
4785
 
4781
4786
  <xsl:call-template name="refine_table-name-style">
4782
4787
  <xsl:with-param name="continued" select="$continued"/>
@@ -5272,7 +5277,7 @@
5272
5277
 
5273
5278
  <xsl:variable name="tableWithNotesAndFootnotes">
5274
5279
 
5275
- <fo:table keep-with-previous="always">
5280
+ <fo:table keep-with-previous="always" role="SKIP">
5276
5281
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
5277
5282
  <xsl:variable name="name" select="local-name()"/>
5278
5283
  <xsl:choose>
@@ -5303,9 +5308,9 @@
5303
5308
  </xsl:otherwise>
5304
5309
  </xsl:choose>
5305
5310
 
5306
- <fo:table-body>
5307
- <fo:table-row>
5308
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
5311
+ <fo:table-body role="SKIP">
5312
+ <fo:table-row role="SKIP">
5313
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
5309
5314
 
5310
5315
  <xsl:call-template name="refine_table-footer-cell-style"/>
5311
5316
 
@@ -5383,7 +5388,7 @@
5383
5388
 
5384
5389
  <!-- if there isn't 'thead' and there is a table's title -->
5385
5390
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
5386
- <fo:table-header>
5391
+ <fo:table-header role="Caption">
5387
5392
  <xsl:call-template name="table-header-title">
5388
5393
  <xsl:with-param name="cols-count" select="$cols-count"/>
5389
5394
  </xsl:call-template>
@@ -5752,6 +5757,7 @@
5752
5757
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
5753
5758
  <!-- fn in text -->
5754
5759
  <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">
5760
+ <xsl:param name="footnote_body_from_table">false</xsl:param>
5755
5761
 
5756
5762
  <!-- list of unique footnotes -->
5757
5763
  <xsl:variable name="p_fn_">
@@ -5817,7 +5823,7 @@
5817
5823
  <xsl:copy-of select="$footnote_inline"/>
5818
5824
  </xsl:when>
5819
5825
  <!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
5820
- <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
5826
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
5821
5827
 
5822
5828
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
5823
5829
  <xsl:copy-of select="$footnote_inline"/>
@@ -6228,39 +6234,51 @@
6228
6234
  <!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
6229
6235
  <!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
6230
6236
  <xsl:template match="*[local-name()='fn']">
6231
- <fo:inline xsl:use-attribute-sets="fn-reference-style">
6232
-
6233
- <xsl:call-template name="refine_fn-reference-style"/>
6237
+ <xsl:variable name="target" select="@target"/>
6238
+ <xsl:choose>
6239
+ <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
6240
+ <xsl:when test="not(ancestor::*[local-name() = 'table'][1]/*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
6241
+ <xsl:call-template name="fn">
6242
+ <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
6243
+ </xsl:call-template>
6244
+ </xsl:when>
6245
+ <xsl:otherwise>
6234
6246
 
6235
- <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
6236
- <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
6237
- <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
6238
- <!-- <xsl:attribute name="internal-destination">
6239
- <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
6240
- </xsl:attribute>
6241
- </xsl:if>
6242
- <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
6243
- <xsl:attribute name="internal-destination">
6244
- <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
6245
- <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
6246
- </xsl:attribute>
6247
- </xsl:if> -->
6248
- <!-- <xsl:if test="$namespace = 'plateau'">
6249
- <xsl:text>※</xsl:text>
6250
- </xsl:if> -->
6251
- <!-- <xsl:value-of select="@reference"/> -->
6247
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
6252
6248
 
6253
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
6249
+ <xsl:call-template name="refine_fn-reference-style"/>
6254
6250
 
6255
- <!-- <xsl:if test="$namespace = 'bsi'">
6256
- <xsl:text>)</xsl:text>
6257
- </xsl:if> -->
6258
- <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
6259
- <!-- <xsl:if test="$namespace = 'jis'">
6260
- <fo:inline font-weight="normal">)</fo:inline>
6261
- </xsl:if> -->
6262
- </fo:basic-link>
6263
- </fo:inline>
6251
+ <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
6252
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
6253
+ <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
6254
+ <!-- <xsl:attribute name="internal-destination">
6255
+ <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
6256
+ </xsl:attribute>
6257
+ </xsl:if>
6258
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
6259
+ <xsl:attribute name="internal-destination">
6260
+ <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
6261
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
6262
+ </xsl:attribute>
6263
+ </xsl:if> -->
6264
+ <!-- <xsl:if test="$namespace = 'plateau'">
6265
+ <xsl:text>※</xsl:text>
6266
+ </xsl:if> -->
6267
+ <!-- <xsl:value-of select="@reference"/> -->
6268
+
6269
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
6270
+
6271
+ <!-- <xsl:if test="$namespace = 'bsi'">
6272
+ <xsl:text>)</xsl:text>
6273
+ </xsl:if> -->
6274
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
6275
+ <!-- <xsl:if test="$namespace = 'jis'">
6276
+ <fo:inline font-weight="normal">)</fo:inline>
6277
+ </xsl:if> -->
6278
+ </fo:basic-link>
6279
+ </fo:inline>
6280
+ </xsl:otherwise>
6281
+ </xsl:choose>
6264
6282
  </xsl:template> <!-- fn -->
6265
6283
 
6266
6284
  <!-- fn/text() -->
@@ -10341,6 +10359,13 @@
10341
10359
  <xsl:apply-templates select="."/>
10342
10360
  </xsl:template>
10343
10361
 
10362
+ <!-- prevent missing stem for table and figures in ToC -->
10363
+ <xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
10364
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
10365
+ <xsl:apply-templates select="."/>
10366
+ </xsl:if>
10367
+ </xsl:template>
10368
+
10344
10369
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
10345
10370
 
10346
10371
  <xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
@@ -10573,7 +10598,8 @@
10573
10598
 
10574
10599
  <xsl:for-each select="$contents_nodes//tables/table">
10575
10600
  <fo:bookmark internal-destination="{@id}">
10576
- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
10601
+ <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
10602
+ <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
10577
10603
  </fo:bookmark>
10578
10604
  </xsl:for-each>
10579
10605
  </fo:bookmark>
@@ -10582,6 +10608,26 @@
10582
10608
  </xsl:template> <!-- insertTableBookmarks -->
10583
10609
  <!-- End Bookmarks -->
10584
10610
 
10611
+ <!-- ============================ -->
10612
+ <!-- mode="bookmark_clean" -->
10613
+ <!-- ============================ -->
10614
+ <xsl:template match="node()" mode="bookmark_clean">
10615
+ <xsl:apply-templates select="node()" mode="bookmark_clean"/>
10616
+ </xsl:template>
10617
+
10618
+ <xsl:template match="text()" mode="bookmark_clean">
10619
+ <xsl:value-of select="."/>
10620
+ </xsl:template>
10621
+
10622
+ <xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
10623
+ <xsl:value-of select="normalize-space(.)"/>
10624
+ </xsl:template>
10625
+
10626
+ <xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
10627
+ <!-- ============================ -->
10628
+ <!-- END: mode="bookmark_clean" -->
10629
+ <!-- ============================ -->
10630
+
10585
10631
  <xsl:template name="getLangVersion">
10586
10632
  <xsl:param name="lang"/>
10587
10633
  <xsl:param name="doctype" select="''"/>
@@ -12597,9 +12643,15 @@
12597
12643
  <xsl:when test="local-name(..) = 'ul'">
12598
12644
  <xsl:choose>
12599
12645
  <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
12646
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
12647
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
12600
12648
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
12601
12649
  </xsl:choose>
12602
12650
  </xsl:when>
12651
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
12652
+ <xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
12653
+ <xsl:value-of select="@label"/>
12654
+ </xsl:when>
12603
12655
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
12604
12656
 
12605
12657
  <xsl:variable name="type" select="../@type"/>
@@ -12724,7 +12776,7 @@
12724
12776
 
12725
12777
  </xsl:otherwise>
12726
12778
  </xsl:choose>
12727
- </xsl:template>
12779
+ </xsl:template> <!-- getListItemFormat -->
12728
12780
 
12729
12781
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
12730
12782
  <xsl:param name="indent">0</xsl:param>
@@ -12860,6 +12912,11 @@
12860
12912
 
12861
12913
  <xsl:call-template name="refine_list-item-label-style"/>
12862
12914
 
12915
+ <xsl:if test="local-name(..) = 'ul'">
12916
+ <xsl:variable name="li_label" select="@label"/>
12917
+ <xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
12918
+ </xsl:if>
12919
+
12863
12920
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
12864
12921
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
12865
12922
  <xsl:call-template name="append_add-style"/>
@@ -14261,6 +14318,16 @@
14261
14318
  </xsl:choose>
14262
14319
  </xsl:template>
14263
14320
 
14321
+ <!-- li/fmt-name -->
14322
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
14323
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
14324
+ <xsl:attribute name="full">true</xsl:attribute>
14325
+ </xsl:template>
14326
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
14327
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
14328
+ <xsl:attribute name="full">true</xsl:attribute>
14329
+ </xsl:template>
14330
+
14264
14331
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
14265
14332
  <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
14266
14333
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -15075,6 +15142,64 @@
15075
15142
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
15076
15143
  </xsl:template>
15077
15144
 
15145
+ <!-- ===================================== -->
15146
+ <!-- ===================================== -->
15147
+ <!-- Ruby text (CJK languages) rendering -->
15148
+ <!-- ===================================== -->
15149
+ <!-- ===================================== -->
15150
+ <xsl:template match="*[local-name() = 'ruby']">
15151
+ <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
15152
+ <xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
15153
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
15154
+ </xsl:if>
15155
+ <xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
15156
+ <xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
15157
+ <!-- Example: width="2em" -->
15158
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
15159
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
15160
+ <xsl:variable name="text_width">
15161
+ <xsl:choose>
15162
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
15163
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
15164
+ </xsl:choose>
15165
+ </xsl:variable>
15166
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
15167
+
15168
+ <xsl:choose>
15169
+ <xsl:when test="ancestor::*[local-name() = 'ruby']">
15170
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
15171
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
15172
+ </xsl:when>
15173
+ <xsl:otherwise>
15174
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
15175
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
15176
+ </xsl:otherwise>
15177
+ </xsl:choose>
15178
+
15179
+ <xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
15180
+ </fo:inline-container>
15181
+ </xsl:template>
15182
+
15183
+ <xsl:template match="*[local-name() = 'rb']">
15184
+ <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
15185
+ </xsl:template>
15186
+
15187
+ <xsl:template match="*[local-name() = 'rt']">
15188
+ <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
15189
+ <xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
15190
+ <xsl:attribute name="space-before">0em</xsl:attribute>
15191
+ </xsl:if>
15192
+ <xsl:apply-templates/>
15193
+ </fo:block>
15194
+
15195
+ </xsl:template>
15196
+
15197
+ <!-- ===================================== -->
15198
+ <!-- ===================================== -->
15199
+ <!-- END: Ruby text (CJK languages) rendering -->
15200
+ <!-- ===================================== -->
15201
+ <!-- ===================================== -->
15202
+
15078
15203
  <xsl:template name="printEdition">
15079
15204
  <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
15080
15205
 
@@ -4,11 +4,11 @@ module IsoDoc
4
4
  def termclause1(elem)
5
5
  @is_iev or return clause1(elem)
6
6
  @suppressheadingnumbers || elem["unnumbered"] or
7
- lbl = @xrefs.anchor(elem["id"], :label, true)
7
+ lbl = @xrefs.anchor(elem["id"], :label, true)
8
8
  if lbl
9
- prefix_name(elem, { caption: " " }, "#{lbl}#{clausedelim}", "title")
9
+ prefix_name(elem, { caption: " " }, "#{lbl}#{clausedelim}", "title")
10
10
  else
11
- prefix_name(elem, {}, nil, "title")
11
+ prefix_name(elem, {}, nil, "title")
12
12
  end
13
13
  end
14
14
 
@@ -46,8 +46,8 @@ module IsoDoc
46
46
 
47
47
  def termdomain(elem, fmt_defn)
48
48
  if @is_iev
49
- #d = elem.at(ns("./domain")) or return
50
- #d["hidden"] = true
49
+ # d = elem.at(ns("./domain")) or return
50
+ # d["hidden"] = true
51
51
  else super
52
52
  end
53
53
  end
@@ -60,19 +60,21 @@ module IsoDoc
60
60
  end
61
61
  # renumber
62
62
  @xrefs.parse_inclusions(clauses: true).parse docxml
63
- docxml.xpath(ns("//term/fmt-name | //term/fmt-xref-label")).each(&:remove)
63
+ docxml.xpath(ns("//term/fmt-name | //term/fmt-xref-label"))
64
+ .each(&:remove)
64
65
  term(docxml)
65
66
  end
66
67
 
67
68
  def merge_fr_into_en_term1(en_term, fr_term)
68
69
  dl = en_term&.at(ns("./dl[@type = 'other-lang']"))&.remove
69
- #en_term << fr_term.remove.children
70
+ # en_term << fr_term.remove.children
70
71
  dup = semx_fmt_dup(fr_term)
71
72
  dup.xpath(ns("./fmt-name | ./fmt-xref-label")).each(&:remove)
72
73
  en_term << dup
73
74
  fr_term.xpath(ns(".//fmt-name | .//fmt-xref-label | " \
74
75
  ".//fmt-preferred | .//fmt-admitted | .//fmt-deprecates | " \
75
- ".//fmt-definition | .//fmt-related | .//fmt-termsource")).each(&:remove)
76
+ ".//fmt-definition | .//fmt-related | .//fmt-termsource"))
77
+ .each(&:remove)
76
78
  fr_term["unnumbered"] = "true"
77
79
  en_term << dl if dl
78
80
  en_term["language"] = "en,fr"
@@ -89,28 +91,15 @@ module IsoDoc
89
91
  def remove_otherlang_designations(docxml)
90
92
  @is_iev or return
91
93
  docxml.xpath(ns("//term")).each do |t|
92
- remove_otherlang_designations1(t, t["language"]&.split(",") || %w(en fr))
94
+ remove_otherlang_designations1(t,
95
+ t["language"]&.split(",") || %w(en fr))
93
96
  end
94
97
  end
95
98
 
96
- # KILL
97
99
  def extract_otherlang_designations(term, lgs)
98
100
  term.xpath(ns(".//preferred/expression[@language]"))
99
101
  .each_with_object([]) do |d, m|
100
102
  lg = d["language"]
101
- d.delete("language")
102
- lgs.include?(lg) and next
103
- p = d.parent
104
- designation_annotate(p, p.at(ns("./name")))
105
- m << { lang: lg, script: Metanorma::Utils.default_script(lg),
106
- designation: to_xml(l10n_recursive(p.remove, lg)).strip }
107
- end
108
- end
109
-
110
- def extract_otherlang_designations(term, lgs)
111
- term.xpath(ns(".//preferred/expression[@language]"))
112
- .each_with_object([]) do |d, m|
113
- lg = d["language"]
114
103
  lgs.include?(lg) and next
115
104
  p = semx_fmt_dup(d.parent)
116
105
  e = p.at(ns("./expression"))
@@ -156,52 +145,32 @@ module IsoDoc
156
145
  end
157
146
 
158
147
  def remove_otherlang_designations1(term, lgs)
159
- term.xpath(ns(".//fmt-preferred/p/semx[@element = 'preferred']")).each do |s|
148
+ term.xpath(ns(".//fmt-preferred/p/semx[@element = 'preferred']"))
149
+ .each do |s|
160
150
  p = semx_orig(s, term)
161
151
  lg = p.at(ns("./expression/@language"))&.text or next
162
152
  lgs.include?(lg) and next
163
153
  s.parent.remove
164
- end
154
+ end
165
155
  end
166
156
 
167
157
  def related(docxml)
168
- #docxml.xpath(ns("//term[related]")).each { |f| move_related(f) }
169
158
  super
170
159
  docxml.xpath(ns("//term[related]")).each { |f| move_related(f) }
171
160
  end
172
161
 
173
- # KILL
174
- def move_related(term)
175
- defn = term.at(ns("./definition")) or return
176
- term.xpath(ns("./related")).reverse_each do |r|
177
- defn.next = r.remove
178
- end
179
- end
180
-
181
162
  def move_related(term)
182
163
  defn = term.at(ns("./fmt-definition")) or return
183
164
  rel = term.at(ns("./fmt-related")) or return
184
165
  defn << rel.children
185
166
  end
186
167
 
187
- # KILL
188
168
  def related1(node)
189
169
  lg = node.at("./ancestor::xmlns:term/@language")&.text
190
170
  @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
191
- p = node.at(ns("./preferred"))
192
- ref = node.at(ns("./xref | ./eref | ./termref"))
193
- label = @i18n.relatedterms[node["type"]].upcase
194
- node.replace(l10n("<p>#{label}: " \
195
- "#{to_xml(p.children)} (#{to_xml(ref)})</p>"))
196
- @i18n = @i18n_lg["default"]
197
- end
198
-
199
- def related1(node)
200
- lg = node.at("./ancestor::xmlns:term/@language")&.text
201
- @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
202
171
  p, ref, orig = related1_prep(node)
203
- label = @i18n.relatedterms[orig["type"]].upcase
204
- node.children =(l10n("<p>#{label}: " \
172
+ label = @i18n.relatedterms[orig["type"]].upcase
173
+ node.children = (l10n("<p>#{label}: " \
205
174
  "#{to_xml(p)} (#{Common::to_xml(ref)})</p>"))
206
175
  @i18n = @i18n_lg["default"]
207
176
  end
@@ -213,31 +182,13 @@ module IsoDoc
213
182
  @i18n = @i18n_lg["default"]
214
183
  end
215
184
 
216
- # KILL
217
- def termsource1xx(node)
218
- lg = node&.at("./ancestor::xmlns:term/@language")&.text
219
- @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
220
- if @is_iev then termsource1_iev(node)
221
- else super
222
- end
223
- @i18n = @i18n_lg["default"]
224
- end
225
-
226
- # KILL
227
- def termsource1_iev(elem)
228
- while elem&.next_element&.name == "termsource"
229
- elem << "; #{to_xml(elem.next_element.remove.children)}"
230
- end
231
- elem.children = l10n("#{@i18n.source}: #{to_xml(elem.children).strip}")
232
- end
233
-
234
185
  def termsource_label(elem, sources)
235
186
  @is_iev or return super
236
187
  lg = elem&.at("./ancestor::xmlns:term/@language")&.text
237
188
  @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
238
- elem.replace(l10n("#{@i18n.source}: #{sources}"))
239
- @i18n = @i18n_lg["default"]
240
- end
189
+ elem.replace(l10n("#{@i18n.source}: #{sources}"))
190
+ @i18n = @i18n_lg["default"]
191
+ end
241
192
 
242
193
  def termexample(docxml)
243
194
  docxml.xpath(ns("//termexample")).each do |f|
@@ -247,7 +198,6 @@ module IsoDoc
247
198
 
248
199
  def termexample1(elem)
249
200
  lg = elem&.at("./ancestor::xmlns:term/@language")&.text
250
- #require "debug"; binding.b
251
201
  @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
252
202
  example1(elem)
253
203
  @i18n = @i18n_lg["default"]
@@ -263,11 +213,6 @@ module IsoDoc
263
213
  @i18n = @i18n_lg["default"]
264
214
  ret
265
215
  end
266
-
267
- def term1(elem)
268
- #require 'debug'; binding.b
269
- super
270
- end
271
216
  end
272
217
  end
273
218
  end
@@ -71,7 +71,7 @@ module IsoDoc
71
71
  ins = elem.at(ns("./title")) || elem.children.first.before(" ").previous
72
72
  ins.next = <<~CLAUSE
73
73
  <clause type='boilerplate_legal'>#{to_xml(boilerplate.children)}</clause>
74
- CLAUSE
74
+ CLAUSE
75
75
  end
76
76
 
77
77
  def insert_middle_title(docxml)
@@ -124,6 +124,10 @@ module IsoDoc
124
124
  s.add_first_child ret
125
125
  end
126
126
 
127
+ def ul_label_list(_elem)
128
+ %w(&#x2022; &#x2014; &#x6f;)
129
+ end
130
+
127
131
  include Init
128
132
  end
129
133
  end
@@ -1701,16 +1701,22 @@ which can be bookmarks as well as block or section references</a:documentation>
1701
1701
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as a footnote.
1702
1702
  The target of a footnote is the location it is embedded in within the text</a:documentation>
1703
1703
  <element name="fn">
1704
- <attribute name="reference">
1705
- <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
1706
- </attribute>
1707
- <oneOrMore>
1708
- <ref name="paragraph">
1709
- <a:documentation>The content of the footnote</a:documentation>
1710
- </ref>
1711
- </oneOrMore>
1704
+ <ref name="FnAttributes"/>
1705
+ <ref name="FnBody"/>
1712
1706
  </element>
1713
1707
  </define>
1708
+ <define name="FnBody">
1709
+ <oneOrMore>
1710
+ <ref name="paragraph">
1711
+ <a:documentation>The content of the footnote</a:documentation>
1712
+ </ref>
1713
+ </oneOrMore>
1714
+ </define>
1715
+ <define name="FnAttributes">
1716
+ <attribute name="reference">
1717
+ <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
1718
+ </attribute>
1719
+ </define>
1714
1720
  <define name="callout">
1715
1721
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as annotation of source code</a:documentation>
1716
1722
  <element name="callout">