metanorma-ieee 1.3.3 → 1.3.4

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: 63f97a664f710c4f0bd501b3c896983946bebac162e865e6a32fe9b9bc53122e
4
- data.tar.gz: 10c5f1c367b4d585cf1952ea6dac2bb20c28d4be26d3b75002f759c103d0bb28
3
+ metadata.gz: 64f37a09bcd0a24e2a8d4bef90b31984a8b09ff5df27dc62e56010f72a448e1d
4
+ data.tar.gz: badb4688f8611ab3f17df678faad8484a9778d83adc6c32bd143bb5e7d859e54
5
5
  SHA512:
6
- metadata.gz: a4b271e84518e5b94e18ec56f15593a68cb34dbf28747ccd711122ee4f0d9b30c8f3d4e8ff2d004c3307265a07a435580bd53995486a2e928664ed3b2753847d
7
- data.tar.gz: ee4f212122dfa2a7100b9cb24b07e99056285908c173834ab1b9a9b0c87c404967123a5607ec0f0e7a19d67fc5647f8c6230e7b20849f45e70b615af4ca0d7a5
6
+ metadata.gz: d0ee1558421bdc365a7d0dd0e049a70e7c6140e24ffda7809f6e92c2cfbc9693830392a11c24c35fe7d6f3546f1cd77df0ea1f79662b262e77ef49f3be887565
7
+ data.tar.gz: 46cbd320df62354dade79dbdc7ee2360a2abef040696ebfcc311d510898637655e4973e87b219ce08b0ea55b235d76d6e4f9f24ebd258259a87488361444047a
@@ -34,21 +34,11 @@ module IsoDoc
34
34
  super.merge(type: node["type"])
35
35
  end
36
36
 
37
- def note_delim
38
- "—"
39
- end
40
-
41
- def omit_docid_prefix(prefix)
42
- prefix == "DOI" and return true
43
- super
44
- end
45
-
46
37
  def note_p_parse(node, div)
47
38
  name = node&.at(ns("./name"))&.remove
48
39
  div.p do |p|
49
40
  name and p.span class: "note_label" do |s|
50
41
  name.children.each { |n| parse(n, s) }
51
- s << note_delim
52
42
  end
53
43
  node.first_element_child.children.each { |n| parse(n, p) }
54
44
  end
@@ -60,29 +50,14 @@ module IsoDoc
60
50
  name and div.p do |p|
61
51
  p.span class: "note_label" do |s|
62
52
  name.children.each { |n| parse(n, s) }
63
- s << note_delim
64
53
  end
65
54
  end
66
55
  node.children.each { |n| parse(n, div) }
67
56
  end
68
57
 
69
- def termnote_delim
70
- "&#x2014;"
71
- end
72
-
73
- def bracket_if_num(num)
74
- return nil if num.nil?
75
-
76
- num = num.text.sub(/^\[/, "").sub(/\]$/, "")
77
- return "[#{num}]" if /^B?\d+$/.match?(num)
78
-
79
- num
80
- end
81
-
82
58
  def example_label(_node, div, name)
83
59
  return if name.nil?
84
60
 
85
- name << ":"
86
61
  div.p class: "example-title" do |p|
87
62
  name.children.each { |n| parse(n, p) }
88
63
  end
@@ -1649,6 +1649,7 @@
1649
1649
  <xsl:template match="ieee:abstract">
1650
1650
  <fo:block>
1651
1651
  <xsl:call-template name="setId"/>
1652
+ <xsl:call-template name="addReviewHelper"/>
1652
1653
  <xsl:apply-templates/>
1653
1654
  </fo:block>
1654
1655
  </xsl:template>
@@ -2281,6 +2282,7 @@
2281
2282
  <xsl:template match="*[local-name() = 'introduction'] | *[local-name() = 'foreword'] | *[local-name() = 'acknowledgements']">
2282
2283
  <fo:block>
2283
2284
  <xsl:call-template name="setId"/>
2285
+ <xsl:call-template name="addReviewHelper"/>
2284
2286
  <xsl:apply-templates/>
2285
2287
  </fo:block>
2286
2288
  </xsl:template>
@@ -7380,6 +7382,11 @@
7380
7382
 
7381
7383
  <xsl:value-of select="@reference"/>
7382
7384
 
7385
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
7386
+ <!-- <xsl:if test="$namespace = 'itu'">
7387
+ <xsl:text>)</xsl:text>
7388
+ </xsl:if> -->
7389
+
7383
7390
  </fo:inline>
7384
7391
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
7385
7392
  <xsl:copy-of select="./node()"/>
@@ -7389,7 +7396,7 @@
7389
7396
 
7390
7397
  </xsl:if>
7391
7398
  </xsl:for-each>
7392
- </xsl:template>
7399
+ </xsl:template> <!-- table_fn_display -->
7393
7400
 
7394
7401
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="create_fn">
7395
7402
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -7417,8 +7424,10 @@
7417
7424
  <!-- EMD table's footnotes rendering -->
7418
7425
  <!-- ============================ -->
7419
7426
 
7427
+ <!-- ============================ -->
7420
7428
  <!-- figure's footnotes rendering -->
7421
- <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="fn_display_figure">
7429
+ <!-- ============================ -->
7430
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="fn_display_figure"> <!-- figure_fn_display -->
7422
7431
 
7423
7432
  <!-- current figure id -->
7424
7433
  <xsl:variable name="figure_id_">
