metanorma-ribose 2.2.7 → 2.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7165b810d75c75ae9265cd7536229c31effbf384eca0d8df7bc3886b3104068d
4
- data.tar.gz: 596450c4cbf2a31dd4294950e86a6762d20f59a26a8a289d8a84ee2b703ccf1a
3
+ metadata.gz: 2706f601a6101717a95248803efe276a3a684d63fd21701960408911e8ab6321
4
+ data.tar.gz: 49ff403dfba6c90b09d89e60b3ffff854730ff090a40b7b88ca2685f09533733
5
5
  SHA512:
6
- metadata.gz: 467db5e091b769e9e0fe6b285e03dd2cdb504420dd2f2f7d5f70bd456131035339d54617bb4e692986af9f56067e3e5c51d40c38523db0c4b79abebd8478d331
7
- data.tar.gz: 8dcd95606761269f05d2f4cf7eea3a531374fa389b52e55904b682824a56f4be6b7d4861858d1155dace7d16d6791bb76b19ce729e324077e4c64988c0171361
6
+ metadata.gz: 602fc809e82c4f7edd47f22c8847a0c1a4dc643b2cc4fc502ec74abd065f863b90e2acef5f590cb559fc31e6520f94ee1d689560a7a109bb99c38ac2e7e64968
7
+ data.tar.gz: cfd6f6b81cd1efe3227ecb0ce799b3e4b5d010cf2f1b26aaac63e9ee09b7bc1b0007f4cbc9effa909c87571337593942a4be71d6a5220c70f388e1bd5eb5751a
@@ -1,13 +1,12 @@
1
1
  module IsoDoc
2
2
  module Ribose
3
3
  module BaseConvert
4
- def executivesummary(docxml, out)
5
- f = docxml.at(ns("//executivesummary")) || return
4
+ def executivesummary(clause, out)
6
5
  title_attr = { class: "IntroTitle" }
7
6
  page_break(out)
8
- out.div class: "Section3", id: f["id"] do |div|
9
- clause_name(f, f&.at(ns("./title")), div, title_attr)
10
- f.elements.each do |e|
7
+ out.div class: "Section3", id: clause["id"] do |div|
8
+ clause_name(clause, clause&.at(ns("./title")), div, title_attr)
9
+ clause.elements.each do |e|
11
10
  parse(e, div) unless e.name == "title"
12
11
  end
13
12
  end
@@ -1,5 +1,4 @@
1
1
  <nav>
2
- <h1 id="content">Contents</h1>
3
2
  <div id="toc"></div>
4
3
 
5
4
  </nav>
@@ -1,6 +1,3 @@
1
- <p class="zzContents" style='margin-top:0cm'><span lang="EN-GB">Contents</span></p>
2
-
3
- WORDTOC
4
1
 
5
2
  <div class="zzCopyright">
6
3
  <div id="boilerplate-copyright-destination" style='color:windowtext'/>
@@ -14,15 +14,9 @@ module IsoDoc
14
14
  end
15
15
 
16
16
  def make_body3(body, docxml)
17
- body.div **{ class: "main-section" } do |div3|
17
+ body.div class: "main-section" do |div3|
18
18
  boilerplate docxml, div3
19
- preface_block docxml, div3
20
- abstract docxml, div3
21
- foreword docxml, div3
22
- executivesummary docxml, div3
23
- introduction docxml, div3
24
- preface docxml, div3
25
- acknowledgements docxml, div3
19
+ front docxml, div3
26
20
  middle docxml, div3
27
21
  footnotes div3
28
22
  comments div3
@@ -13,11 +13,24 @@ module IsoDoc
13
13
  def termsource1(elem)
14
14
  mod = elem.at(ns("./modification")) and
15
15
  termsource_modification(mod)
