metanorma-ogc 2.6.4 → 2.6.6

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: 5dad973d54c8c43e6324a55d4c61433fc7d97d261c63dfa4a465507b173c7eba
4
- data.tar.gz: d53e4e00b7aac26b7d22463e10b098f95bfb25c04eecf7a2121fe09a7b18ebfc
3
+ metadata.gz: 711f1bee1292fc9c5d009c8a74752c3e791b75e222b13c104a34b7520d85d339
4
+ data.tar.gz: 8c29744eeee97ee284acc02f838baeb83f4a22b0ea86e5b5e1a5ae1dccdcbfd0
5
5
  SHA512:
6
- metadata.gz: b47783f85fedcb9aa7667958c9f06b51c743c3842c6b4ec548ca17b9e6d0b47ac238dd17d72543900e3498e86fc90c95f1e1125957faebe417aee5ab391870d1
7
- data.tar.gz: 1f00fa77d29a37118ea19e419d0e3865fcca1a7f3ecf3de937bd545d921e0e05fc76764598e5b1ffb6a7316de3de8b75b419130942b070f35cf1d30698362ef3
6
+ metadata.gz: bc0c33bdbbcf1548b50e40a6e2378be7e00a0de0d82eedf34352c1e25f84ce42bdc7cee19d675d35054213abfb5fe77046546d5094b72794d8349a3ab8b57ca1
7
+ data.tar.gz: 19f16e0e04b5964a188f38db9c78d0f5b31a0ec149d4bcef19b2cc5b7912371713673dd24584c716926e65f1ca10e669bcf6e9e601e1535868189fe88e44b79b
@@ -36,8 +36,8 @@ module IsoDoc
36
36
  h2 = term.at("./preceding-sibling::*[@class = 'TermNum'][1]")
37
37
  term["class"] = h2["class"]
38
38
  term["id"] = h2["id"]
39
- term.children.first.previous = " "
40
- term.children.first.previous = h2.remove.children
39
+ term.add_first_child " "
40
+ term.add_first_child h2.remove.children
41
41
  end
42
42
 
43
43
  def term_cleanup_merge_admitted(term)
@@ -143,7 +143,6 @@ module IsoDoc
143
143
  def figure_parse1(node, out)
144
144
  out.div **figure_attrs(node) do |div|
145
145
  node.children.each do |n|
146
- figure_key(out) if n.name == "dl"
147
146
  parse(n, div) unless n.name == "name"
148
147
  end
149
148
  end
@@ -170,7 +169,7 @@ module IsoDoc
170
169
  encoding: "UTF-8")
171
170
  "#{a[0]}#{scripts}#{a[1]}"
172
171
  end
173
-
172
+
174
173
  # to pass on to imported _coverpage.scss
175
174
  def scss_fontheader(is_html_css)
176
175
  super + <<~SCSS
@@ -32,15 +32,6 @@ module IsoDoc
32
32
  def submittingorgs_path
33
33
  "//bibdata/contributor[role/@type = 'author']/organization/name"
34
34
  end
35
-
36
- def ogc_draft_ref?(ref)
37
- return unless ref.at(ns("./docidentifier[@type = 'OGC']"))
38
-
39
- status = ref.at(ns("./status/stage"))&.text or return
40
- return if %w(approved published deprecated retired).include? status
41
-
42
- true
43
- end
44
35
  end
45
36
  end
46
37
  end
@@ -1241,6 +1241,7 @@
1241
1241
  <xsl:attribute name="line-height">125%</xsl:attribute>
1242
1242
  </xsl:if>
1243
1243
  <xsl:call-template name="setId"/>
1244
+ <xsl:call-template name="addReviewHelper"/>
1244
1245
  <xsl:apply-templates/>
1245
1246
  </fo:block>
1246
1247
  </xsl:template>
@@ -5402,10 +5403,14 @@
5402
5403
  <xsl:variable name="fn_styles">
5403
5404
  <xsl:choose>
5404
5405
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
5405
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
5406
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
5407
+
5408
+ </fn_styles>
5406
5409
  </xsl:when>
5407
5410
  <xsl:otherwise>
5408
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
5411
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
5412
+
5413
+ </fn_styles>
5409
5414
  </xsl:otherwise>
