metanorma-itu 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.
@@ -1808,10 +1808,11 @@
1808
1808
  <xsl:if test="$doctype != 'resolution' and $doctype != 'service-publication'">
1809
1809
  <fo:block break-after="page"/>
1810
1810
  <fo:block-container>
1811
- <fo:block role="TOC">
1812
-
1811
+ <fo:block role="SKIP">
1813
1812
  <xsl:apply-templates/>
1813
+ </fo:block>
1814
1814
 
1815
+ <fo:block role="TOC">
1815
1816
  <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
1816
1817
 
1817
1818
  <xsl:for-each select="$contents/doc[@num = $num]//item[@display = 'true']">
@@ -3715,6 +3716,7 @@
3715
3716
  </xsl:template> <!-- refine_table-style -->
3716
3717
 
3717
3718
  <xsl:attribute-set name="table-name-style">
3719
+ <xsl:attribute name="role">Caption</xsl:attribute>
3718
3720
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3719
3721
 
3720
3722
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -3725,6 +3727,9 @@
3725
3727
 
3726
3728
  <xsl:template name="refine_table-name-style">
3727
3729
  <xsl:param name="continued"/>
3730
+ <xsl:if test="$continued = 'true'">
3731
+ <xsl:attribute name="role">SKIP</xsl:attribute>
3732
+ </xsl:if>
3728
3733
 
3729
3734
  </xsl:template> <!-- refine_table-name-style -->
3730
3735
 
@@ -5545,7 +5550,7 @@
5545
5550
  </xsl:if>
5546
5551
 
5547
5552
  </fo:block-container>
5548
- </xsl:variable>
5553
+ </xsl:variable> <!-- END: variable name="table" -->
5549
5554
 
5550
5555
  <xsl:variable name="isAdded" select="@added"/>
5551
5556
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5555,14 +5560,14 @@
5555
5560
 
5556
5561
  <!-- centered table when table name is centered (see table-name-style) -->
5557
5562
 
5558
- <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
5563
+ <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
5559
5564
 
5560
5565
  <fo:table-column column-width="proportional-column-width(1)"/>
5561
5566
  <fo:table-column column-width="{@width}"/>
5562
5567
  <fo:table-column column-width="proportional-column-width(1)"/>
5563
- <fo:table-body>
5564
- <fo:table-row>
5565
- <fo:table-cell column-number="2">
5568
+ <fo:table-body role="SKIP">
5569
+ <fo:table-row role="SKIP">
5570
+ <fo:table-cell column-number="2" role="SKIP">
5566
5571
  <xsl:copy-of select="$table-preamble"/>
5567
5572
  <fo:block role="SKIP">
5568
5573
  <xsl:call-template name="setTrackChangesStyles">
@@ -5603,11 +5608,12 @@
5603
5608
 
5604
5609
  </xsl:template>
5605
5610
 
5611
+ <!-- table/name-->
5606
5612
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
5607
5613
  <xsl:param name="continued"/>
5608
5614
  <xsl:if test="normalize-space() != ''">
5609
5615
 
5610
- <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
5616
+ <fo:block xsl:use-attribute-sets="table-name-style">
5611
5617
 
5612
5618
  <xsl:call-template name="refine_table-name-style">
5613
5619
  <xsl:with-param name="continued" select="$continued"/>
@@ -6084,7 +6090,7 @@
6084
6090
 
6085
6091
  <xsl:variable name="tableWithNotesAndFootnotes">
6086
6092
 
6087
- <fo:table keep-with-previous="always">
6093
+ <fo:table keep-with-previous="always" role="SKIP">
6088
6094
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
6089
6095
  <xsl:variable name="name" select="local-name()"/>
6090
6096
  <xsl:choose>
@@ -6122,9 +6128,9 @@
6122
6128
  </xsl:otherwise>
6123
6129
  </xsl:choose>
6124
6130
 
6125
- <fo:table-body>
6126
- <fo:table-row>
6127
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
6131
+ <fo:table-body role="SKIP">
6132
+ <fo:table-row role="SKIP">
6133
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
6128
6134
 