16
- elem.children = l10n("<strong>#{@i18n.source}:</strong> "\
16
+ elem.children = l10n("<strong>#{@i18n.source}:</strong> " \
17
17
  "#{to_xml(elem.children).strip}")
18
18
  elem&.next_element&.name == "termsource" and elem.next = "; "
19
19
  end
20
20
 
21
+ def preface_rearrange(doc)
22
+ preface_move(doc.at(ns("//preface/abstract")),
23
+ %w(foreword executivesummary introduction clause acknowledgements), doc)
24
+ preface_move(doc.at(ns("//preface/foreword")),
25
+ %w(executivesummary introduction clause acknowledgements), doc)
26
+ preface_move(doc.at(ns("//preface/executivesummary")),
27
+ %w(introduction clause acknowledgements), doc)
28
+ preface_move(doc.at(ns("//preface/introduction")),
29
+ %w(clause acknowledgements), doc)
30
+ preface_move(doc.at(ns("//preface/acknowledgements")),
31
+ %w(), doc)
32
+ end
33
+
21
34
  include Init
22
35
  end
23
36
  end
@@ -1936,6 +1936,7 @@
1936
1936
  </xsl:attribute-set>
1937
1937
 
1938
1938
  <xsl:attribute-set name="xref-style">
1939
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1939
1940
 
1940
1941
  </xsl:attribute-set>
1941
1942
 
@@ -3970,9 +3971,13 @@
3970
3971
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
3971
3972
  </xsl:if>
3972
3973
 
3973
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3974
- <xsl:value-of select="$current_fn_number_text"/>
3975
- </fo:basic-link>
3974
+ <xsl:call-template name="insert_basic_link">
3975
+ <xsl:with-param name="element">
3976
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3977
+ <xsl:value-of select="$current_fn_number_text"/>
3978
+ </fo:basic-link>
3979
+ </xsl:with-param>
3980
+ </xsl:call-template>
3976
3981
  </fo:inline>
3977
3982
  </xsl:variable>
3978
3983
 
@@ -4305,8 +4310,10 @@
4305
4310
  <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
4306
4311
  <xsl:text> </xsl:text>
4307
4312
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
4308
- <xsl:text/>
4309
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
4313
+ <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
4314
+ <xsl:text> </xsl:text>
4315
+ </xsl:if>
4316
+ <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
4310
4317
  </fo:block>
4311
4318
 
4312
4319
  </xsl:when> <!-- END: only one component -->
@@ -4796,8 +4803,18 @@
4796
4803
  </xsl:if>
4797
4804
  </xsl:template>
4798
4805
 
4799
- <xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4800
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4806
+ <xsl:template match="*[local-name()='dd']/*" mode="inline">
4807
+ <xsl:variable name="is_inline_element_after_where">
4808
+ <xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
4809
+ </xsl:variable>
4810
+ <xsl:choose>
4811
+ <xsl:when test="$is_inline_element_after_where = 'true'">
4812
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4813
+ </xsl:when>
4814
+ <xsl:otherwise>
4815
+ <xsl:apply-templates select="."/>
4816
+ </xsl:otherwise>
4817
+ </xsl:choose>
4801
4818
  </xsl:template>
4802
4819
 
4803
4820
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
@@ -6235,6 +6252,79 @@
6235
6252
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
6236
6253
  </xsl:template>
6237
6254
 
6255
+ <!-- special case for:
6256
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
6257
+ <mstyle displaystyle="true">
6258
+ <msup>
6259
+ <mi color="#00000000">C</mi>
6260
+ <mtext>R</mtext>
6261
+ </msup>
6262
+ <msubsup>
6263
+ <mtext>C</mtext>
6264
+ <mi>n</mi>
6265
+ <mi>k</mi>
6266
+ </msubsup>
6267
+ </mstyle>
6268
+ </math>
6269
+ -->
6270
+ <xsl:template match="mathml:msup/mathml:mi[. = '‌' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
6271
+ <xsl:copy>
6272
+ <xsl:copy-of select="@*"/>
6273
+ <xsl:variable name="next_mtext" select="ancestor::mathml:msup/following-sibling::*[1][self::mathml:msubsup or self::mathml:msub or self::mathml:msup]/mathml:mtext"/>
6274
+ <xsl:if test="string-length($next_mtext) != ''">
6275
+ <xsl:attribute name="color">#00000000</xsl:attribute>
6276
+ </xsl:if>
6277
+ <xsl:apply-templates/>
6278
+ <xsl:value-of select="$next_mtext"/>
6279
+ </xsl:copy>
6280
+ </xsl:template>
6281
+
6282
+ <!-- special case for:
6283
+ <msup>
6284
+ <mtext/>
6285
+ <mn>1</mn>
6286
+ </msup>
6287
+ convert to (add mspace after mtext and enclose them into mrow):
6288
+ <msup>
6289
+ <mrow>
6290
+ <mtext/>
6291
+ <mspace height="1.47ex"/>
6292
+ </mrow>
6293
+ <mn>1</mn>
6294
+ </msup>
6295
+ -->
6296
+ <xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
6297
+ <mathml:mrow>
6298
+ <xsl:copy-of select="."/>
6299
+ <mathml:mspace height="1.47ex"/>
6300
+ </mathml:mrow>
6301
+ </xsl:template>
6302
+
6303
+ <!-- add space around vertical line -->
6304
+ <xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
6305
+ <xsl:copy>
6306
+ <xsl:apply-templates select="@*" mode="mathml"/>
6307
+ <xsl:if test="not(@lspace)">
6308
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6309
+ </xsl:if>
6310
+ <xsl:if test="not(@rspace)">
6311
+ <xsl:attribute name="rspace">0.4em</xsl:attribute>
6312
+ </xsl:if>
6313
+ <xsl:apply-templates mode="mathml"/>
6314
+ </xsl:copy>
6315
+ </xsl:template>
6316
+
6317
+ <!-- decrease fontsize for 'Circled Times' char -->
6318
+ <xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
6319
+ <xsl:copy>
6320
+ <xsl:apply-templates select="@*" mode="mathml"/>
6321
+ <xsl:if test="not(@fontsize)">
6322
+ <xsl:attribute name="fontsize">55%</xsl:attribute>
6323
+ </xsl:if>
6324
+ <xsl:apply-templates mode="mathml"/>
6325
+ </xsl:copy>
6326
+ </xsl:template>
6327
+
6238
6328
  <!-- Examples:
6239
6329
  <stem type="AsciiMath">x = 1</stem>
6240
6330
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6298,19 +6388,23 @@
6298
6388
  <xsl:apply-templates/>
6299
6389
  </xsl:when>
6300
6390
  <xsl:otherwise>
6301
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6302
- <xsl:choose>
6303
- <xsl:when test="normalize-space(.) = ''">
6304
- <xsl:call-template name="add-zero-spaces-link-java">
6305
- <xsl:with-param name="text" select="$target_text"/>
6306
- </xsl:call-template>
6307
- </xsl:when>
6308
- <xsl:otherwise>
6309
- <!-- output text from <link>text</link> -->
6310
- <xsl:apply-templates/>
6311
- </xsl:otherwise>
6312
- </xsl:choose>
6313
- </fo:basic-link>
6391
+ <xsl:call-template name="insert_basic_link">
6392
+ <xsl:with-param name="element">
6393
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6394
+ <xsl:choose>
6395
+ <xsl:when test="normalize-space(.) = ''">
6396
+ <xsl:call-template name="add-zero-spaces-link-java">
6397
+ <xsl:with-param name="text" select="$target_text"/>
6398
+ </xsl:call-template>
6399
+ </xsl:when>
6400
+ <xsl:otherwise>
6401
+ <!-- output text from <link>text</link> -->
6402
+ <xsl:apply-templates/>
6403
+ </xsl:otherwise>
6404
+ </xsl:choose>
6405
+ </fo:basic-link>
6406
+ </xsl:with-param>
6407
+ </xsl:call-template>
6314
6408
  </xsl:otherwise>
6315
6409
  </xsl:choose>
6316
6410
  </fo:inline>
@@ -6373,12 +6467,16 @@
6373
6467
  </xsl:template>
6374
6468
 
6375
6469
  <xsl:template match="*[local-name() = 'xref']">
6376
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6377
- <xsl:if test="parent::*[local-name() = 'add']">
6378
- <xsl:call-template name="append_add-style"/>
6379
- </xsl:if>
6380
- <xsl:apply-templates/>
6381
- </fo:basic-link>
6470
+ <xsl:call-template name="insert_basic_link">
6471
+ <xsl:with-param name="element">
6472
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6473
+ <xsl:if test="parent::*[local-name() = 'add']">
6474
+ <xsl:call-template name="append_add-style"/>
6475
+ </xsl:if>
6476
+ <xsl:apply-templates/>
6477
+ </fo:basic-link>
6478
+ </xsl:with-param>
6479
+ </xsl:call-template>
6382
6480
  </xsl:template>
6383
6481
 
6384
6482
  <!-- ====== -->
@@ -6769,7 +6867,7 @@
6769
6867
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
6770
6868
  </xsl:when>
6771
6869
  <xsl:when test="not(starts-with(@src, 'data:'))">
6772
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
6870
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
6773
6871
  </xsl:when>
6774
6872
  <xsl:otherwise>
6775
6873
  <xsl:value-of select="@src"/>
@@ -6791,7 +6889,7 @@
6791
6889
  </xsl:when>
6792
6890
  <xsl:when test="not(starts-with(@src, 'data:'))">
6793
6891
  <xsl:variable name="src">
6794
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
6892
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
6795
6893
  </xsl:variable>
6796
6894
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
6797
6895
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -7177,15 +7275,19 @@
7177
7275
  <xsl:param name="dest"/>
7178
7276
  <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
7179
7277
  <fo:block font-size="1pt">
7180
- <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7181
- <fo:inline-container inline-progression-dimension="100%">
7182
- <fo:block-container height="{$height - 1}px" width="100%">
7183
- <!-- DEBUG <xsl:if test="local-name()='polygon'">
7184
- <xsl:attribute name="background-color">magenta</xsl:attribute>
7185
- </xsl:if> -->
7186
- <fo:block> </fo:block></fo:block-container>
7187
- </fo:inline-container>
7188
- </fo:basic-link>
7278
+ <xsl:call-template name="insert_basic_link">
7279
+ <xsl:with-param name="element">
7280
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7281
+ <fo:inline-container inline-progression-dimension="100%">
7282
+ <fo:block-container height="{$height - 1}px" width="100%">
7283
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
7284
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
7285
+ </xsl:if> -->
7286
+ <fo:block> </fo:block></fo:block-container>
7287
+ </fo:inline-container>
7288
+ </fo:basic-link>
7289
+ </xsl:with-param>
7290
+ </xsl:call-template>
7189
7291
  </fo:block>
7190
7292
  </fo:block-container>
7191
7293
  </xsl:template>
@@ -8758,14 +8860,18 @@
8758
8860
  </xsl:template>
8759
8861
 
8760
8862
  <xsl:template match="*[local-name() = 'origin']">
8761
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8762
- <xsl:if test="normalize-space(@citeas) = ''">
8763
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8764
- </xsl:if>
8765
- <fo:inline xsl:use-attribute-sets="origin-style">
8766
- <xsl:apply-templates/>
8767
- </fo:inline>
8768
- </fo:basic-link>
8863
+ <xsl:call-template name="insert_basic_link">
8864
+ <xsl:with-param name="element">
8865
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8866
+ <xsl:if test="normalize-space(@citeas) = ''">
8867
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8868
+ </xsl:if>
8869
+ <fo:inline xsl:use-attribute-sets="origin-style">
8870
+ <xsl:apply-templates/>
8871
+ </fo:inline>
8872
+ </fo:basic-link>
8873
+ </xsl:with-param>
8874
+ </xsl:call-template>
8769
8875
  </xsl:template>
8770
8876
 
8771
8877
  <!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
@@ -8839,9 +8945,13 @@
8839
8945
  <xsl:if test="../*[local-name() = 'author']">
8840
8946
  <xsl:text>, </xsl:text>
8841
8947
  </xsl:if>
8842
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8843
- <xsl:apply-templates/>
8844
- </fo:basic-link>
8948
+ <xsl:call-template name="insert_basic_link">
8949
+ <xsl:with-param name="element">
8950
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8951
+ <xsl:apply-templates/>
8952
+ </fo:basic-link>
8953
+ </xsl:with-param>
8954
+ </xsl:call-template>
8845
8955
  </xsl:template>
8846
8956
 
8847
8957
  <xsl:template match="*[local-name() = 'author']">
@@ -8890,25 +9000,29 @@
8890
9000
  <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
8891
9001
  <xsl:variable name="text" select="normalize-space()"/>
8892
9002
 
8893
- <fo:basic-link fox:alt-text="{@citeas}">
8894
- <xsl:if test="normalize-space(@citeas) = ''">
8895
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
8896
- </xsl:if>
8897
- <xsl:if test="@type = 'inline'">
9003
+ <xsl:call-template name="insert_basic_link">
9004
+ <xsl:with-param name="element">
9005
+ <fo:basic-link fox:alt-text="{@citeas}">
9006
+ <xsl:if test="normalize-space(@citeas) = ''">
9007
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
9008
+ </xsl:if>
9009
+ <xsl:if test="@type = 'inline'">
8898
9010
 
8899
- </xsl:if>
9011
+ </xsl:if>
8900
9012
 
8901
- <xsl:choose>
8902
- <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
8903
- <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
8904
- </xsl:when>
8905
- <xsl:otherwise>
8906
- <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8907
- </xsl:otherwise>
8908
- </xsl:choose>
9013
+ <xsl:choose>
9014
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
9015
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
9016
+ </xsl:when>
9017
+ <xsl:otherwise>
9018
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9019
+ </xsl:otherwise>
9020
+ </xsl:choose>
8909
9021
 
8910
- <xsl:apply-templates/>
8911
- </fo:basic-link>
9022
+ <xsl:apply-templates/>
9023
+ </fo:basic-link>
9024
+ </xsl:with-param>
9025
+ </xsl:call-template>
8912
9026
 
8913
9027
  </fo:inline>
8914
9028
  </xsl:when>
@@ -9148,7 +9262,10 @@
9148
9262
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
9149
9263
 
9150
9264
  <xsl:template name="setULLabel">
9151
- <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9265
+ <xsl:variable name="list_level__">
9266
+ <xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9267
+ </xsl:variable>
9268
+ <xsl:variable name="list_level_" select="number($list_level__)"/>
9152
9269
  <xsl:variable name="list_level">
9153
9270
  <xsl:choose>
9154
9271
  <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
@@ -9281,9 +9398,11 @@
9281
9398
  </fo:block-container>
9282
9399
  </xsl:when>
9283
9400
  <xsl:otherwise>
9284
- <fo:block>
9285
- <xsl:apply-templates select="." mode="list"/>
9286
- </fo:block>
9401
+
9402
+ <fo:block>
9403
+ <xsl:apply-templates select="." mode="list"/>
9404
+ </fo:block>
9405
+
9287
9406
  </xsl:otherwise>
9288
9407
  </xsl:choose>
9289
9408
  </xsl:template>
@@ -9963,24 +10082,32 @@
9963
10082
  <xsl:for-each select="*[local-name() = 'tab']">
9964
10083
  <xsl:variable name="current_id" select="generate-id()"/>
9965
10084
  <fo:table-cell>
9966
- <fo:block>
9967
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9968
- <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
9969
- <xsl:choose>
9970
- <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
9971
- <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
9972
- </xsl:choose>
9973
- </xsl:for-each>
9974
- </fo:basic-link>
10085
+ <fo:block line-height-shift-adjustment="disregard-shifts">
10086
+ <xsl:call-template name="insert_basic_link">
10087
+ <xsl:with-param name="element">
10088
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10089
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
10090
+ <xsl:choose>
10091
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
10092
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
10093
+ </xsl:choose>
10094
+ </xsl:for-each>
10095
+ </fo:basic-link>
10096
+ </xsl:with-param>
10097
+ </xsl:call-template>
9975
10098
  </fo:block>
9976
10099
  </fo:table-cell>
9977
10100
  </xsl:for-each>
9978
10101
  <!-- last column - for page numbers -->
9979
10102
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
9980
10103
  <fo:block>
9981
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9982
- <fo:page-number-citation ref-id="{$target}"/>
9983
- </fo:basic-link>
10104
+ <xsl:call-template name="insert_basic_link">
10105
+ <xsl:with-param name="element">
10106
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10107
+ <fo:page-number-citation ref-id="{$target}"/>
10108
+ </fo:basic-link>
10109
+ </xsl:with-param>
10110
+ </xsl:call-template>
9984
10111
  </fo:block>
9985
10112
  </fo:table-cell>
9986
10113
  </xsl:template>
@@ -10022,6 +10149,27 @@
10022
10149
  <!-- End Table of Contents (ToC) processing -->
10023
10150
  <!-- =================== -->
10024
10151
 
10152
+ <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
10153
+ <xsl:template name="insert_basic_link">
10154
+ <xsl:param name="element"/>
10155
+ <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
10156
+ <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
10157
+ <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
10158
+ <xsl:choose>
10159
+ <xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
10160
+ <xsl:copy-of select="$element_node"/>
10161
+ </xsl:when>
10162
+ <xsl:otherwise>
10163
+ <fo:inline>
10164
+ <xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
10165
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
10166
+ </xsl:for-each>
10167
+ <xsl:copy-of select="$element_node/fo:basic-link/node()"/>
10168
+ </fo:inline>
10169
+ </xsl:otherwise>
10170
+ </xsl:choose>
10171
+ </xsl:template>
10172
+
10025
10173
  <xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
10026
10174
  <xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
10027
10175
  <fo:inline padding-right="5mm"> </fo:inline>
@@ -12,21 +12,6 @@ module IsoDoc
12
12
  Metanorma::Ribose.configuration
13
13
  end
14
14
 
15
- def make_body2(body, docxml)
16
- body.div **{ class: "WordSection2" } do |div2|
17
- boilerplate docxml, div2
18
- preface_block docxml, div2
19
- abstract docxml, div2
20
- foreword docxml, div2
21
- executivesummary docxml, div2
22
- introduction docxml, div2
23
- preface docxml, div2
24
- acknowledgements docxml, div2
25
- div2.p { |p| p << "&#xa0;" } # placeholder
26
- end
27
- section_break(body)
28
- end
29
-
30
15
  include BaseConvert
31
16
  include Init
32
17
  end
@@ -8,7 +8,7 @@ module Metanorma
8
8
  #
9
9
  class Converter < Metanorma::Generic::Converter
10
10
  XML_ROOT_TAG = "rsd-standard".freeze
11
- XML_NAMESPACE = "https://www.metanorma.org/ns/rsd".freeze
11
+ XML_NAMESPACE = "https://www.metanorma.org/ns/ribose".freeze
12
12
 
13
13
  register_for "ribose"
14
14
 
@@ -17,6 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
+ <!-- VERSION v1.2.1 -->
20
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
22
  <include href="reqt.rng"/>
22
23
  <include href="basicdoc.rng">
@@ -1349,15 +1350,19 @@
1349
1350
  </choice>
1350
1351
  </element>
1351
1352
  </define>
1353
+ <define name="Root-Attributes">
1354
+ <attribute name="version"/>
1355
+ <attribute name="schema-version"/>
1356
+ <attribute name="type">
1357
+ <choice>
1358
+ <value>semantic</value>
1359
+ <value>presentation</value>
1360
+ </choice>
1361
+ </attribute>
1362
+ </define>
1352
1363
  <define name="standard-document">
1353
1364
  <element name="standard-document">
1354
- <attribute name="version"/>
1355
- <attribute name="type">
1356
- <choice>
1357
- <value>semantic</value>
1358
- <value>presentation</value>
1359
- </choice>
1360
- </attribute>
1365
+ <ref name="Root-Attributes"/>
1361
1366
  <ref name="bibdata"/>
1362
1367
  <optional>
1363
1368
  <ref name="misccontainer"/>
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/rsd" xmlns="http://relaxng.org/ns/structure/1.0">
2
+ <grammar ns='https://www.metanorma.org/ns/ribose' xmlns="http://relaxng.org/ns/structure/1.0">
3
3
  <!--
4
+ VERSION v1.2.1
4
5
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
6
  we cannot have a new default namespace: we will end up with a grammar with two different
6
7
  namespaces, one for isostandard and one for csand additions. And we do not want that.
@@ -13,13 +14,7 @@
13
14
  </include>
14
15
  <define name="rsd-standard">
15
16
  <element name="rsd-standard">
16
- <attribute name="version"/>
17
- <attribute name="type">
18
- <choice>
19
- <value>semantic</value>
20
- <value>presentation</value>
21
- </choice>
22
- </attribute>
17
+ <ref name="Root-Attributes"/>
23
18
  <ref name="bibdata"/>
24
19
  <zeroOrMore>
25
20
  <ref name="termdocsource"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.2.7".freeze
3
+ VERSION = "2.2.8".freeze
4
4
  end
5
5
  end
data/metanorma.yml CHANGED
@@ -1,10 +1,10 @@
1
1
  metanorma_name: ribose
2
2
  organization_name_short: Ribose
3
3
  organization_name_long: Ribose Asia Limited
4
- document_namespace: https://www.metanorma.org/ns/rsd
4
+ document_namespace: https://www.metanorma.org/ns/ribose
5
5
  xml_root_tag: 'rsd-standard'
6
6
  logo_path: lib/isodoc/ribose/html/logo.png
7
- validate_rng_file: lib/metanorma/ribose/rsd.rng
7
+ validate_rng_file: lib/metanorma/ribose/ribose.rng
8
8
  i18nyaml: lib/isodoc/ribose/i18n-en.yaml
9
9
  htmlcoverpage: lib/isodoc/ribose/html/html_rsd_titlepage.html
10
10
  htmlintropage: lib/isodoc/ribose/html/html_rsd_intro.html
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.7
4
+ version: 2.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-10 00:00:00.000000000 Z
11
+ date: 2023-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -218,7 +218,7 @@ files:
218
218
  - lib/metanorma/ribose/processor.rb
219
219
  - lib/metanorma/ribose/relaton-ribose.rng
220
220
  - lib/metanorma/ribose/reqt.rng
221
- - lib/metanorma/ribose/rsd.rng
221
+ - lib/metanorma/ribose/ribose.rng
222
222
  - lib/metanorma/ribose/version.rb
223
223
  - metanorma-ribose.gemspec
224
224
  - metanorma.yml