5410
5415
  </xsl:choose>
5411
5416
  </xsl:variable>
@@ -5544,6 +5549,11 @@
5544
5549
 
5545
5550
  <xsl:value-of select="@reference"/>
5546
5551
 
5552
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
5553
+ <!-- <xsl:if test="$namespace = 'itu'">
5554
+ <xsl:text>)</xsl:text>
5555
+ </xsl:if> -->
5556
+
5547
5557
  </fo:inline>
5548
5558
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
5549
5559
  <xsl:copy-of select="./node()"/>
@@ -5553,7 +5563,7 @@
5553
5563
 
5554
5564
  </xsl:if>
5555
5565
  </xsl:for-each>
5556
- </xsl:template>
5566
+ </xsl:template> <!-- table_fn_display -->
5557
5567
 
5558
5568
  <xsl:template name="create_fn">
5559
5569
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -5587,8 +5597,10 @@
5587
5597
  <!-- EMD table's footnotes rendering -->
5588
5598
  <!-- ============================ -->
5589
5599
 
5600
+ <!-- ============================ -->
5590
5601
  <!-- figure's footnotes rendering -->
5591
- <xsl:template name="fn_display_figure">
5602
+ <!-- ============================ -->
5603
+ <xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
5592
5604
 
5593
5605
  <!-- current figure id -->
5594
5606
  <xsl:variable name="figure_id_">
@@ -5701,9 +5713,28 @@
5701
5713
 
5702
5714
  </fo:block>
5703
5715
  </xsl:if>
5704
-
5705
5716
  </xsl:template> <!-- fn_display_figure -->
5706
5717
 
5718
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
5719
+ <!-- figure's footnote label -->
5720
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
5721
+ <xsl:variable name="key_iso">
5722
+
5723
+ </xsl:variable>
5724
+ <xsl:if test="normalize-space($key_iso) = 'true'">
5725
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
5726
+
5727
+ </xsl:if>
5728
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
5729
+ <!-- <xsl:value-of select="@reference"/> -->
5730
+ <xsl:apply-templates/>
5731
+ </fo:inline>
5732
+ </xsl:template>
5733
+
5734
+ <!-- ============================ -->
5735
+ <!-- END: figure's footnotes rendering -->
5736
+ <!-- ============================ -->
5737
+
5707
5738
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
5708
5739
  <xsl:template match="*[local-name()='fn']">
5709
5740
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -5724,6 +5755,10 @@
5724
5755
 
5725
5756
  <xsl:value-of select="@reference"/>
5726
5757
 
5758
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
5759
+ <!-- <xsl:if test="$namespace = 'jis'">
5760
+ <fo:inline font-weight="normal">)</fo:inline>
5761
+ </xsl:if> -->
5727
5762
  </fo:basic-link>
5728
5763
  </fo:inline>
5729
5764
  </xsl:template>
@@ -5850,17 +5885,22 @@
5850
5885
  </fo:block>
5851
5886
  </xsl:when> <!-- END: a few components -->
5852
5887
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
5853
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
5888
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
5889
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
5854
5890
 
5855
- <xsl:call-template name="refine_figure_key_style"/>
5891
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
5856
5892
 
5857
- <xsl:variable name="title-key">
5858
- <xsl:call-template name="getLocalizedString">
5859
- <xsl:with-param name="key">key</xsl:with-param>
5860
- </xsl:call-template>
5861
- </xsl:variable>
5862
- <xsl:value-of select="$title-key"/>
5863
- </fo:block>
5893
+ <xsl:call-template name="refine_figure_key_style"/>
5894
+
5895
+ <xsl:variable name="title-key">
5896
+ <xsl:call-template name="getLocalizedString">
5897
+ <xsl:with-param name="key">key</xsl:with-param>
5898
+ </xsl:call-template>
5899
+ </xsl:variable>
5900
+ <xsl:value-of select="$title-key"/>
5901
+ </fo:block>
5902
+
5903
+ </xsl:if>
5864
5904
  </xsl:when> <!-- END: definition list in a figure -->
5865
5905
  </xsl:choose>
5866
5906
 
@@ -6046,6 +6086,14 @@
6046
6086
 