@@ -7531,9 +7540,28 @@
7531
7540
 
7532
7541
  </fo:block>
7533
7542
  </xsl:if>
7534
-
7535
7543
  </xsl:template> <!-- fn_display_figure -->
7536
7544
 
7545
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
7546
+ <!-- figure's footnote label -->
7547
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" 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">
7548
+ <xsl:variable name="key_iso">
7549
+
7550
+ </xsl:variable>
7551
+ <xsl:if test="normalize-space($key_iso) = 'true'">
7552
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
7553
+
7554
+ </xsl:if>
7555
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
7556
+ <!-- <xsl:value-of select="@reference"/> -->
7557
+ <xsl:apply-templates/>
7558
+ </fo:inline>
7559
+ </xsl:template>
7560
+
7561
+ <!-- ============================ -->
7562
+ <!-- END: figure's footnotes rendering -->
7563
+ <!-- ============================ -->
7564
+
7537
7565
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
7538
7566
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='fn']">
7539
7567
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -7549,6 +7577,10 @@
7549
7577
 
7550
7578
  <xsl:value-of select="@reference"/>
7551
7579
 
7580
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
7581
+ <!-- <xsl:if test="$namespace = 'jis'">
7582
+ <fo:inline font-weight="normal">)</fo:inline>
7583
+ </xsl:if> -->
7552
7584
  </fo:basic-link>
7553
7585
  </fo:inline>
7554
7586
  </xsl:template>
@@ -7675,17 +7707,22 @@
7675
7707
  </fo:block>
7676
7708
  </xsl:when> <!-- END: a few components -->
7677
7709
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
7678
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
7710
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
7711
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
7679
7712
 
7680
- <xsl:call-template name="refine_figure_key_style"/>
7713
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
7681
7714
 
7682
- <xsl:variable name="title-key">
7683
- <xsl:call-template name="getLocalizedString">
7684
- <xsl:with-param name="key">key</xsl:with-param>
7685
- </xsl:call-template>
7686
- </xsl:variable>
7687
- <xsl:value-of select="$title-key"/>
7688
- </fo:block>
7715
+ <xsl:call-template name="refine_figure_key_style"/>
7716
+
7717
+ <xsl:variable name="title-key">
7718
+ <xsl:call-template name="getLocalizedString">
7719
+ <xsl:with-param name="key">key</xsl:with-param>
7720
+ </xsl:call-template>
7721
+ </xsl:variable>
7722
+ <xsl:value-of select="$title-key"/>
7723
+ </fo:block>
7724
+
7725
+ </xsl:if>
7689
7726
  </xsl:when> <!-- END: definition list in a figure -->
7690
7727
  </xsl:choose>
7691
7728
 
@@ -7871,6 +7908,14 @@
7871
7908
 
7872
7909
  </xsl:template> <!-- END: dl -->
7873
7910
 
7911
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
7912
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
7913
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
7914
+ <xsl:call-template name="refine_figure_key_style"/>
7915
+ <xsl:apply-templates/>
7916
+ </fo:block>
7917
+ </xsl:template>
7918
+
7874
7919
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="refine_dl_formula_where_style">
7875
7920
 
7876
7921
  </xsl:template> <!-- refine_dl_formula_where_style -->
@@ -9903,6 +9948,39 @@
9903
9948
  </xsl:copy>
9904
9949
  </xsl:template>
9905
9950
 
9951
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="mathml_linebreak">
9952
+ <xsl:copy>
9953
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
9954
+ </xsl:copy>
9955
+ </xsl:template>
9956
+
9957
+ <!-- split math into two math -->
9958
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
9959
+ <xsl:variable name="math_elements_tree_">
9960
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
9961
+ <element pos="{position()}">
9962
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
9963
+ <xsl:value-of select="name()"/>
9964
+ </element>
9965
+ </xsl:for-each>
9966
+ </xsl:variable>
9967
+
9968
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
9969
+
9970
+ <xsl:call-template name="insertClosingElements">
9971
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
9972
+ </xsl:call-template>
9973
+
9974
+ <xsl:element name="br" namespace="{$namespace_full}"/>
9975
+
9976
+ <xsl:call-template name="insertOpeningElements">
9977
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
9978
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
9979
+ <xsl:with-param name="add_continue">false</xsl:with-param>
9980
+ </xsl:call-template>
9981
+
9982
+ </xsl:template>
9983
+
9906
9984
  <!-- Examples:
9907
9985
  <stem type="AsciiMath">x = 1</stem>
9908
9986
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -10154,9 +10232,11 @@
10154
10232
  </xsl:template>
10155
10233
 
10156
10234
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
10235
+ <!-- https://github.com/metanorma/isodoc/issues/607
10157
10236
  <xsl:if test="normalize-space() != ''">
10158
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
10159
- </xsl:if>
10237
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
10238
+ </xsl:if> -->
10239
+ <xsl:apply-templates/>
10160
10240
  </xsl:template>
10161
10241
 