6129
6135
  <xsl:call-template name="refine_table-footer-cell-style"/>
6130
6136
 
@@ -6531,6 +6537,7 @@
6531
6537
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
6532
6538
  <!-- fn in text -->
6533
6539
  <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">
6540
+ <xsl:param name="footnote_body_from_table">false</xsl:param>
6534
6541
 
6535
6542
  <!-- list of unique footnotes -->
6536
6543
  <xsl:variable name="p_fn_">
@@ -6596,7 +6603,7 @@
6596
6603
  <xsl:copy-of select="$footnote_inline"/>
6597
6604
  </xsl:when>
6598
6605
  <!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
6599
- <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
6606
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
6600
6607
 
6601
6608
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
6602
6609
  <xsl:copy-of select="$footnote_inline"/>
@@ -7007,39 +7014,51 @@
7007
7014
  <!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
7008
7015
  <!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
7009
7016
  <xsl:template match="*[local-name()='fn']">
7010
- <fo:inline xsl:use-attribute-sets="fn-reference-style">
7017
+ <xsl:variable name="target" select="@target"/>
7018
+ <xsl:choose>
7019
+ <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
7020
+ <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]">
7021
+ <xsl:call-template name="fn">
7022
+ <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
7023
+ </xsl:call-template>
7024
+ </xsl:when>
7025
+ <xsl:otherwise>
7011
7026
 
7012
- <xsl:call-template name="refine_fn-reference-style"/>
7027
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
7013
7028
 
7014
- <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
7015
- <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
7016
- <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
7017
- <!-- <xsl:attribute name="internal-destination">
7018
- <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
7019
- </xsl:attribute>
7020
- </xsl:if>
7021
- <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
7022
- <xsl:attribute name="internal-destination">
7023
- <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
7024
- <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
7025
- </xsl:attribute>
7026
- </xsl:if> -->
7027
- <!-- <xsl:if test="$namespace = 'plateau'">
7028
- <xsl:text>※</xsl:text>
7029
- </xsl:if> -->
7030
- <!-- <xsl:value-of select="@reference"/> -->
7029
+ <xsl:call-template name="refine_fn-reference-style"/>
7031
7030
 
7032
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
7033
-
7034
- <!-- <xsl:if test="$namespace = 'bsi'">
7035
- <xsl:text>)</xsl:text>
7036
- </xsl:if> -->
7037
- <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
7038
- <!-- <xsl:if test="$namespace = 'jis'">
7039
- <fo:inline font-weight="normal">)</fo:inline>
7040
- </xsl:if> -->
7041
- </fo:basic-link>
7042
- </fo:inline>
7031
+ <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
7032
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
7033
+ <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
7034
+ <!-- <xsl:attribute name="internal-destination">
7035
+ <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
7036
+ </xsl:attribute>
7037
+ </xsl:if>
7038
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
7039
+ <xsl:attribute name="internal-destination">
7040
+ <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
7041
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
7042
+ </xsl:attribute>
7043
+ </xsl:if> -->
7044
+ <!-- <xsl:if test="$namespace = 'plateau'">
7045
+ <xsl:text>※</xsl:text>
7046
+ </xsl:if> -->
7047
+ <!-- <xsl:value-of select="@reference"/> -->
7048
+
7049
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
7050
+
7051
+ <!-- <xsl:if test="$namespace = 'bsi'">
7052
+ <xsl:text>)</xsl:text>
7053
+ </xsl:if> -->
7054
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
7055
+ <!-- <xsl:if test="$namespace = 'jis'">
7056
+ <fo:inline font-weight="normal">)</fo:inline>
7057
+ </xsl:if> -->
7058
+ </fo:basic-link>
7059
+ </fo:inline>
7060
+ </xsl:otherwise>
7061
+ </xsl:choose>
7043
7062
  </xsl:template> <!-- fn -->
7044
7063
 
7045
7064
  <!-- fn/text() -->
@@ -11083,6 +11102,13 @@
11083
11102
  <xsl:apply-templates select="."/>
11084
11103
  </xsl:template>
11085
11104
 