6047
6087
  </xsl:template> <!-- END: dl -->
6048
6088
 
6089
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
6090
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
6091
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
6092
+ <xsl:call-template name="refine_figure_key_style"/>
6093
+ <xsl:apply-templates/>
6094
+ </fo:block>
6095
+ </xsl:template>
6096
+
6049
6097
  <xsl:template name="refine_dl_formula_where_style">
6050
6098
 
6051
6099
  </xsl:template> <!-- refine_dl_formula_where_style -->
@@ -8088,6 +8136,39 @@
8088
8136
  </xsl:copy>
8089
8137
  </xsl:template>
8090
8138
 
8139
+ <xsl:template match="@*|node()" mode="mathml_linebreak">
8140
+ <xsl:copy>
8141
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
8142
+ </xsl:copy>
8143
+ </xsl:template>
8144
+
8145
+ <!-- split math into two math -->
8146
+ <xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
8147
+ <xsl:variable name="math_elements_tree_">
8148
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
8149
+ <element pos="{position()}">
8150
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
8151
+ <xsl:value-of select="name()"/>
8152
+ </element>
8153
+ </xsl:for-each>
8154
+ </xsl:variable>
8155
+
8156
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
8157
+
8158
+ <xsl:call-template name="insertClosingElements">
8159
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
8160
+ </xsl:call-template>
8161
+
8162
+ <xsl:element name="br" namespace="{$namespace_full}"/>
8163
+
8164
+ <xsl:call-template name="insertOpeningElements">
8165
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
8166
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
8167
+ <xsl:with-param name="add_continue">false</xsl:with-param>
8168
+ </xsl:call-template>
8169
+
8170
+ </xsl:template>
8171
+
8091
8172
  <!-- Examples:
8092
8173
  <stem type="AsciiMath">x = 1</stem>
8093
8174
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -8293,6 +8374,7 @@
8293
8374
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
8294
8375
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8295
8376
  </xsl:if>
8377
+
8296
8378
  <xsl:if test="parent::*[local-name() = 'add']">
8297
8379
  <xsl:call-template name="append_add-style"/>
8298
8380
  </xsl:if>
@@ -8342,9 +8424,11 @@
8342
8424
  </xsl:template>
8343
8425
 
8344
8426
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
8427
+ <!-- https://github.com/metanorma/isodoc/issues/607
8345
8428
  <xsl:if test="normalize-space() != ''">
8346
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
8347
- </xsl:if>
8429
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
8430
+ </xsl:if> -->
8431
+ <xsl:apply-templates/>
8348
8432
  </xsl:template>
8349
8433
 
