metanorma-ieee 1.4.3 → 1.4.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: 84f89392ffbb51084bb77406a1816434743815a156fad52d967b22f2c2fe2636
4
- data.tar.gz: 2511288d92f9830064ff48ade3a15e525d33152bf62b4f09f9f8ac1be2c81489
3
+ metadata.gz: 1099fe4242aec2d3b7adac9d66d0b03c6d119c8b79332434062b37f9e284fc43
4
+ data.tar.gz: c0d5669b8bcb4da6c5d9900c6f91d16406a48104eebee444d00bd04a430edceb
5
5
  SHA512:
6
- metadata.gz: 2c6d09554d432784c98a3093ba3bf7c127c137a794fb0c9903913777f68c7527b60f1b526acccaa173acf81fa9f538cf77e98ee361d00fb30be1a4dcfba557ba
7
- data.tar.gz: 96229ab2555cb20ce7167667edd7eb8dee63072af649251c25e92c1a491ddca70595b14bf6e94b034ea40bb45ced96bf1a6dbb5f5601477aeac6aed29c864cd4
6
+ metadata.gz: d877c966ec63e08b0589407624a67e0f2441eb83eebafae47afd6ba64c02705892e1107f8d5f4f1ade73eded1dc137758a1a43d69917a39d3f0f1bf568c2dada
7
+ data.tar.gz: 92ff522c55c1e06a4c3a1a3ffc1bea34ce1461fe4638c7c27fb3e23c03ef114fe4525882587a3b5fd207870af8779690c334a59c7adf5c25525c674f7ca1b412
@@ -13,7 +13,8 @@ class Html2Doc
13
13
  next unless l.first_element_child&.name == "p"
14
14
 
15
15
  l["style"] ||= ""
16
- l["style"] += (l.first_element_child["style"]&.sub(/mso-list[^;]+;/, "") || "")
16
+ l["style"] += l.first_element_child["style"]
17
+ &.sub(/mso-list[^;]+;/, "") || ""
17
18
  l.first_element_child.replace(l.first_element_child.children)
18
19
  end
19
20
  list.replace(list.children)
@@ -2801,7 +2801,7 @@
2801
2801
  <xsl:choose>
2802
2802
  <xsl:when test="ancestor::ieee:table/@unnumbered = 'true' and normalize-space($substring_after) = 'Key'"><!-- no display Table - --></xsl:when>
2803
2803
  <xsl:otherwise>
2804
- <fo:inline font-weight="bold" font-style="normal">
2804
+ <fo:inline font-weight="bold" font-style="normal" role="SKIP">
2805
2805
  <xsl:choose>
2806
2806
  <xsl:when test="$current_template = 'whitepaper' or $current_template= 'icap-whitepaper' or $current_template = 'industry-connection-report'">
2807
2807
  <!-- Figure N in blue color -->
@@ -4509,6 +4509,7 @@
4509
4509
  </xsl:template> <!-- refine_table-style -->
4510
4510
 
4511
4511
  <xsl:attribute-set name="table-name-style">
4512
+ <xsl:attribute name="role">Caption</xsl:attribute>
4512
4513
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4513
4514
 
4514
4515
  <xsl:attribute name="font-family">Arial</xsl:attribute>
@@ -4520,6 +4521,9 @@
4520
4521
 
4521
4522
  <xsl:template name="refine_table-name-style">
4522
4523
  <xsl:param name="continued"/>
4524
+ <xsl:if test="$continued = 'true'">
4525
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4526
+ </xsl:if>
4523
4527
 
4524
4528
  </xsl:template> <!-- refine_table-name-style -->
4525
4529
 
@@ -6331,7 +6335,7 @@
6331
6335
  </xsl:if>
6332
6336
 
6333
6337
  </fo:block-container>
6334
- </xsl:variable>
6338
+ </xsl:variable> <!-- END: variable name="table" -->
6335
6339
 
6336
6340
  <xsl:variable name="isAdded" select="@added"/>
6337
6341
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -6368,11 +6372,12 @@
6368
6372
 
6369
6373
  </xsl:template>
6370
6374
 
6375
+ <!-- table/name-->
6371
6376
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
6372
6377
  <xsl:param name="continued"/>
6373
6378
  <xsl:if test="normalize-space() != ''">
6374
6379
 
6375
- <fo:inline>
6380
+ <fo:inline role="SKIP">
6376
6381
 
6377
6382
  <xsl:if test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
6378
6383
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -6846,7 +6851,7 @@
6846
6851
 
6847
6852
  <xsl:variable name="tableWithNotesAndFootnotes">
6848
6853
 
6849
- <fo:table keep-with-previous="always">
6854
+ <fo:table keep-with-previous="always" role="SKIP">
6850
6855
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
6851
6856
  <xsl:variable name="name" select="local-name()"/>
6852
6857
  <xsl:choose>
@@ -6877,9 +6882,9 @@
6877
6882
  </xsl:otherwise>
6878
6883
  </xsl:choose>
6879
6884
 