11105
+ <!-- prevent missing stem for table and figures in ToC -->
11106
+ <xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
11107
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
11108
+ <xsl:apply-templates select="."/>
11109
+ </xsl:if>
11110
+ </xsl:template>
11111
+
11086
11112
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
11087
11113
 
11088
11114
  <xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
@@ -11306,7 +11332,8 @@
11306
11332
 
11307
11333
  <xsl:for-each select="$contents_nodes//tables/table">
11308
11334
  <fo:bookmark internal-destination="{@id}">
11309
- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
11335
+ <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
11336
+ <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
11310
11337
  </fo:bookmark>
11311
11338
  </xsl:for-each>
11312
11339
  </fo:bookmark>
@@ -11315,6 +11342,26 @@
11315
11342
  </xsl:template> <!-- insertTableBookmarks -->
11316
11343
  <!-- End Bookmarks -->
11317
11344
 
11345
+ <!-- ============================ -->
11346
+ <!-- mode="bookmark_clean" -->
11347
+ <!-- ============================ -->
11348
+ <xsl:template match="node()" mode="bookmark_clean">
11349
+ <xsl:apply-templates select="node()" mode="bookmark_clean"/>
11350
+ </xsl:template>
11351
+
11352
+ <xsl:template match="text()" mode="bookmark_clean">
11353
+ <xsl:value-of select="."/>
11354
+ </xsl:template>
11355
+
11356
+ <xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
11357
+ <xsl:value-of select="normalize-space(.)"/>
11358
+ </xsl:template>
11359
+
11360
+ <xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
11361
+ <!-- ============================ -->
11362
+ <!-- END: mode="bookmark_clean" -->
11363
+ <!-- ============================ -->
11364
+
11318
11365
  <xsl:template name="getLangVersion">
11319
11366
  <xsl:param name="lang"/>
11320
11367
  <xsl:param name="doctype" select="''"/>
@@ -13328,9 +13375,15 @@
13328
13375
  <xsl:when test="local-name(..) = 'ul'">
13329
13376
  <xsl:choose>
13330
13377
  <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
13378
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
13379
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
13331
13380
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
13332
13381
  </xsl:choose>
13333
13382
  </xsl:when>
13383
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
13384
+ <xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
13385
+ <xsl:value-of select="@label"/>
13386
+ </xsl:when>
13334
13387
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
13335
13388
 
13336
13389
  <xsl:variable name="type" select="../@type"/>
@@ -13455,7 +13508,7 @@
13455
13508
 
13456
13509
  </xsl:otherwise>
13457
13510
  </xsl:choose>
13458
- </xsl:template>
13511
+ </xsl:template> <!-- getListItemFormat -->
13459
13512
 
13460
13513
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
13461
13514
  <xsl:param name="indent">0</xsl:param>
@@ -13587,6 +13640,11 @@
13587
13640
 
13588
13641
  <xsl:call-template name="refine_list-item-label-style"/>
13589
13642
 
13643
+ <xsl:if test="local-name(..) = 'ul'">
13644
+ <xsl:variable name="li_label" select="@label"/>
13645
+ <xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
13646
+ </xsl:if>
13647
+
13590
13648
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
13591
13649
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
13592
13650
  <xsl:call-template name="append_add-style"/>
@@ -15022,6 +15080,16 @@
15022
15080
  </xsl:choose>
15023
15081
  </xsl:template>
15024
15082
 
15083
+ <!-- li/fmt-name -->
15084
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
15085
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
15086
+ <xsl:attribute name="full">true</xsl:attribute>
15087
+ </xsl:template>
15088
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
15089
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
15090
+ <xsl:attribute name="full">true</xsl:attribute>
15091
+ </xsl:template>
15092
+
15025
15093
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
15026
15094
  <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
15027
15095
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -15836,6 +15904,64 @@
15836
15904
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
15837
15905
  </xsl:template>
15838
15906
 