10162
10242
  <!-- stem inside formula with name (with formula's number) -->
@@ -10312,8 +10392,17 @@
10312
10392
  </xsl:when>
10313
10393
  <xsl:otherwise>
10314
10394
 
10315
- <xsl:text>—</xsl:text>
10395
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
10396
+ <!-- <xsl:if test="$namespace = 'ieee'">
10397
+ <xsl:text>—</xsl:text> em dash &#x2014;
10398
+ </xsl:if> -->
10399
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
10400
+ <xsl:text>:</xsl:text>
10401
+ </xsl:if> -->
10316
10402
 
10403
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
10404
+ <xsl:text> – </xsl:text> en dash &#x2013;
10405
+ </xsl:if> -->
10317
10406
  </xsl:otherwise>
10318
10407
  </xsl:choose>
10319
10408
  </xsl:variable>
@@ -10332,8 +10421,16 @@
10332
10421
  </xsl:when>
10333
10422
  <xsl:otherwise>
10334
10423
 
10335
- <xsl:text>—</xsl:text>
10336
-
10424
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
10425
+ <!-- <xsl:if test="$namespace = 'ieee'">
10426
+ <xsl:text>—</xsl:text> em dash &#x2014;
10427
+ </xsl:if> -->
10428
+ <!-- <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'">
10429
+ <xsl:text>:</xsl:text>
10430
+ </xsl:if> -->
10431
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
10432
+ <xsl:text> – </xsl:text> en dash &#x2013;
10433
+ </xsl:if> -->
10337
10434
  </xsl:otherwise>
10338
10435
  </xsl:choose>
10339
10436
  </xsl:variable>
@@ -12499,7 +12596,7 @@
12499
12596
  <xsl:if test="normalize-space() != ''">
12500
12597
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
12501
12598
  <xsl:call-template name="refine_termexample-name-style"/>
12502
- <xsl:apply-templates/>:
12599
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
12503
12600
  </fo:inline>
12504
12601
  </xsl:if>
12505
12602
  </xsl:template>
@@ -12665,7 +12762,7 @@
12665
12762
  <xsl:otherwise>
12666
12763
  <fo:inline xsl:use-attribute-sets="example-name-style">
12667
12764
  <xsl:call-template name="refine_example-name-style"/>
12668
- <xsl:apply-templates/>:
12765
+ <xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
12669
12766
  </fo:inline>
12670
12767
  </xsl:otherwise>
12671
12768
  </xsl:choose>
@@ -12847,15 +12944,17 @@
12847
12944
 
12848
12945
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
12849
12946
  <fo:block role="BlockQuote">
12850
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
12947
+ <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 -->
12851
12948
  </fo:block>
12852
12949
  </fo:block-container>
12853
12950
  </fo:block-container>
12854
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
12951
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
12855
12952
  <fo:block xsl:use-attribute-sets="quote-source-style">
12856
12953
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
12857
12954
  <xsl:apply-templates select="*[local-name() = 'author']"/>
12858
12955
  <xsl:apply-templates select="*[local-name() = 'source']"/>
12956
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
12957
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
12859
12958
  </fo:block>
12860
12959
  </xsl:if>
12861
12960
 
@@ -12877,9 +12976,13 @@
12877
12976
  </xsl:template>
12878
12977
 
12879
12978
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'author']">
12880
- <xsl:text>— </xsl:text>
12979
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
12980
+ <xsl:text>— </xsl:text>
12981
+ </xsl:if>
12881
12982
  <xsl:apply-templates/>
12882
12983
  </xsl:template>
12984
+
12985
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
12883
12986
  <!-- ====== -->
12884
12987
  <!-- ====== -->
12885
12988
 
@@ -13055,8 +13158,12 @@
13055
13158
  </xsl:template>
13056
13159
 
13057
13160
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'domain']">
13161
+ <!-- https://github.com/metanorma/isodoc/issues/607
13058
13162
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
13059
- <xsl:text> </xsl:text>
13163
+ <xsl:text> </xsl:text> -->
13164
+ <xsl:if test="not(@hidden = 'true')">
13165
+ <xsl:apply-templates/>
13166
+ </xsl:if>
13060
13167
  </xsl:template>
13061
13168
 
13062
13169
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'admitted']">
@@ -13104,6 +13211,29 @@
13104
13211
  <!-- END definition -->
13105
13212
  <!-- ========== -->
13106
13213
 
13214
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="reviews_">
13215
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
13216
+ <xsl:copy>
13217
+ <xsl:copy-of select="@from"/>
13218
+ <xsl:copy-of select="@id"/>
13219
+ </xsl:copy>
13220
+ </xsl:for-each>
13221
+ </xsl:variable>
13222
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="reviews" select="xalan:nodeset($reviews_)"/>
13223
+
13224
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="addReviewHelper">
13225
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
13226
+ <xsl:variable name="curr_id" select="@id"/>
13227
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
13228
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
13229
+ <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>
13230
+ </xsl:if>
13231
+ <!-- <fo:block>
13232
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
13233
+ <xsl:copy-of select="$reviews"/>
13234
+ </fo:block> -->
13235
+ </xsl:template>
13236
+
13107
13237
  <!-- main sections -->
13108
13238
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
13109
13239
 
@@ -13112,6 +13242,8 @@
13112
13242
 
13113
13243
  <xsl:call-template name="sections_element_style"/>
13114
13244
 
13245
+ <xsl:call-template name="addReviewHelper"/>
13246
+
13115
13247
  <xsl:apply-templates/>
13116
13248
  </fo:block>
13117
13249
 
@@ -13147,6 +13279,7 @@
13147
13279
 
13148
13280
  <fo:block>
13149
13281
  <xsl:call-template name="setId"/>
13282
+ <xsl:call-template name="addReviewHelper"/>
13150
13283
  <xsl:apply-templates/>
13151
13284
  </fo:block>
13152
13285
  </xsl:template>
@@ -13183,6 +13316,8 @@
13183
13316
 