6880
- <fo:table-body>
6881
- <fo:table-row>
6882
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
6885
+ <fo:table-body role="SKIP">
6886
+ <fo:table-row role="SKIP">
6887
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
6883
6888
 
6884
6889
  <xsl:call-template name="refine_table-footer-cell-style"/>
6885
6890
 
@@ -6953,7 +6958,7 @@
6953
6958
 
6954
6959
  <!-- if there isn't 'thead' and there is a table's title -->
6955
6960
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
6956
- <fo:table-header>
6961
+ <fo:table-header role="Caption">
6957
6962
  <xsl:call-template name="table-header-title">
6958
6963
  <xsl:with-param name="cols-count" select="$cols-count"/>
6959
6964
  </xsl:call-template>
@@ -7319,6 +7324,7 @@
7319
7324
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
7320
7325
  <!-- fn in text -->
7321
7326
  <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">
7327
+ <xsl:param name="footnote_body_from_table">false</xsl:param>
7322
7328
 
7323
7329
  <!-- list of unique footnotes -->
7324
7330
  <xsl:variable name="p_fn_">
@@ -7384,7 +7390,7 @@
7384
7390
  <xsl:copy-of select="$footnote_inline"/>
7385
7391
  </xsl:when>
7386
7392
  <!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
7387
- <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
7393
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
7388
7394
 
7389
7395
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
7390
7396
  <xsl:copy-of select="$footnote_inline"/>
@@ -7793,39 +7799,51 @@
7793
7799
  <!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
7794
7800
  <!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
7795
7801
  <xsl:template match="*[local-name()='fn']">
7796
- <fo:inline xsl:use-attribute-sets="fn-reference-style">
7802
+ <xsl:variable name="target" select="@target"/>
7803
+ <xsl:choose>
7804
+ <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
7805
+ <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]">
7806
+ <xsl:call-template name="fn">
7807
+ <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
7808
+ </xsl:call-template>
7809
+ </xsl:when>
7810
+ <xsl:otherwise>
7797
7811
 
7798
- <xsl:call-template name="refine_fn-reference-style"/>
7812
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
7799
7813
 
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">
7804
- <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
7805
- </xsl:attribute>
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"/> -->
7814
+ <xsl:call-template name="refine_fn-reference-style"/>
7817
7815
 
7818
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
7816
+ <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
7817
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
7818
+ <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
7819
+ <!-- <xsl:attribute name="internal-destination">
7820
+ <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
7821
+ </xsl:attribute>
7822
+ </xsl:if>
7823
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
7824
+ <xsl:attribute name="internal-destination">
7825
+ <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
7826
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
7827
+ </xsl:attribute>
7828
+ </xsl:if> -->
7829
+ <!-- <xsl:if test="$namespace = 'plateau'">
7830
+ <xsl:text>※</xsl:text>
7831
+ </xsl:if> -->
7832
+ <!-- <xsl:value-of select="@reference"/> -->
7819
7833
 
7820
- <!-- <xsl:if test="$namespace = 'bsi'">
7821
- <xsl:text>)</xsl:text>
7822
- </xsl:if> -->
7823
- <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
7824
- <!-- <xsl:if test="$namespace = 'jis'">
7825
- <fo:inline font-weight="normal">)</fo:inline>
7826
- </xsl:if> -->
7827
- </fo:basic-link>
7828
- </fo:inline>
7834
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
7835
+
7836
+ <!-- <xsl:if test="$namespace = 'bsi'">
7837
+ <xsl:text>)</xsl:text>
7838
+ </xsl:if> -->
7839
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
7840
+ <!-- <xsl:if test="$namespace = 'jis'">
7841
+ <fo:inline font-weight="normal">)</fo:inline>
7842
+ </xsl:if> -->
7843
+ </fo:basic-link>
7844
+ </fo:inline>
7845
+ </xsl:otherwise>
7846
+ </xsl:choose>
7829
7847
  </xsl:template> <!-- fn -->
7830
7848
 
7831
7849
  <!-- fn/text() -->
@@ -11821,6 +11839,13 @@
11821
11839
  <xsl:apply-templates select="."/>
11822
11840
  </xsl:template>
11823
11841
 
11842
+ <!-- prevent missing stem for table and figures in ToC -->
11843
+ <xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
11844
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
11845
+ <xsl:apply-templates select="."/>
11846
+ </xsl:if>
11847
+ </xsl:template>
11848
+
11824
11849
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
11825
11850
 
11826
11851
  <xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
@@ -12044,7 +12069,8 @@
12044
12069
 
12045
12070
  <xsl:for-each select="$contents_nodes//tables/table">
12046
12071
  <fo:bookmark internal-destination="{@id}">
12047
- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
12072
+ <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
12073
+ <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
12048
12074
  </fo:bookmark>
12049
12075
  </xsl:for-each>
12050
12076
  </fo:bookmark>
@@ -12053,6 +12079,26 @@
12053
12079
  </xsl:template> <!-- insertTableBookmarks -->
12054
12080
  <!-- End Bookmarks -->