15907
+ <!-- ===================================== -->
15908
+ <!-- ===================================== -->
15909
+ <!-- Ruby text (CJK languages) rendering -->
15910
+ <!-- ===================================== -->
15911
+ <!-- ===================================== -->
15912
+ <xsl:template match="*[local-name() = 'ruby']">
15913
+ <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
15914
+ <xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
15915
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
15916
+ </xsl:if>
15917
+ <xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
15918
+ <xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
15919
+ <!-- Example: width="2em" -->
15920
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
15921
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
15922
+ <xsl:variable name="text_width">
15923
+ <xsl:choose>
15924
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
15925
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
15926
+ </xsl:choose>
15927
+ </xsl:variable>
15928
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
15929
+
15930
+ <xsl:choose>
15931
+ <xsl:when test="ancestor::*[local-name() = 'ruby']">
15932
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
15933
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
15934
+ </xsl:when>
15935
+ <xsl:otherwise>
15936
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
15937
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
15938
+ </xsl:otherwise>
15939
+ </xsl:choose>
15940
+
15941
+ <xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
15942
+ </fo:inline-container>
15943
+ </xsl:template>
15944
+
15945
+ <xsl:template match="*[local-name() = 'rb']">
15946
+ <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
15947
+ </xsl:template>
15948
+
15949
+ <xsl:template match="*[local-name() = 'rt']">
15950
+ <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
15951
+ <xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
15952
+ <xsl:attribute name="space-before">0em</xsl:attribute>
15953
+ </xsl:if>
15954
+ <xsl:apply-templates/>
15955
+ </fo:block>
15956
+
15957
+ </xsl:template>
15958
+
15959
+ <!-- ===================================== -->
15960
+ <!-- ===================================== -->
15961
+ <!-- END: Ruby text (CJK languages) rendering -->
15962
+ <!-- ===================================== -->
15963
+ <!-- ===================================== -->
15964
+
15839
15965
  <xsl:template name="printEdition">
15840
15966
  <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
15841
15967
 
@@ -1,7 +1,7 @@
1
1
  module IsoDoc
2
2
  module Itu
3
3
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
4
- def clause1(elem)
4
+ def clause1(elem)
5
5
  clause1_super?(elem) and return super
6
6
  lbl = @xrefs.anchor(elem["id"], :label, false)
7
7
  oldsuppressheadingnumbers = @suppressheadingnumbers
@@ -11,8 +11,9 @@ module IsoDoc
11
11
  lbl.blank? || elem["unnumbered"] and return
12
12
  elem.previous =
13
13
  "<p keep-with-next='true' class='supertitle'>" \
14
- "#{labelled_autonum(@i18n.get['section'].upcase, elem["id"], lbl)}</p>"
15
- #"<span element='fmt-element-name'>#{@i18n.get['section'].upcase}</span> #{autonum(elem['id'], lbl)}</p>"
14
+ "#{labelled_autonum(@i18n.get['section'].upcase, elem['id'],
15
+ lbl)}</p>"
16
+ # "<span element='fmt-element-name'>#{@i18n.get['section'].upcase}</span> #{autonum(elem['id'], lbl)}</p>"
16
17
  end
17
18
 
18
19
  def clause1_super?(elem)
@@ -31,7 +32,7 @@ module IsoDoc
31
32
 
32
33
  def annex1_resolution(elem)
33
34
  elem.elements.first.previous = annex1_supertitle(elem)
34
- # TODO: do not alter title, alter semx/@element = title
35
+ # TODO: do not alter title, alter semx/@element = title
35
36
  t = elem.at(ns("./title")) and
36
37
  t.children = "<strong>#{to_xml(t.children)}</strong>"
37
38
  prefix_name(elem, {}, nil, "title")
@@ -49,12 +50,13 @@ module IsoDoc
49
50
  lbl = @xrefs.anchor(elem["id"], :label)
50
51
  res = elem.at(ns("//bibdata/title[@type = 'resolution']"))
51
52
  subhead = @i18n.l10n("(#{@i18n.get['to']} #{to_xml(res.children)})")
52
- "<p class='supertitle'>#{autonum(elem['id'], lbl)}<br/>#{subhead}</p>"
53
+ "<p class='supertitle'>#{autonum(elem['id'],
54
+ lbl)}<br/>#{subhead}</p>"
53
55
  end