13184
13317
  <xsl:call-template name="refine_clause_style"/>
13185
13318
 
13319
+ <xsl:call-template name="addReviewHelper"/>
13320
+
13186
13321
  <xsl:apply-templates/>
13187
13322
  </fo:block>
13188
13323
  </xsl:template>
@@ -13235,6 +13370,23 @@
13235
13370
 
13236
13371
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
13237
13372
 
13373
+ <xsl:if test="1 = 1">
13374
+ <xsl:choose>
13375
+ <!-- if there isn't the attribute '@from', then -->
13376
+ <xsl:when test="$id_from = ''">
13377
+ <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>
13378
+ </xsl:when>
13379
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
13380
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
13381
+ <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>
13382
+ </xsl:when>
13383
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
13384
+ <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>
13385
+ </xsl:when>
13386
+ </xsl:choose>
13387
+ </xsl:if>
13388
+
13389
+ <xsl:if test="1 = 2">
13238
13390
  <xsl:choose>
13239
13391
  <!-- if there isn't the attribute '@from', then -->
13240
13392
  <xsl:when test="$id_from = ''">
@@ -13248,6 +13400,7 @@
13248
13400
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
13249
13401
  </xsl:when>
13250
13402
  </xsl:choose>
13403
+ </xsl:if>
13251
13404
 
13252
13405
  </xsl:template>
13253
13406
 
@@ -14667,7 +14820,7 @@
14667
14820
  <!-- remove preprocess-xslt -->
14668
14821
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
14669
14822
 
14670
- <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
14823
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" 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">
14671
14824
  <xsl:copy-of select="."/>
14672
14825
  </xsl:template>
14673
14826
 
@@ -14733,6 +14886,22 @@
14733
14886
  </xsl:choose>
14734
14887
  </xsl:template>
14735
14888
 
14889
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
14890
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'passthrough']" mode="update_xml_step1">
14891
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
14892
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
14893
+ <xsl:apply-templates mode="update_xml_step1"/>
14894
+ </xsl:if>
14895
+ </xsl:template>
14896
+
14897
+ <!-- split math by element with @linebreak into maths -->
14898
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
14899
+ <xsl:variable name="maths">
14900
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
14901
+ </xsl:variable>
14902
+ <xsl:copy-of select="$maths"/>
14903
+ </xsl:template>
14904
+
14736
14905
  <!-- =========================================================================== -->
14737
14906
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
14738
14907
  <!-- =========================================================================== -->
@@ -14836,6 +15005,8 @@
14836
15005
 
14837
15006
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertOpeningElements">
14838
15007
  <xsl:param name="tree"/>
15008
+ <xsl:param name="xmlns"/>
15009
+ <xsl:param name="add_continue">true</xsl:param>
14839
15010
  <xsl:for-each select="$tree//element">
14840
15011
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
14841
15012
  <xsl:value-of select="."/>
@@ -14846,7 +15017,8 @@
14846
15017
  <xsl:value-of select="."/>
14847
15018
  <xsl:text>"</xsl:text>
14848
15019
  </xsl:for-each>
14849
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
15020
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
15021
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
14850
15022
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
14851
15023
  <xsl:if test="$debug = 'true'">
14852
15024
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -1649,6 +1649,7 @@
1649
1649
  <xsl:template match="ieee:abstract">
1650
1650
  <fo:block>
1651
1651
  <xsl:call-template name="setId"/>
1652
+ <xsl:call-template name="addReviewHelper"/>
1652
1653
  <xsl:apply-templates/>
1653
1654
  </fo:block>
1654
1655
  </xsl:template>
@@ -2281,6 +2282,7 @@
2281
2282
  <xsl:template match="*[local-name() = 'introduction'] | *[local-name() = 'foreword'] | *[local-name() = 'acknowledgements']">
2282
2283
  <fo:block>
2283
2284
  <xsl:call-template name="setId"/>
2285
+ <xsl:call-template name="addReviewHelper"/>
2284
2286
  <xsl:apply-templates/>
2285
2287
  </fo:block>
2286
2288
  </xsl:template>
@@ -7380,6 +7382,11 @@
7380
7382
 
7381
7383
  <xsl:value-of select="@reference"/>
7382
7384
 
7385
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
7386
+ <!-- <xsl:if test="$namespace = 'itu'">
7387
+ <xsl:text>)</xsl:text>
7388
+ </xsl:if> -->
7389
+
7383
7390
  </fo:inline>
7384
7391
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
7385
7392
  <xsl:copy-of select="./node()"/>
@@ -7389,7 +7396,7 @@
7389
7396
 
7390
7397
  </xsl:if>
7391
7398
  </xsl:for-each>
7392
- </xsl:template>
7399
+ </xsl:template> <!-- table_fn_display -->
7393
7400
 
7394
7401
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="create_fn">
7395
7402
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -7417,8 +7424,10 @@
7417
7424
  <!-- EMD table's footnotes rendering -->
7418
7425
  <!-- ============================ -->
7419
7426
 
7427
+ <!-- ============================ -->
7420
7428
  <!-- figure's footnotes rendering -->
7421
- <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="fn_display_figure">
7429
+ <!-- ============================ -->
7430
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="fn_display_figure"> <!-- figure_fn_display -->
7422
7431
 
7423
7432
  <!-- current figure id -->
7424
7433
  <xsl:variable name="figure_id_">
@@ -7531,9 +7540,28 @@
7531
7540
 