8350
8434
  <!-- stem inside formula with name (with formula's number) -->
@@ -8401,44 +8485,44 @@
8401
8485
 
8402
8486
  <xsl:template match="*[local-name() = 'note']" name="note">
8403
8487
 
8404
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8488
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8405
8489
 
8406
- <xsl:call-template name="setBlockSpanAll"/>
8490
+ <xsl:call-template name="setBlockSpanAll"/>
8407
8491
 
8408
- <xsl:call-template name="refine_note-style"/>
8492
+ <xsl:call-template name="refine_note-style"/>
8409
8493
 
8410
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8494
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8411
8495
 
8412
- <fo:block>
8496
+ <fo:block>
8413
8497
 
8414
- <xsl:call-template name="refine_note_block_style"/>
8498
+ <xsl:call-template name="refine_note_block_style"/>
8415
8499
 
8416
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8500
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8417
8501
 
8418
- <xsl:call-template name="refine_note-name-style"/>
8502
+ <xsl:call-template name="refine_note-name-style"/>
8419
8503
 
8420
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8421
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8422
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8423
- <xsl:call-template name="append_add-style"/>
8424
- </xsl:if>
8504
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8505
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8506
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8507
+ <xsl:call-template name="append_add-style"/>
8508
+ </xsl:if>
8425
8509
 
8426
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8427
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8428
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8429
- <xsl:with-param name="skip">false</xsl:with-param>
8430
- </xsl:apply-templates>
8431
- </xsl:if>
8510
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8511
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8512
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8513
+ <xsl:with-param name="skip">false</xsl:with-param>
8514
+ </xsl:apply-templates>
8515
+ </xsl:if>
8432
8516
 
8433
- <xsl:apply-templates select="*[local-name() = 'name']"/>
8517
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8434
8518
 
8435
- </fo:inline>
8519
+ </fo:inline>
8436
8520
 
8437
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8438
- </fo:block>
8521
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8522
+ </fo:block>
8439
8523
 
8440
- </fo:block-container>
8441
- </fo:block-container>
8524
+ </fo:block-container>
8525
+ </fo:block-container>
8442
8526
 
8443
8527
  </xsl:template>
8444
8528
 
@@ -8500,6 +8584,17 @@
8500
8584
  </xsl:when>
8501
8585
  <xsl:otherwise>
8502
8586
 
8587
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
8588
+ <!-- <xsl:if test="$namespace = 'ieee'">
8589
+ <xsl:text>—</xsl:text> em dash &#x2014;
8590
+ </xsl:if> -->
8591
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
8592
+ <xsl:text>:</xsl:text>
8593
+ </xsl:if> -->
8594
+
8595
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
8596
+ <xsl:text> – </xsl:text> en dash &#x2013;
8597
+ </xsl:if> -->
8503
8598
  </xsl:otherwise>
8504
8599
  </xsl:choose>
8505
8600
  </xsl:variable>
@@ -8518,8 +8613,16 @@
8518
8613
  </xsl:when>
8519
8614
  <xsl:otherwise>
8520
8615
 
8616
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
8617
+ <!-- <xsl:if test="$namespace = 'ieee'">
8618
+ <xsl:text>—</xsl:text> em dash &#x2014;
8619
+ </xsl:if> -->
8620
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'jcgm'">
8521
8621
  <xsl:text>:</xsl:text>
8522
-
8622
+ </xsl:if> -->
8623
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
8624
+ <xsl:text> – </xsl:text> en dash &#x2013;
8625
+ </xsl:if> -->
8523
8626
  </xsl:otherwise>
8524
8627
  </xsl:choose>
8525
8628
  </xsl:variable>
@@ -10740,7 +10843,7 @@
10740
10843
  <xsl:if test="normalize-space() != ''">
10741
10844
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
10742
10845
  <xsl:call-template name="refine_termexample-name-style"/>
10743
- <xsl:apply-templates/>
10846
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
10744
10847
  </fo:inline>
10745
10848
  </xsl:if>
10746
10849
  </xsl:template>
@@ -10895,13 +10998,14 @@
10895
10998
  </xsl:when>
10896
10999
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
10897
11000
  <fo:block xsl:use-attribute-sets="example-name-style">
11001
+
10898
11002
  <xsl:apply-templates/>
10899
11003
  </fo:block>
10900
11004
  </xsl:when>
10901
11005
  <xsl:otherwise>
10902
11006
  <fo:inline xsl:use-attribute-sets="example-name-style">
10903
11007
  <xsl:call-template name="refine_example-name-style"/>
10904
- <xsl:apply-templates/>:
11008
+ <xsl:apply-templates/>: <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
10905
11009
  </fo:inline>
10906
11010
  </xsl:otherwise>
10907
11011
  </xsl:choose>
@@ -10910,6 +11014,7 @@
10910
11014
 
10911
11015
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
10912
11016
  <fo:inline xsl:use-attribute-sets="example-name-style">
11017
+
10913
11018
  <xsl:apply-templates/>
10914
11019
  </fo:inline>
10915
11020
  </xsl:template>
@@ -11082,15 +11187,17 @@
11082
11187
 
11083
11188
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11084
11189
  <fo:block role="BlockQuote">
11085
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
11190
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source') and not(local-name() = 'attribution')]"/> <!-- process all nested nodes, except author and source -->
11086
11191
  </fo:block>
11087
11192
  </fo:block-container>
11088
11193
  </fo:block-container>
11089
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
11194
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
11090
11195
  <fo:block xsl:use-attribute-sets="quote-source-style">
11091
11196
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
11092
11197
  <xsl:apply-templates select="*[local-name() = 'author']"/>
11093
11198
  <xsl:apply-templates select="*[local-name() = 'source']"/>
11199
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
11200
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
11094
11201
  </fo:block>
11095
11202
  </xsl:if>
11096
11203
 
@@ -11112,9 +11219,13 @@
11112
11219
  </xsl:template>
11113
11220
 
11114
11221
  <xsl:template match="*[local-name() = 'author']">
11115
- <xsl:text>— </xsl:text>
11222
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
11223
+ <xsl:text>— </xsl:text>
11224
+ </xsl:if>
11116
11225
  <xsl:apply-templates/>
11117
11226
  </xsl:template>
11227
+
11228
+ <xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
11118
11229
  <!-- ====== -->
11119
11230
  <!-- ====== -->
11120
11231
 
@@ -11279,20 +11390,26 @@
11279
11390
 
11280
11391
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
11281
11392
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
11393
+
11282
11394
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
11283
11395
  </fo:block>
11284
11396
  </xsl:if>
11285
11397
 
11286
11398
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
11287
11399
  <xsl:call-template name="setStyle_preferred"/>
11400
+
11288
11401
  <xsl:apply-templates/>
11289
11402
  </fo:block>
11290
11403
  </fo:block>
11291
11404
  </xsl:template>
11292
11405
 
11293
11406
  <xsl:template match="*[local-name() = 'domain']">
11407
+ <!-- https://github.com/metanorma/isodoc/issues/607
11294
11408
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
11295
- <xsl:text> </xsl:text>
11409
+ <xsl:text> </xsl:text> -->
11410
+ <xsl:if test="not(@hidden = 'true')">
11411
+ <xsl:apply-templates/>
11412
+ </xsl:if>
11296
11413
  </xsl:template>
11297
11414
 
11298
11415
  <xsl:template match="*[local-name() = 'admitted']">
@@ -11340,6 +11457,29 @@
11340
11457
  <!-- END definition -->
11341
11458
  <!-- ========== -->
11342
11459
 
11460
+ <xsl:variable name="reviews_">
11461
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
11462
+ <xsl:copy>
11463
+ <xsl:copy-of select="@from"/>
11464
+ <xsl:copy-of select="@id"/>
11465
+ </xsl:copy>
11466
+ </xsl:for-each>
11467
+ </xsl:variable>
11468
+ <xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
11469
+
11470
+ <xsl:template name="addReviewHelper">
11471
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
11472
+ <xsl:variable name="curr_id" select="@id"/>
11473
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
11474
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
11475
+ <fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11476
+ </xsl:if>
11477
+ <!-- <fo:block>
11478
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
11479
+ <xsl:copy-of select="$reviews"/>
11480
+ </fo:block> -->
11481
+ </xsl:template>
11482
+
11343
11483
  <!-- main sections -->
11344
11484
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
11345
11485
 
@@ -11348,6 +11488,8 @@
11348
11488
 
11349
11489
  <xsl:call-template name="sections_element_style"/>
11350
11490
 
11491
+ <xsl:call-template name="addReviewHelper"/>
11492
+
11351
11493
  <xsl:apply-templates/>
11352
11494
  </fo:block>
11353
11495
 
@@ -11388,6 +11530,7 @@
11388
11530
 
11389
11531
  <fo:block>
11390
11532
  <xsl:call-template name="setId"/>
11533
+ <xsl:call-template name="addReviewHelper"/>
11391
11534
  <xsl:apply-templates/>
11392
11535
  </fo:block>
11393
11536
  </xsl:template>
@@ -11424,6 +11567,8 @@
11424
11567
 
11425
11568
  <xsl:call-template name="refine_clause_style"/>
11426
11569
 
11570
+ <xsl:call-template name="addReviewHelper"/>
11571
+
11427
11572
  <xsl:apply-templates/>
11428
11573
  </fo:block>
11429
11574
  </xsl:template>
@@ -11476,6 +11621,23 @@
11476
11621
 
11477
11622
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
11478
11623
 
11624
+ <xsl:if test="1 = 1">
11625
+ <xsl:choose>
11626
+ <!-- if there isn't the attribute '@from', then -->
11627
+ <xsl:when test="$id_from = ''">
11628
+ <fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11629
+ </xsl:when>
11630
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
11631
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
11632
+ <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11633
+ </xsl:when>
11634
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
11635
+ <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11636
+ </xsl:when>
11637
+ </xsl:choose>
11638
+ </xsl:if>
11639
+
11640
+ <xsl:if test="1 = 2">
11479
11641
  <xsl:choose>
11480
11642
  <!-- if there isn't the attribute '@from', then -->
11481
11643
  <xsl:when test="$id_from = ''">
@@ -11489,6 +11651,7 @@
11489
11651
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
11490
11652
  </xsl:when>
11491
11653
  </xsl:choose>
11654
+ </xsl:if>
11492
11655
 
11493
11656
  </xsl:template>
11494
11657
 
@@ -12854,7 +13017,7 @@
12854
13017
  <!-- remove preprocess-xslt -->
12855
13018
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
12856
13019
 
12857
- <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
13020
+ <xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
12858
13021
  <xsl:copy-of select="."/>
12859
13022
  </xsl:template>
12860
13023
 
@@ -12920,6 +13083,22 @@
12920
13083
  </xsl:choose>
12921
13084
  </xsl:template>
12922
13085
 
13086
+ <xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
13087
+ <xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
13088
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
13089
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
13090
+ <xsl:apply-templates mode="update_xml_step1"/>
13091
+ </xsl:if>
13092
+ </xsl:template>
13093
+
13094
+ <!-- split math by element with @linebreak into maths -->
13095
+ <xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
13096
+ <xsl:variable name="maths">
13097
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
13098
+ </xsl:variable>
13099
+ <xsl:copy-of select="$maths"/>
13100
+ </xsl:template>
13101
+
12923
13102
  <!-- =========================================================================== -->
12924
13103
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
12925
13104
  <!-- =========================================================================== -->
@@ -13023,6 +13202,8 @@
13023
13202
 
13024
13203
  <xsl:template name="insertOpeningElements">
13025
13204
  <xsl:param name="tree"/>
13205
+ <xsl:param name="xmlns"/>
13206
+ <xsl:param name="add_continue">true</xsl:param>
13026
13207
  <xsl:for-each select="$tree//element">
13027
13208
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
13028
13209
  <xsl:value-of select="."/>
@@ -13033,7 +13214,8 @@
13033
13214
  <xsl:value-of select="."/>
13034
13215
  <xsl:text>"</xsl:text>
13035
13216
  </xsl:for-each>
13036
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
13217
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
13218
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
13037
13219
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
13038
13220
  <xsl:if test="$debug = 'true'">
13039
13221
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -14243,9 +14425,10 @@
14243
14425
  <xsl:template name="insertBackgroundPageImage">
14244
14426
  <xsl:param name="number">1</xsl:param>
14245
14427
  <xsl:param name="name">coverpage-image</xsl:param>
14428
+ <xsl:param name="suffix"/>
14246
14429
  <xsl:variable name="num" select="number($number)"/>
14247
14430
  <!-- background image -->
14248
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
14431
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
14249
14432
  <fo:block>
14250
14433
  <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
14251
14434
  <xsl:choose>
@@ -14311,16 +14494,29 @@
14311
14494
 
14312
14495
  <!-- END: insert cover page image -->
14313
14496
 
14497
+ <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
14314
14498
  <xsl:template name="insertVerticalChar">
14315
14499
  <xsl:param name="str"/>
14500
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
14501
+ <xsl:param name="reference-orientation">90</xsl:param>
14316
14502
  <xsl:if test="string-length($str) &gt; 0">
14317
- <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14503
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14504
+ <xsl:if test="normalize-space($writing-mode) != ''">
14505
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
14506
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
14507
+ </xsl:if>
14508
+ <xsl:variable name="char" select="substring($str,1,1)"/>
14509
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
14510
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
14511
+ </xsl:if>
14318
14512
  <fo:block-container width="1em">
14319
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
14513
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
14320
14514
  </fo:block-container>
14321
14515
  </fo:inline-container>
14322
14516
  <xsl:call-template name="insertVerticalChar">
14323
14517
  <xsl:with-param name="str" select="substring($str, 2)"/>
14518
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
14519
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
14324
14520
  </xsl:call-template>
14325
14521
  </xsl:if>
14326
14522
  </xsl:template>