54
56
 
55
57
  def middle_title(isoxml)
56
58
  s = isoxml.at(ns("//sections")) or return
57
- titfn = isoxml.at(ns("//note[@type = 'title-footnote']"))
59
+ isoxml.at(ns("//note[@type = 'title-footnote']"))
58
60
  case @doctype
59
61
  when "resolution"
60
62
  middle_title_resolution(isoxml, s.children.first)
@@ -62,16 +64,7 @@ module IsoDoc
62
64
  else
63
65
  middle_title_recommendation(isoxml, s.children.first)
64
66
  end
65
- #titfn and renumber_footnotes(isoxml)
66
- end
67
-
68
- # KILL
69
- def renumber_footnotesx(isoxml)
70
- (isoxml.xpath(ns("//fn")) -
71
- isoxml.xpath(ns("//table//fn | //figure//fn")))
72
- .each_with_index do |fn, i|
73
- fn["reference"] = (i + 1).to_s
74
- end
67
+ # titfn and renumber_footnotes(isoxml)
75
68
  end
76
69
 
77
70
  def middle_title_resolution(isoxml, out)
@@ -134,16 +134,8 @@ module IsoDoc
134
134
  { group: "'" }
135
135
  end
136
136
 
137
- def ol_depth(node)
138
- node["class"] == "steps" ||
139
- node.at(".//ancestor::xmlns:ol[@class = 'steps']") or return super
140
- depth = node.ancestors("ul, ol").size + 1
141
- type = :arabic
142
- type = :alphabet if [2, 7].include? depth
143
- type = :roman if [3, 8].include? depth
144
- type = :alphabet_upper if [4, 9].include? depth
145
- type = :roman_upper if [5, 10].include? depth
146
- type
137
+ def ul_label_list(_elem)
138
+ %w(&#x2013; &#x2022; &#x6f;)
147
139
  end
148
140
 
149
141
  def dl(xml)
@@ -2,7 +2,25 @@ require "isodoc"
2
2
  require "fileutils"
3
3
  require_relative "xref_section"
4
4
 
5
+
5
6
  module IsoDoc
7
+ module XrefGen
8
+ module OlTypeProvider
9
+ def ol_type(list, depth)
10
+ steps = list["class"] == "steps" ||
11
+ list.at(".//ancestor::xmlns:ol[@class = 'steps']")
12
+ !steps && list["type"] and return list["type"].to_sym if list["type"]
13
+ type = steps ? :arabic : :alphabet
14
+ type = (steps ? :alphabet : :arabic) if [2, 7].include? depth
15
+ type = :roman if [3, 8].include? depth
16
+ type = :alphabet_upper if [4, 9].include? depth
17
+ type = :roman_upper if [5, 10].include? depth
18
+ type
19
+ end
20
+ end
21
+ end
22
+
23
+
6
24
  module Itu
7
25
  class Counter < IsoDoc::XrefGen::Counter
8
26
  def print
@@ -82,7 +100,7 @@ module IsoDoc
82
100
  @anchors[elem["id"]][:xref] = @anchors[elem.parent["id"]][:xref] +
83
101
  delim_wrap("-") + semx(elem, sublabel)
84
102
  x = @anchors[elem.parent["id"]][:container] and
85
- @anchors[elem["id"]][:container] = x
103
+ @anchors[elem["id"]][:container] = x
86
104
  end
87
105
  end
88
106
 
@@ -44,9 +44,13 @@ module IsoDoc
44
44
  def annex_name_lbl(clause, num)
45
45
  lbl = annextype(clause)
46
46
  if @doctype == "resolution"
47
- l10n("<span class='fmt-element-name'>#{lbl.upcase}</span> #{semx(clause, num)}")
47
+ l10n("<span class='fmt-element-name'>#{lbl.upcase}</span> #{semx(
48
+ clause, num
49
+ )}")
48
50
  else