7532
7541
  </fo:block>
7533
7542
  </xsl:if>
7534
-
7535
7543
  </xsl:template> <!-- fn_display_figure -->
7536
7544
 
7545
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
7546
+ <!-- figure's footnote label -->
7547
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" 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">
7548
+ <xsl:variable name="key_iso">
7549
+
7550
+ </xsl:variable>
7551
+ <xsl:if test="normalize-space($key_iso) = 'true'">
7552
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
7553
+
7554
+ </xsl:if>
7555
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
7556
+ <!-- <xsl:value-of select="@reference"/> -->
7557
+ <xsl:apply-templates/>
7558
+ </fo:inline>
7559
+ </xsl:template>
7560
+
7561
+ <!-- ============================ -->
7562
+ <!-- END: figure's footnotes rendering -->
7563
+ <!-- ============================ -->
7564
+
7537
7565
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
7538
7566
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='fn']">
7539
7567
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -7549,6 +7577,10 @@
7549
7577
 
7550
7578
  <xsl:value-of select="@reference"/>
7551
7579
 
7580
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
7581
+ <!-- <xsl:if test="$namespace = 'jis'">
7582
+ <fo:inline font-weight="normal">)</fo:inline>
7583
+ </xsl:if> -->
7552
7584
  </fo:basic-link>
7553
7585
  </fo:inline>
7554
7586
  </xsl:template>
@@ -7675,17 +7707,22 @@
7675
7707
  </fo:block>
7676
7708
  </xsl:when> <!-- END: a few components -->
7677
7709
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
7678
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
7710
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
7711
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
7679
7712
 
7680
- <xsl:call-template name="refine_figure_key_style"/>
7713
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
7681
7714
 
7682
- <xsl:variable name="title-key">
7683
- <xsl:call-template name="getLocalizedString">
7684
- <xsl:with-param name="key">key</xsl:with-param>
7685
- </xsl:call-template>
7686
- </xsl:variable>
7687
- <xsl:value-of select="$title-key"/>
7688
- </fo:block>
7715
+ <xsl:call-template name="refine_figure_key_style"/>
7716
+
7717
+ <xsl:variable name="title-key">
7718
+ <xsl:call-template name="getLocalizedString">
7719
+ <xsl:with-param name="key">key</xsl:with-param>
7720
+ </xsl:call-template>
7721
+ </xsl:variable>
7722
+ <xsl:value-of select="$title-key"/>
7723
+ </fo:block>
7724
+
7725
+ </xsl:if>
7689
7726
  </xsl:when> <!-- END: definition list in a figure -->
7690
7727
  </xsl:choose>
7691
7728
 
@@ -7871,6 +7908,14 @@
7871
7908
 
7872
7909
  </xsl:template> <!-- END: dl -->
7873
7910
 
7911
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
7912
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
7913
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
7914
+ <xsl:call-template name="refine_figure_key_style"/>
7915
+ <xsl:apply-templates/>
7916
+ </fo:block>
7917
+ </xsl:template>
7918
+
7874
7919
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="refine_dl_formula_where_style">
7875
7920
 
7876
7921
  </xsl:template> <!-- refine_dl_formula_where_style -->
@@ -9903,6 +9948,39 @@
9903
9948
  </xsl:copy>
9904
9949
  </xsl:template>
9905
9950
 
9951
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="mathml_linebreak">
9952
+ <xsl:copy>
9953
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
9954
+ </xsl:copy>
9955
+ </xsl:template>
9956
+
9957
+ <!-- split math into two math -->
9958
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
9959
+ <xsl:variable name="math_elements_tree_">
9960
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
9961
+ <element pos="{position()}">
9962
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
9963
+ <xsl:value-of select="name()"/>
9964
+ </element>
9965
+ </xsl:for-each>
9966
+ </xsl:variable>
9967
+
9968
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
9969
+
9970
+ <xsl:call-template name="insertClosingElements">
9971
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
9972
+ </xsl:call-template>
9973
+
9974
+ <xsl:element name="br" namespace="{$namespace_full}"/>
9975
+
9976
+ <xsl:call-template name="insertOpeningElements">
9977
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
9978
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
9979
+ <xsl:with-param name="add_continue">false</xsl:with-param>
9980
+ </xsl:call-template>
9981
+
9982
+ </xsl:template>
9983
+
9906
9984
  <!-- Examples:
9907
9985
  <stem type="AsciiMath">x = 1</stem>
9908
9986
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -10154,9 +10232,11 @@
10154
10232
  </xsl:template>
10155
10233
 
10156
10234
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
10235
+ <!-- https://github.com/metanorma/isodoc/issues/607
10157
10236
  <xsl:if test="normalize-space() != ''">
10158
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
10159
- </xsl:if>
10237
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
10238
+ </xsl:if> -->
10239
+ <xsl:apply-templates/>
10160
10240
  </xsl:template>
10161
10241
 