12055
12081
 
12082
+ <!-- ============================ -->
12083
+ <!-- mode="bookmark_clean" -->
12084
+ <!-- ============================ -->
12085
+ <xsl:template match="node()" mode="bookmark_clean">
12086
+ <xsl:apply-templates select="node()" mode="bookmark_clean"/>
12087
+ </xsl:template>
12088
+
12089
+ <xsl:template match="text()" mode="bookmark_clean">
12090
+ <xsl:value-of select="."/>
12091
+ </xsl:template>
12092
+
12093
+ <xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
12094
+ <xsl:value-of select="normalize-space(.)"/>
12095
+ </xsl:template>
12096
+
12097
+ <xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
12098
+ <!-- ============================ -->
12099
+ <!-- END: mode="bookmark_clean" -->
12100
+ <!-- ============================ -->
12101
+
12056
12102
  <xsl:template name="getLangVersion">
12057
12103
  <xsl:param name="lang"/>
12058
12104
  <xsl:param name="doctype" select="''"/>
@@ -14061,9 +14107,15 @@
14061
14107
  <xsl:when test="local-name(..) = 'ul'">
14062
14108
  <xsl:choose>
14063
14109
  <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
14110
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
14111
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
14064
14112
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
14065
14113
  </xsl:choose>
14066
14114
  </xsl:when>
14115
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
14116
+ <xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
14117
+ <xsl:value-of select="@label"/>
14118
+ </xsl:when>
14067
14119
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
14068
14120
 
14069
14121
  <xsl:variable name="type" select="../@type"/>
@@ -14188,7 +14240,7 @@
14188
14240
 
14189
14241
  </xsl:otherwise>
14190
14242
  </xsl:choose>
14191
- </xsl:template>
14243
+ </xsl:template> <!-- getListItemFormat -->
14192
14244
 
14193
14245
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
14194
14246
  <xsl:param name="indent">0</xsl:param>
@@ -14320,6 +14372,11 @@
14320
14372
 
14321
14373
  <xsl:call-template name="refine_list-item-label-style"/>
14322
14374
 
14375
+ <xsl:if test="local-name(..) = 'ul'">
14376
+ <xsl:variable name="li_label" select="@label"/>
14377
+ <xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
14378
+ </xsl:if>
14379
+
14323
14380
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
14324
14381
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
14325
14382
  <xsl:call-template name="append_add-style"/>
@@ -15766,6 +15823,16 @@
15766
15823
  </xsl:choose>
15767
15824
  </xsl:template>
15768
15825
 
15826
+ <!-- li/fmt-name -->
15827
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
15828
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
15829
+ <xsl:attribute name="full">true</xsl:attribute>
15830
+ </xsl:template>
15831
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
15832
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
15833
+ <xsl:attribute name="full">true</xsl:attribute>
15834
+ </xsl:template>
15835
+
15769
15836
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
15770
15837
  <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
15771
15838
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -16684,6 +16751,64 @@
16684
16751
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
16685
16752
  </xsl:template>
16686
16753
 
16754
+ <!-- ===================================== -->
16755
+ <!-- ===================================== -->
16756
+ <!-- Ruby text (CJK languages) rendering -->
16757
+ <!-- ===================================== -->
16758
+ <!-- ===================================== -->
16759
+ <xsl:template match="*[local-name() = 'ruby']">
16760
+ <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
16761
+ <xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
16762
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
16763
+ </xsl:if>
16764
+ <xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
16765
+ <xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
16766
+ <!-- Example: width="2em" -->
16767
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
16768
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
16769
+ <xsl:variable name="text_width">
16770
+ <xsl:choose>
16771
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
16772
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
16773
+ </xsl:choose>
16774
+ </xsl:variable>
16775
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
16776
+
16777
+ <xsl:choose>
16778
+ <xsl:when test="ancestor::*[local-name() = 'ruby']">
16779
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
16780
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
16781
+ </xsl:when>
16782
+ <xsl:otherwise>
16783
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
16784
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
16785
+ </xsl:otherwise>
16786
+ </xsl:choose>
16787
+
16788
+ <xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
16789
+ </fo:inline-container>
16790
+ </xsl:template>
16791
+
16792
+ <xsl:template match="*[local-name() = 'rb']">
16793
+ <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
16794
+ </xsl:template>
16795
+
16796
+ <xsl:template match="*[local-name() = 'rt']">
16797
+ <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
16798
+ <xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
16799
+ <xsl:attribute name="space-before">0em</xsl:attribute>
16800
+ </xsl:if>
16801
+ <xsl:apply-templates/>
16802
+ </fo:block>
16803
+
16804
+ </xsl:template>
16805
+
16806
+ <!-- ===================================== -->
16807
+ <!-- ===================================== -->
16808
+ <!-- END: Ruby text (CJK languages) rendering -->
16809
+ <!-- ===================================== -->
16810
+ <!-- ===================================== -->
16811
+
16687
16812
  <xsl:template name="printEdition">
16688
16813
  <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
16689
16814