49
- l10n("<strong><span class='fmt-caption-label'><span class='fmt-element-name'>#{lbl}</span> #{semx(clause, num)}</span></strong>")
51
+ l10n("<strong><span class='fmt-caption-label'><span class='fmt-element-name'>#{lbl}</span> #{semx(
52
+ clause, num
53
+ )}</span></strong>")
50
54
  end
51
55
  end
52
56
 
@@ -56,30 +60,12 @@ module IsoDoc
56
60
  { label: annex_name_lbl(clause, num),
57
61
  elem: lbl,
58
62
  type: "clause", value: num.to_s, level: level,
59
- #xref: l10n("#{lbl} #{num}") }
60
- xref: labelled_autonum(lbl, num)
61
- }
62
- end
63
-
64
- # KILL
65
- def annex_names1x(clause, parentnum, num, level)
66
- lbl = clause_number_semx(parentnum, clause, num)
67
- #require 'debug'; binding.b
68
- @anchors[clause["id"]] =
69
- { label: lbl, elem: @labels["annex_subclause"],
70
- xref: @doctype == "resolution" ? lbl : labelled_autonum(@labels['annex_subclause'], lbl), # l10n("#{@labels['annex_subclause']} #{num}"),
71
- level: level, type: "clause" }
72
- i = Counter.new(0)
73
- clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
74
- .each do |c|
75
- #require 'debug'; binding.b
76
- annex_names1(c, lbl, i.increment(c).print, level + 1)
77
- end
63
+ xref: labelled_autonum(lbl, num) }
78
64
  end
79
65
 
80
66
  def annex_name_anchors1(clause, lbl, level)
81
- xref = labelled_autonum(@labels['annex_subclause'], lbl)
82
- @doctype == "resolution" and xref = lbl
67
+ xref = labelled_autonum(@labels["annex_subclause"], lbl)
68
+ @doctype == "resolution" and xref = lbl
83
69
  @anchors[clause["id"]] =
84
70
  { label: lbl, elem: @labels["annex_subclause"],
85
71
  xref: xref, level: level, type: "clause" }
@@ -105,7 +91,7 @@ module IsoDoc
105
91
  elem = @doctype == "resolution" ? @labels["section"] : @labels["clause"]
106
92
  lbl = semx(clause, num.print)
107
93
  @anchors[clause["id"]] =
108
- { label: lbl, xref: labelled_autonum(elem, lbl),# l10n("#{lbl} #{num.print}"),
94
+ { label: lbl, xref: labelled_autonum(elem, lbl),
109
95
  level: lvl, type: "clause", elem: elem }
110
96
  i = Counter.new(0)
111
97
  clause.xpath(ns(SUBCLAUSES)).each do |c|
@@ -116,7 +102,7 @@ module IsoDoc
116
102
 
117
103
  def section_names1(clause, parentnum, num, level)
118
104
  lbl = clause_number_semx(parentnum, clause, num)
119
- x = @doctype == "resolution" ? semx(clause, lbl) : labelled_autonum(@labels['clause'], lbl) #l10n("#{@labels['clause']} #{num}")
105
+ x = @doctype == "resolution" ? semx(clause, lbl) : labelled_autonum(@labels["clause"], lbl) # l10n("#{@labels['clause']} #{num}")
120
106
  @anchors[clause["id"]] =
121
107
  { label: lbl, level: level,
122
108
  elem: @doctype == "resolution" ? "" : @labels["clause"],
@@ -131,8 +117,7 @@ module IsoDoc
131
117
  clause.nil? and return
132
118
  lbl = clause.at(ns("./title"))&.text || "[#{clause['id']}]"
133
119
  @anchors[clause["id"]] =
134
- { label: lbl,
135
- # xref: l10n(%{"#{lbl}"}),
120
+ { label: lbl,
136
121
  xref: semx(clause, lbl),
137
122
  level: lvl,
138
123
  type: "clause" }
@@ -145,7 +130,6 @@ module IsoDoc
145
130
  lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
146
131
  @anchors[clause["id"]] =
147
132
  { label: lbl,
148
- #xref: l10n(%{"#{lbl}"}),
149
133
  xref: semx(clause, lbl),
150
134
  level: level,
151
135
  type: "clause" }
@@ -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">