10162
10242
  <!-- stem inside formula with name (with formula's number) -->
@@ -10312,8 +10392,17 @@
10312
10392
  </xsl:when>
10313
10393
  <xsl:otherwise>
10314
10394
 
10315
- <xsl:text>—</xsl:text>
10395
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
10396
+ <!-- <xsl:if test="$namespace = 'ieee'">
10397
+ <xsl:text>—</xsl:text> em dash &#x2014;
10398
+ </xsl:if> -->
10399
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
10400
+ <xsl:text>:</xsl:text>
10401
+ </xsl:if> -->
10316
10402
 
10403
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
10404
+ <xsl:text> – </xsl:text> en dash &#x2013;
10405
+ </xsl:if> -->
10317
10406
  </xsl:otherwise>
10318
10407
  </xsl:choose>
10319
10408
  </xsl:variable>
@@ -10332,8 +10421,16 @@
10332
10421
  </xsl:when>
10333
10422
  <xsl:otherwise>
10334
10423
 
10335
- <xsl:text>—</xsl:text>
10336
-
10424
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
10425
+ <!-- <xsl:if test="$namespace = 'ieee'">
10426
+ <xsl:text>—</xsl:text> em dash &#x2014;
10427
+ </xsl:if> -->
10428
+ <!-- <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'">
10429
+ <xsl:text>:</xsl:text>
10430
+ </xsl:if> -->
10431
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
10432
+ <xsl:text> – </xsl:text> en dash &#x2013;
10433
+ </xsl:if> -->
10337
10434
  </xsl:otherwise>
10338
10435
  </xsl:choose>
10339
10436
  </xsl:variable>
@@ -12499,7 +12596,7 @@
12499
12596
  <xsl:if test="normalize-space() != ''">
12500
12597
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
12501
12598
  <xsl:call-template name="refine_termexample-name-style"/>
12502
- <xsl:apply-templates/>:
12599
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
12503
12600
  </fo:inline>
12504
12601
  </xsl:if>
12505
12602
  </xsl:template>
@@ -12665,7 +12762,7 @@
12665
12762
  <xsl:otherwise>
12666
12763
  <fo:inline xsl:use-attribute-sets="example-name-style">
12667
12764
  <xsl:call-template name="refine_example-name-style"/>
12668
- <xsl:apply-templates/>:
12765
+ <xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
12669
12766
  </fo:inline>
12670
12767
  </xsl:otherwise>
12671
12768
  </xsl:choose>
@@ -12847,15 +12944,17 @@
12847
12944
 
12848
12945
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
12849
12946
  <fo:block role="BlockQuote">
12850
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
12947
+ <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 -->
12851
12948
  </fo:block>
12852
12949
  </fo:block-container>
12853
12950
  </fo:block-container>
12854
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
12951
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
12855
12952
  <fo:block xsl:use-attribute-sets="quote-source-style">
12856
12953
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
12857
12954
  <xsl:apply-templates select="*[local-name() = 'author']"/>
12858
12955
  <xsl:apply-templates select="*[local-name() = 'source']"/>
12956
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
12957
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
12859
12958
  </fo:block>
12860
12959
  </xsl:if>
12861
12960
 
@@ -12877,9 +12976,13 @@
12877
12976
  </xsl:template>
12878
12977
 
12879
12978
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'author']">
12880
- <xsl:text>— </xsl:text>
12979
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
12980
+ <xsl:text>— </xsl:text>
12981
+ </xsl:if>
12881
12982
  <xsl:apply-templates/>
12882
12983
  </xsl:template>
12984
+
12985
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
12883
12986
  <!-- ====== -->
12884
12987
  <!-- ====== -->
12885
12988
 
@@ -13055,8 +13158,12 @@
13055
13158
  </xsl:template>
13056
13159
 
13057
13160
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'domain']">
13161
+ <!-- https://github.com/metanorma/isodoc/issues/607
13058
13162
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
13059
- <xsl:text> </xsl:text>
13163
+ <xsl:text> </xsl:text> -->
13164
+ <xsl:if test="not(@hidden = 'true')">
13165
+ <xsl:apply-templates/>
13166
+ </xsl:if>
13060
13167
  </xsl:template>
13061
13168
 
13062
13169
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'admitted']">
@@ -13104,6 +13211,29 @@
13104
13211
  <!-- END definition -->
13105
13212
  <!-- ========== -->
13106
13213
 
13214
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="reviews_">
13215
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
13216
+ <xsl:copy>
13217
+ <xsl:copy-of select="@from"/>
13218
+ <xsl:copy-of select="@id"/>
13219
+ </xsl:copy>
13220
+ </xsl:for-each>
13221
+ </xsl:variable>
13222
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="reviews" select="xalan:nodeset($reviews_)"/>
13223
+
13224
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="addReviewHelper">
13225
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
13226
+ <xsl:variable name="curr_id" select="@id"/>
13227
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
13228
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
13229
+ <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>
13230
+ </xsl:if>
13231
+ <!-- <fo:block>
13232
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
13233
+ <xsl:copy-of select="$reviews"/>
13234
+ </fo:block> -->
13235
+ </xsl:template>
13236
+
13107
13237
  <!-- main sections -->
13108
13238
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
13109
13239
 
@@ -13112,6 +13242,8 @@
13112
13242
 
13113
13243
  <xsl:call-template name="sections_element_style"/>
13114
13244
 
13245
+ <xsl:call-template name="addReviewHelper"/>
13246
+
13115
13247
  <xsl:apply-templates/>
13116
13248
  </fo:block>
13117
13249
 
@@ -13147,6 +13279,7 @@
13147
13279
 
13148
13280
  <fo:block>
13149
13281
  <xsl:call-template name="setId"/>
13282
+ <xsl:call-template name="addReviewHelper"/>
13150
13283
  <xsl:apply-templates/>
13151
13284
  </fo:block>
13152
13285
  </xsl:template>
@@ -13183,6 +13316,8 @@
13183
13316
 
13184
13317
  <xsl:call-template name="refine_clause_style"/>
13185
13318
 
13319
+ <xsl:call-template name="addReviewHelper"/>
13320
+
13186
13321
  <xsl:apply-templates/>
13187
13322
  </fo:block>
13188
13323
  </xsl:template>
@@ -13235,6 +13370,23 @@
13235
13370
 
13236
13371
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
13237
13372
 
13373
+ <xsl:if test="1 = 1">
13374
+ <xsl:choose>
13375
+ <!-- if there isn't the attribute '@from', then -->
13376
+ <xsl:when test="$id_from = ''">
13377
+ <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>
13378
+ </xsl:when>
13379
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
13380
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
13381
+ <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>
13382
+ </xsl:when>
13383
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
13384
+ <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>
13385
+ </xsl:when>
13386
+ </xsl:choose>
13387
+ </xsl:if>
13388
+
13389
+ <xsl:if test="1 = 2">
13238
13390
  <xsl:choose>
13239
13391
  <!-- if there isn't the attribute '@from', then -->
13240
13392
  <xsl:when test="$id_from = ''">
@@ -13248,6 +13400,7 @@
13248
13400
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
13249
13401
  </xsl:when>
13250
13402
  </xsl:choose>
13403
+ </xsl:if>
13251
13404
 
13252
13405
  </xsl:template>
13253
13406
 
@@ -14667,7 +14820,7 @@
14667
14820
  <!-- remove preprocess-xslt -->
14668
14821
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
14669
14822
 
14670
- <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
14823
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" 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">
14671
14824
  <xsl:copy-of select="."/>
14672
14825
  </xsl:template>
14673
14826
 
@@ -14733,6 +14886,22 @@
14733
14886
  </xsl:choose>
14734
14887
  </xsl:template>
14735
14888
 
14889
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
14890
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'passthrough']" mode="update_xml_step1">
14891
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
14892
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
14893
+ <xsl:apply-templates mode="update_xml_step1"/>
14894
+ </xsl:if>
14895
+ </xsl:template>
14896
+
14897
+ <!-- split math by element with @linebreak into maths -->
14898
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
14899
+ <xsl:variable name="maths">
14900
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
14901
+ </xsl:variable>
14902
+ <xsl:copy-of select="$maths"/>
14903
+ </xsl:template>
14904
+
14736
14905
  <!-- =========================================================================== -->
14737
14906
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
14738
14907
  <!-- =========================================================================== -->
@@ -14836,6 +15005,8 @@
14836
15005
 
14837
15006
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertOpeningElements">
14838
15007
  <xsl:param name="tree"/>
15008
+ <xsl:param name="xmlns"/>
15009
+ <xsl:param name="add_continue">true</xsl:param>
14839
15010
  <xsl:for-each select="$tree//element">
14840
15011
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
14841
15012
  <xsl:value-of select="."/>
@@ -14846,7 +15017,8 @@
14846
15017
  <xsl:value-of select="."/>
14847
15018
  <xsl:text>"</xsl:text>
14848
15019
  </xsl:for-each>
14849
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
15020
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
15021
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
14850
15022
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
14851
15023
  <xsl:if test="$debug = 'true'">
14852
15024
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -114,6 +114,20 @@ module IsoDoc
114
114
  id = UUIDTools::UUID.random_create.to_s
115
115
  "<fn reference='#{id}'><p>#{note.content}</p></fn>"
116
116
  end
117
+
118
+ def omit_docid_prefix(prefix)
119
+ prefix == "DOI" and return true
120
+ super
121
+ end
122
+
123
+ def bracket_if_num(num)
124
+ return nil if num.nil?
125
+
126
+ num = num.text.sub(/^\[/, "").sub(/\]$/, "")
127
+ return "[#{num}]" if /^B?\d+$/.match?(num)
128
+
129
+ num
130
+ end
117
131
  end
118
132
  end
119
133
  end
@@ -10,8 +10,7 @@ module IsoDoc
10
10
  c = IsoDoc::XrefGen::Counter.new("@")
11
11
  elem.xpath(ns("./definition")).each do |d|
12
12
  c.increment(d)
13
- d.elements.first.children.first.previous =
14
- "<strong>(#{c.print})</strong>&#xa0;"
13
+ d.elements.first.add_first_child "<strong>(#{c.print})</strong>&#xa0;"
15
14
  end
16
15
  end
17
16
 
@@ -214,6 +213,13 @@ module IsoDoc
214
213
  end
215
214
  end
216
215
 
216
+ # domain is rendered in designation_field instead
217
+ def termdomain(elem)
218
+ d = elem.at(ns(".//domain")) or return
219
+ d["hidden"] = "true"
220
+ end
221
+
222
+ # TODO wrap domain not in <domain>, but <span class="domain"> or equivalent
217
223
  def designation_field(desgn, name)
218
224
  if desgn.name == "preferred"
219
225
  f = desgn.xpath(ns("./../domain | ./../subject")).map(&:remove)
@@ -235,11 +241,20 @@ module IsoDoc
235
241
  pref << " (#{tail})"
236
242
  end
237
243
 
244
+ def termnote_delim(_elem)
245
+ "&#x2014;"
246
+ end
247
+
238
248
  def termnote1(elem)
239
- lbl = l10n(@xrefs.anchor(elem["id"], :label)&.strip || "???")
249
+ lbl = termnote_label(elem)
240
250
  prefix_name(elem, block_delim, lower2cap(lbl), "name")
241
251
  end
242
252
 
253
+ def termnote_label(elem)
254
+ lbl = l10n(@xrefs.anchor(elem["id"], :label)&.strip || "???")
255
+ l10n "#{lbl}#{termnote_delim(elem)}"
256
+ end
257
+
243
258
  def term(docxml); end
244
259
 
245
260
  def concept1(node)
@@ -18,8 +18,9 @@ module IsoDoc
18
18
  ret = resolve_eref_connectives(eref_locality_stacks(refs, target,
19
19
  node))
20
20
  node["droploc"] = droploc
21
+ p = prefix_clause(target, refs.first.at(ns("./locality")))
21
22
  eref_localities1({ target: target, number: "pl",
22
- type: prefix_clause(target, refs.first.at(ns("./locality"))),
23
+ type: p,
23
24
  from: l10n(ret[1..-1].join), node: node,
24
25
  lang: @lang })
25
26
  end
@@ -72,13 +73,8 @@ module IsoDoc
72
73
  "&#x2014;"
73
74
  end
74
75
 
75
- def note1(elem)
76
- elem.parent.name == "bibitem" || elem["notag"] == "true" and return
77
- n = @xrefs.get[elem["id"]]
78
- lbl = if n.nil? || n[:label].nil? || n[:label].empty? then @i18n.note
79
- else l10n("#{@i18n.note} #{n[:label]}")
80
- end
81
- prefix_name(elem, block_delim, lbl, "name")
76
+ def note_delim(_elem)
77
+ "&#x2014;"
82
78
  end
83
79
 
84
80
  def annex1(elem)
@@ -95,7 +91,7 @@ module IsoDoc
95
91
  t.name = "variant-title"
96
92
  t["type"] = "sub"
97
93
  end
98
- elem.children.first.previous = "<title>#{lbl}</title>"
94
+ elem.add_first_child "<title>#{lbl}</title>"
99
95
  end
100
96
 
101
97
  def annex1_default(elem)
@@ -216,6 +212,13 @@ module IsoDoc
216
212
  dest.children.first.next = source
217
213
  end
218
214
 
215
+ def example1(elem)
216
+ super
217
+ n = elem.at(ns("./name")) or return
218
+ n << l10n(":")
219
+ n.children.wrap("<em></em>")
220
+ end
221
+
219
222
  include Init
220
223
  end
221
224
  end
@@ -153,9 +153,9 @@ module IsoDoc
153
153
  def feedback_style1(div, idx)
154
154
  div.xpath(".//p").each_with_index do |p, j|
155
155
  p["class"] = idx == 4 ? "IEEEStdsCRTextItal" : "IEEEStdsCRTextReg"
156
- j.zero? && idx.zero? and
157
- p.children.first.previous =
158
- '<a style="mso-footnote-id:ftn0" href="#_ftnref0" name="_ftn0" title=""/>'
156
+ j.zero? && idx.zero? and p.add_first_child <<~XML
157
+ <a style="mso-footnote-id:ftn0" href="#_ftnref0" name="_ftn0" title=""/>
158
+ XML
159
159
  end
160
160
  end
161
161
 
@@ -203,9 +203,9 @@ module IsoDoc
203
203
  end
204
204
 
205
205
  def abstract_header(dest)
206
- dest.elements.first.children.first.previous =
207
- "<span class='IEEEStdsAbstractHeader'><span lang='EN-US'>" \
208
- "Abstract:</span></span> "
206
+ dest.elements.first.add_first_child <<~XML
207
+ <span class='IEEEStdsAbstractHeader'><span lang='EN-US'>Abstract:</span></span>
208
+ XML
209
209
  end
210
210
 
211
211
  def introduction_cleanup(docxml)
@@ -99,7 +99,6 @@ module IsoDoc
99
99
 
100
100
  def example_caption(docxml)
101
101
  docxml.xpath("//p[@class = 'example-title']").each do |s|
102
- s.children = "<em>#{to_xml(s.children)}</em>"
103
102
  s["class"] = stylesmap[:MsoNormal]
104
103
  end
105
104
  end
@@ -191,7 +191,6 @@ module IsoDoc
191
191
  def termnote_label(para, name)
192
192
  para.span class: "note_label" do |s|
193
193
  name.children.each { |n| parse(n, s) }
194
- s << termnote_delim
195
194
  end
196
195
  end
197
196
 
@@ -100,7 +100,6 @@ module IsoDoc
100
100
  out.div **figure_attrs(node) do |div|
101
101
  figure_name_parse(node, div, node.at(ns("./name")))
102
102
  node.children.each do |n|
103
- figure_key(out) if n.name == "dl"
104
103
  parse(n, div) unless n.name == "name"
105
104
  end
106
105
  end
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.3.4 -->
20
+ <!-- VERSION v1.4.0 -->
21
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">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ieee
3
- VERSION = "1.3.3".freeze
3
+ VERSION = "1.3.4".freeze
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
27
27
 
28
- spec.add_dependency "metanorma-standoc", "~> 2.9.6"
28
+ spec.add_dependency "metanorma-standoc", "~> 2.10.0"
29
29
  spec.add_dependency "mnconvert", "~> 1.20"
30
30
  spec.add_dependency "pubid"
31
31
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-28 00:00:00.000000000 Z
11
+ date: 2024-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.9.6
19
+ version: 2.10.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.9.6
26
+ version: 2.10.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mnconvert
29
29
  requirement: !ruby/object:Gem::Requirement