metanorma-cc 2.5.6 → 2.5.7

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: cdee98655f21152c7fb1523b8ccba8af7a4b887f82439c3cb397a3726ce932ce
4
- data.tar.gz: e3a9bddee0dc3d95c62981ea333b89533bf9bf0146637b955b4ac8c1c79fa92f
3
+ metadata.gz: 875d36f36a391b042e3fbbca29cc36cf3cd1bc33f8e843c5420ebb49d8dd5b17
4
+ data.tar.gz: 20ec86790d5ad579b51d31f32c93137a70f695c797a385cb8dd0c8e700e47392
5
5
  SHA512:
6
- metadata.gz: 532ed62afb3d428e10cae116d10d5f236dfa1684a929980d75bcfce9d75eda5518e10e11ffe65b228f849910289c95b910ae78c337dd48472a82dc56350cc367
7
- data.tar.gz: '05999ea26e85ad7bdcf2b5675141a78182a4edfb7aaebfcc5c45e025aa69e1c615e892970a77499b6a948bb814254d4a952699020046c0b3cd81842d8736e93e'
6
+ metadata.gz: 85e16497bfa33d8090e95c12625712341fa3afa0671c8449925f86104e853a365e2f87193174afd7d193657836bf8b823870da4ccf4af6266bcb08969841bd68
7
+ data.tar.gz: 65381bba265f8ba310256666921c5ffa492cd9882515a83037f9eb214607f754acb466e13d7a361bb7739c8fb634a4a97677674a32a074585ffdcfe005c4b2bf
@@ -268,11 +268,11 @@
268
268
  <xsl:call-template name="insertHeaderFooter"/>
269
269
  <fo:flow flow-name="xsl-region-body">
270
270
 
271
- <!-- <xsl:if test="$debug = 'true'">
272
- <redirect:write file="contents_{java:getTime(java:java.util.Date.new())}.xml">
271
+ <xsl:if test="$debug = 'true'">
272
+ <redirect:write file="contents_.xml"> <!-- {java:getTime(java:java.util.Date.new())} -->
273
273
  <xsl:copy-of select="$contents"/>
274
274
  </redirect:write>
275
- </xsl:if> -->
275
+ </xsl:if>
276
276
 
277
277
  <xsl:if test="position() = 1">
278
278
  <fo:block margin-bottom="15pt"> </fo:block>
@@ -473,10 +473,10 @@
473
473
  <!-- ============================= -->
474
474
 
475
475
  <!-- element with title -->
476
- <xsl:template match="*[csd:title]" mode="contents">
476
+ <xsl:template match="*[csd:title or csd:fmt-title]" mode="contents">
477
477
  <xsl:variable name="level">
478
478
  <xsl:call-template name="getLevel">
479
- <xsl:with-param name="depth" select="csd:title/@depth"/>
479
+ <xsl:with-param name="depth" select="csd:fmt-title/@depth | csd:title/@depth"/>
480
480
  </xsl:call-template>
481
481
  </xsl:variable>
482
482
 
@@ -677,7 +677,7 @@
677
677
  </fo:static-content>
678
678
  </xsl:template>
679
679
 
680
- <xsl:strip-space elements="csd:xref"/>
680
+ <!-- <xsl:strip-space elements="csd:xref"/> -->
681
681
 
682
682
  <xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
683
683
  <xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
@@ -1638,6 +1638,10 @@
1638
1638
 
1639
1639
  <xsl:template name="refine_termnote-name-style">
1640
1640
 
1641
+ <!-- <xsl:if test="$namespace = 'ieee'">
1642
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
1643
+ </xsl:if> -->
1644
+
1641
1645
  </xsl:template>
1642
1646
 
1643
1647
  <xsl:attribute-set name="termnote-p-style">
@@ -2297,9 +2301,21 @@
2297
2301
  <xsl:template name="processTables_Contents">
2298
2302
  <tables>
2299
2303
  <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2300
- <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2301
- <xsl:copy-of select="*[local-name() = 'name']"/>
2302
- </table>
2304
+ <xsl:choose>
2305
+ <xsl:when test="*[local-name() = 'fmt-name']">
2306
+ <xsl:variable name="fmt_name">
2307
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
2308
+ </xsl:variable>
2309
+ <table id="{@id}" alt-text="{normalize-space($fmt_name)}">
2310
+ <xsl:copy-of select="$fmt_name"/>
2311
+ </table>
2312
+ </xsl:when>
2313
+ <xsl:otherwise>
2314
+ <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2315
+ <xsl:copy-of select="*[local-name() = 'name']"/>
2316
+ </table>
2317
+ </xsl:otherwise>
2318
+ </xsl:choose>
2303
2319
  </xsl:for-each>
2304
2320
  </tables>
2305
2321
  </xsl:template>
@@ -2307,9 +2323,21 @@
2307
2323
  <xsl:template name="processFigures_Contents">
2308
2324
  <figures>
2309
2325
  <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
2310
- <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
2311
- <xsl:copy-of select="*[local-name() = 'name']"/>
2312
- </figure>
2326
+ <xsl:choose>
2327
+ <xsl:when test="*[local-name() = 'fmt-name']">
2328
+ <xsl:variable name="fmt_name">
2329
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
2330
+ </xsl:variable>
2331
+ <figure id="{@id}" alt-text="{normalize-space($fmt_name)}">
2332
+ <xsl:copy-of select="$fmt_name"/>
2333
+ </figure>
2334
+ </xsl:when>
2335
+ <xsl:otherwise>
2336
+ <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
2337
+ <xsl:copy-of select="*[local-name() = 'name']"/>
2338
+ </figure>
2339
+ </xsl:otherwise>
2340
+ </xsl:choose>
2313
2341
  </xsl:for-each>
2314
2342
  </figures>
2315
2343
  </xsl:template>
@@ -7056,6 +7084,8 @@
7056
7084
 
7057
7085
  <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
7058
7086
 
7087
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab"/>
7088
+
7059
7089
  <xsl:call-template name="refine_note-name-style"/>
7060
7090
 
7061
7091
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
@@ -7112,10 +7142,6 @@
7112
7142
 
7113
7143
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7114
7144
 
7115
- <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
7116
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
7117
- </xsl:if>
7118
-
7119
7145
  <xsl:call-template name="refine_termnote-name-style"/>
7120
7146
 
7121
7147
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
@@ -7262,17 +7288,29 @@
7262
7288
  <!-- Example: Dimensions in millimeters -->
7263
7289
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
7264
7290
 
7291
+ <xsl:variable name="show_figure_key_in_block_container">
7292
+ true
7293
+ </xsl:variable>
7294
+
7265
7295
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
7266
7296
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
7267
7297
  </fo:block>
7268
- <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
7269
- <xsl:call-template name="note"/>
7270
- </xsl:for-each>
7271
- <xsl:call-template name="fn_display_figure"/>
7298
+
7299
+ <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
7300
+ <xsl:call-template name="showFigureKey"/>
7301
+ </xsl:if>
7272
7302
 
7273
7303
  <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
7274
7304
 
7275
7305
  </fo:block-container>
7306
+
7307
+ </xsl:template>
7308
+
7309
+ <xsl:template name="showFigureKey">
7310
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
7311
+ <xsl:call-template name="note"/>
7312
+ </xsl:for-each>
7313
+ <xsl:call-template name="fn_display_figure"/>
7276
7314
  </xsl:template>
7277
7315
 
7278
7316
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
@@ -7468,6 +7506,22 @@
7468
7506
  </xsl:if>
7469
7507
  </xsl:template>
7470
7508
 
7509
+ <xsl:template name="getImageSrc">
7510
+ <xsl:choose>
7511
+ <xsl:when test="not(starts-with(@src, 'data:'))">
7512
+ <xsl:choose>
7513
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7514
+ <xsl:value-of select="@src"/>
7515
+ </xsl:when>
7516
+ <xsl:otherwise>
7517
+ <xsl:value-of select="concat($basepath, @src)"/>
7518
+ </xsl:otherwise>
7519
+ </xsl:choose>
7520
+ </xsl:when>
7521
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7522
+ </xsl:choose>
7523
+ </xsl:template>
7524
+
7471
7525
  <xsl:template name="getImageScale">
7472
7526
  <xsl:param name="indent"/>
7473
7527
  <xsl:variable name="indent_left">
@@ -7477,19 +7531,7 @@
7477
7531
  </xsl:choose>
7478
7532
  </xsl:variable>
7479
7533
  <xsl:variable name="img_src">
7480
- <xsl:choose>
7481
- <xsl:when test="not(starts-with(@src, 'data:'))">
7482
- <xsl:choose>
7483
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7484
- <xsl:value-of select="@src"/>
7485
- </xsl:when>
7486
- <xsl:otherwise>
7487
- <xsl:value-of select="concat($basepath, @src)"/>
7488
- </xsl:otherwise>
7489
- </xsl:choose>
7490
- </xsl:when>
7491
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7492
- </xsl:choose>
7534
+ <xsl:call-template name="getImageSrc"/>
7493
7535
  </xsl:variable>
7494
7536
 
7495
7537
  <xsl:variable name="image_width_effective">
@@ -7497,10 +7539,15 @@
7497
7539
  <xsl:value-of select="$width_effective - number($indent_left)"/>
7498
7540
 
7499
7541
  </xsl:variable>
7542
+ <xsl:variable name="image_height_effective" select="$height_effective - number($indent_left)"/>
7500
7543
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
7501
7544
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
7502
7545
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
7503
- <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7546
+ <xsl:variable name="scale">
7547
+
7548
+ <xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7549
+
7550
+ </xsl:variable>
7504
7551
  <xsl:value-of select="$scale"/>
7505
7552
  </xsl:template>
7506
7553
 
@@ -8053,20 +8100,48 @@
8053
8100
  <xsl:template match="*[local-name() = 'emf']"/>
8054
8101
 
8055
8102
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
8103
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
8104
+ <xsl:apply-templates mode="contents"/>
8105
+ <xsl:text> </xsl:text>
8106
+ </xsl:if>
8107
+ </xsl:template>
8108
+
8109
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="contents"/>
8110
+
8111
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name']" mode="contents">
8056
8112
  <xsl:apply-templates mode="contents"/>
8057
8113
  <xsl:text> </xsl:text>
8058
8114
  </xsl:template>
8059
8115
 
8060
8116
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
8117
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
8118
+ <xsl:apply-templates mode="bookmarks"/>
8119
+ <xsl:text> </xsl:text>
8120
+ </xsl:if>
8121
+ </xsl:template>
8122
+
8123
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name'] | *[local-name() = 'sourcecode']/*[local-name() = 'fmt-name']" mode="bookmarks">
8061
8124
  <xsl:apply-templates mode="bookmarks"/>
8062
8125
  <xsl:text> </xsl:text>
8063
8126
  </xsl:template>
8064
8127
 
8065
8128
  <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
8129
+ <xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
8130
+ <xsl:value-of select="."/>
8131
+ </xsl:if>
8132
+ </xsl:template>
8133
+
8134
+ <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'fmt-name']/text()" mode="contents" priority="2">
8066
8135
  <xsl:value-of select="."/>
8067
8136
  </xsl:template>
8068
8137
 
8069
8138
  <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
8139
+ <xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
8140
+ <xsl:value-of select="."/>
8141
+ </xsl:if>
8142
+ </xsl:template>
8143
+
8144
+ <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'fmt-name']//text()" mode="bookmarks" priority="2">
8070
8145
  <xsl:value-of select="."/>
8071
8146
  </xsl:template>
8072
8147
 
@@ -8087,7 +8162,7 @@
8087
8162
  </xsl:template>
8088
8163
 
8089
8164
  <!-- special case: ignore section-title if @depth different than @depth of parent clause, or @depth of parent clause = 1 -->
8090
- <xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/>
8165
+ <xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth or ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth = 1)]" priority="3" mode="contents"/>
8091
8166
 
8092
8167
  <xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
8093
8168
  <xsl:variable name="level">
@@ -8099,6 +8174,9 @@
8099
8174
  <xsl:variable name="section">
8100
8175
  <xsl:choose>
8101
8176
  <xsl:when test="@type = 'section-title'"/>
8177
+ <xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
8178
+ <xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
8179
+ </xsl:when>
8102
8180
  <xsl:otherwise>
8103
8181
  <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8104
8182
  </xsl:otherwise>
@@ -8121,6 +8199,19 @@
8121
8199
 
8122
8200
  <xsl:variable name="title">
8123
8201
  <xsl:choose>
8202
+ <!-- https://github.com/metanorma/mn-native-pdf/issues/770 -->
8203
+ <xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
8204
+ <xsl:choose>
8205
+ <xsl:when test="@type = 'section-title'">
8206
+ <xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
8207
+ <xsl:text>: </xsl:text>
8208
+ <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
8209
+ </xsl:when>
8210
+ <xsl:otherwise>
8211
+ <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
8212
+ </xsl:otherwise>
8213
+ </xsl:choose>
8214
+ </xsl:when>
8124
8215
  <xsl:when test="*[local-name() = 'tab']">
8125
8216
  <xsl:choose>
8126
8217
  <xsl:when test="@type = 'section-title'">
@@ -8156,7 +8247,7 @@
8156
8247
  <xsl:apply-templates mode="bookmarks"/>
8157
8248
  </xsl:template>
8158
8249
 
8159
- <xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
8250
+ <xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
8160
8251
  <xsl:apply-templates select="."/>
8161
8252
  </xsl:template>
8162
8253
 
@@ -8169,6 +8260,10 @@
8169
8260
  <xsl:apply-templates mode="contents"/>
8170
8261
  </xsl:template>
8171
8262
 
8263
+ <xsl:template match="*[local-name() = 'semx']" mode="contents">
8264
+ <xsl:apply-templates mode="contents"/>
8265
+ </xsl:template>
8266
+
8172
8267
  <xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
8173
8268
  <xsl:apply-templates mode="bookmarks"/>
8174
8269
  </xsl:template>
@@ -8178,9 +8273,14 @@
8178
8273
  <xsl:apply-templates mode="bookmarks"/>
8179
8274
  </xsl:template>
8180
8275
 
8276
+ <xsl:template match="*[local-name() = 'semx']" mode="bookmarks">
8277
+ <xsl:apply-templates mode="bookmarks"/>
8278
+ </xsl:template>
8279
+
8181
8280
  <!-- Bookmarks -->
8182
8281
  <xsl:template name="addBookmarks">
8183
8282
  <xsl:param name="contents"/>
8283
+ <xsl:param name="contents_addon"/>
8184
8284
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
8185
8285
  <xsl:if test="$contents_nodes//item">
8186
8286
  <fo:bookmark-tree>
@@ -8278,6 +8378,9 @@
8278
8378
  </xsl:otherwise>
8279
8379
  </xsl:choose>
8280
8380
 
8381
+ <!-- for $namespace = 'nist-sp' $namespace = 'ogc' $namespace = 'ogc-white-paper' -->
8382
+ <xsl:copy-of select="$contents_addon"/>
8383
+
8281
8384
  </fo:bookmark-tree>
8282
8385
  </xsl:if>
8283
8386
  </xsl:template>
@@ -8431,6 +8534,16 @@
8431
8534
  <!-- ====== -->
8432
8535
  <!-- ====== -->
8433
8536
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
8537
+ <xsl:param name="mode">bookmarks</xsl:param>
8538
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-title'])">
8539
+ <xsl:apply-templates mode="contents_item">
8540
+ <xsl:with-param name="mode" select="$mode"/>
8541
+ </xsl:apply-templates>
8542
+ <!-- <xsl:text> </xsl:text> -->
8543
+ </xsl:if>
8544
+ </xsl:template>
8545
+
8546
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="contents_item">
8434
8547
  <xsl:param name="mode">bookmarks</xsl:param>
8435
8548
  <xsl:apply-templates mode="contents_item">
8436
8549
  <xsl:with-param name="mode" select="$mode"/>
@@ -8438,12 +8551,38 @@
8438
8551
  <!-- <xsl:text> </xsl:text> -->
8439
8552
  </xsl:template>
8440
8553
 
8554
+ <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim']" mode="contents_item" priority="3">
8555
+ <xsl:apply-templates mode="contents_item"/>
8556
+ </xsl:template>
8557
+
8558
+ <xsl:template match="*[local-name() = 'semx']" mode="contents_item">
8559
+ <xsl:apply-templates mode="contents_item"/>
8560
+ </xsl:template>
8561
+
8562
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
8563
+
8441
8564
  <xsl:template name="getSection">
8442
- <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8565
+ <xsl:choose>
8566
+ <xsl:when test="*[local-name() = 'fmt-title']">
8567
+ <xsl:variable name="fmt_title_section">
8568
+ <xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/preceding-sibling::node()[not(local-name() = 'review')]"/>
8569
+ </xsl:variable>
8570
+ <xsl:value-of select="normalize-space($fmt_title_section)"/>
8571
+ </xsl:when>
8572
+ <xsl:otherwise>
8573
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8574
+ </xsl:otherwise>
8575
+ </xsl:choose>
8443
8576
  </xsl:template>
8444
8577
 
8445
8578
  <xsl:template name="getName">
8446
8579
  <xsl:choose>
8580
+ <xsl:when test="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']]">
8581
+ <xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/following-sibling::node()"/>
8582
+ </xsl:when>
8583
+ <xsl:when test="*[local-name() = 'fmt-title']">
8584
+ <xsl:copy-of select="*[local-name() = 'fmt-title']/node()"/>
8585
+ </xsl:when>
8447
8586
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
8448
8587
  <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
8449
8588
  </xsl:when>
@@ -8550,6 +8689,15 @@
8550
8689
  </xsl:template>
8551
8690
 
8552
8691
  <xsl:template match="*[local-name() = 'name']" mode="contents_item">
8692
+ <xsl:param name="mode">bookmarks</xsl:param>
8693
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
8694
+ <xsl:apply-templates mode="contents_item">
8695
+ <xsl:with-param name="mode" select="$mode"/>
8696
+ </xsl:apply-templates>
8697
+ </xsl:if>
8698
+ </xsl:template>
8699
+
8700
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="contents_item">
8553
8701
  <xsl:param name="mode">bookmarks</xsl:param>
8554
8702
  <xsl:apply-templates mode="contents_item">
8555
8703
  <xsl:with-param name="mode" select="$mode"/>
@@ -9389,107 +9537,108 @@
9389
9537
  -->
9390
9538
  <xsl:template match="*[local-name() = 'example']">
9391
9539
 
9392
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
9393
-
9394
- <xsl:call-template name="setBlockSpanAll"/>
9540
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
9395
9541
 
9396
- <xsl:call-template name="refine_example-style"/>
9542
+ <xsl:call-template name="setBlockSpanAll"/>
9397
9543
 
9398
- <xsl:variable name="fo_element">
9399
- <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9400
- block
9401
- </xsl:variable>
9544
+ <xsl:call-template name="refine_example-style"/>
9402
9545
 
9403
- <fo:block-container margin-left="0mm" role="SKIP">
9546
+ <xsl:variable name="fo_element">
9547
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9548
+ block
9549
+ </xsl:variable>
9404
9550
 
9405
- <xsl:choose>
9551
+ <fo:block-container margin-left="0mm" role="SKIP">
9406
9552
 
9407
- <xsl:when test="contains(normalize-space($fo_element), 'block')">
9553
+ <xsl:choose>
9408
9554
 
9409
- <!-- display name 'EXAMPLE' in a separate block -->
9410
- <fo:block>
9411
- <xsl:apply-templates select="*[local-name()='name']">
9412
- <xsl:with-param name="fo_element" select="$fo_element"/>
9413
- </xsl:apply-templates>
9414
- </fo:block>
9555
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
9415
9556
 
9416
- <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9417
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9418
- <xsl:variable name="example_body">
9419
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9557
+ <!-- display name 'EXAMPLE' in a separate block -->
9558
+ <fo:block>
9559
+ <xsl:apply-templates select="*[local-name()='name']">
9420
9560
  <xsl:with-param name="fo_element" select="$fo_element"/>
9421
9561
  </xsl:apply-templates>
9422
- </xsl:variable>
9423
- <xsl:choose>
9424
- <xsl:when test="xalan:nodeset($example_body)/*">
9425
- <xsl:copy-of select="$example_body"/>
9426
- </xsl:when>
9427
- <xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
9428
- </xsl:choose>
9429
- </fo:block-container>
9430
- </fo:block-container>
9431
- </xsl:when> <!-- end block -->
9562
+ </fo:block>
9432
9563
 
9433
- <xsl:when test="contains(normalize-space($fo_element), 'list')">
9564
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9565
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9566
+ <xsl:variable name="example_body">
9567
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9568
+ <xsl:with-param name="fo_element" select="$fo_element"/>
9569
+ </xsl:apply-templates>
9570
+ </xsl:variable>
9571
+ <xsl:choose>
9572
+ <xsl:when test="xalan:nodeset($example_body)/*">
9573
+ <xsl:copy-of select="$example_body"/>
9574
+ </xsl:when>
9575
+ <xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
9576
+ </xsl:choose>
9577
+ </fo:block-container>
9578
+ </fo:block-container>
9579
+ </xsl:when> <!-- end block -->
9434
9580
 
9435
- <xsl:variable name="provisional_distance_between_starts_">
9436
- 7
9437
- </xsl:variable>
9438
- <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9439
- <xsl:variable name="indent_">
9440
- 0
9441
- </xsl:variable>
9442
- <xsl:variable name="indent" select="normalize-space($indent_)"/>
9581
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
9443
9582
 
9444
- <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9445
- <fo:list-item>
9446
- <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
9447
- <fo:block>
9448
- <xsl:apply-templates select="*[local-name()='name']">
9449
- <xsl:with-param name="fo_element">block</xsl:with-param>
9450
- </xsl:apply-templates>
9451
- </fo:block>
9452
- </fo:list-item-label>
9453
- <fo:list-item-body start-indent="body-start()">
9454
- <fo:block>
9455
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9583
+ <xsl:variable name="provisional_distance_between_starts_">
9584
+ 7
9585
+ </xsl:variable>
9586
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9587
+ <xsl:variable name="indent_">
9588
+ 0
9589
+ </xsl:variable>
9590
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
9591
+
9592
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9593
+ <fo:list-item>
9594
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
9595
+ <fo:block>
9596
+ <xsl:apply-templates select="*[local-name()='name']">
9597
+ <xsl:with-param name="fo_element">block</xsl:with-param>
9598
+ </xsl:apply-templates>
9599
+ </fo:block>
9600
+ </fo:list-item-label>
9601
+ <fo:list-item-body start-indent="body-start()">
9602
+ <fo:block>
9603
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9604
+ <xsl:with-param name="fo_element" select="$fo_element"/>
9605
+ </xsl:apply-templates>
9606
+ </fo:block>
9607
+ </fo:list-item-body>
9608
+ </fo:list-item>
9609
+ </fo:list-block>
9610
+ </xsl:when> <!-- end list -->
9611
+
9612
+ <xsl:otherwise> <!-- inline -->
9613
+
9614
+ <!-- display 'EXAMPLE' and first element in the same line -->
9615
+ <fo:block>
9616
+ <xsl:apply-templates select="*[local-name()='name']">
9617
+ <xsl:with-param name="fo_element" select="$fo_element"/>
9618
+ </xsl:apply-templates>
9619
+ <fo:inline>
9620
+ <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
9456
9621
  <xsl:with-param name="fo_element" select="$fo_element"/>
9457
9622
  </xsl:apply-templates>
9458
- </fo:block>
9459
- </fo:list-item-body>
9460
- </fo:list-item>
9461
- </fo:list-block>
9462
- </xsl:when> <!-- end list -->
9463
-
9464
- <xsl:otherwise> <!-- inline -->
9623
+ </fo:inline>
9624
+ </fo:block>
9465
9625
 
9466
- <!-- display 'EXAMPLE' and first element in the same line -->
9467
- <fo:block>
9468
- <xsl:apply-templates select="*[local-name()='name']">
9469
- <xsl:with-param name="fo_element" select="$fo_element"/>
9470
- </xsl:apply-templates>
9471
- <fo:inline>
9472
- <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
9473
- <xsl:with-param name="fo_element" select="$fo_element"/>
9474
- </xsl:apply-templates>
9475
- </fo:inline>
9476
- </fo:block>
9626
+ <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
9627
+ <!-- display further elements in blocks -->
9628
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9629
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9630
+ <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
9631
+ <xsl:with-param name="fo_element" select="'block'"/>
9632
+ </xsl:apply-templates>
9633
+ </fo:block-container>
9634
+ </fo:block-container>
9635
+ </xsl:if>
9636
+ </xsl:otherwise> <!-- end inline -->
9477
9637
 
9478
- <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
9479
- <!-- display further elements in blocks -->
9480
- <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9481
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9482
- <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
9483
- <xsl:with-param name="fo_element" select="'block'"/>
9484
- </xsl:apply-templates>
9485
- </fo:block-container>
9486
- </fo:block-container>
9487
- </xsl:if>
9488
- </xsl:otherwise> <!-- end inline -->
9638
+ </xsl:choose>
9639
+ </fo:block-container>
9640
+ </fo:block-container>
9489
9641
 
9490
- </xsl:choose>
9491
- </fo:block-container>
9492
- </fo:block-container>
9493
9642
  </xsl:template>
9494
9643
 
9495
9644
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
@@ -9873,6 +10022,15 @@
9873
10022
 
9874
10023
  </xsl:template> <!-- tab -->
9875
10024
 
10025
+ <xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
10026
+ <xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
10027
+
10028
+ <xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab">
10029
+
10030
+ <xsl:attribute name="padding-right">6mm</xsl:attribute>
10031
+
10032
+ </xsl:template>
10033
+
9876
10034
  <xsl:template name="insertNonBreakSpaces">
9877
10035
  <xsl:param name="count"/>
9878
10036
  <xsl:if test="$count &gt; 0">
@@ -11419,6 +11577,10 @@
11419
11577
  <!-- - Remove semantic xml part -->
11420
11578
  <!-- - Remove image/emf (EMF vector image for Word) -->
11421
11579
  <!-- - add @id, redundant for table auto-layout algorithm -->
11580
+ <!-- - process 'passthrough' element -->
11581
+ <!-- - split math by element with @linebreak into maths -->
11582
+ <!-- - rename fmt-title to title, fmt-name to name and another changes to convert new presentation XML to -->
11583
+ <!-- - old XML without significant changes in XSLT -->
11422
11584
  <!-- =========================================================================== -->
11423
11585
  <xsl:template match="@*|node()" mode="update_xml_step1">
11424
11586
  <xsl:copy>
@@ -11426,6 +11588,12 @@
11426
11588
  </xsl:copy>
11427
11589
  </xsl:template>
11428
11590
 
11591
+ <xsl:template match="@*|node()" mode="update_xml_pres">
11592
+ <xsl:copy>
11593
+ <xsl:apply-templates select="@*|node()" mode="update_xml_pres"/>
11594
+ </xsl:copy>
11595
+ </xsl:template>
11596
+
11429
11597
  <!-- change section's order based on @displayorder value -->
11430
11598
  <xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
11431
11599
  <xsl:copy>
@@ -11502,7 +11670,7 @@
11502
11670
  </xsl:template>
11503
11671
 
11504
11672
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
11505
- <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
11673
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
11506
11674
  <xsl:copy>
11507
11675
  <xsl:copy-of select="@*"/>
11508
11676
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -11521,14 +11689,17 @@
11521
11689
 
11522
11690
  <!-- remove semantic xml -->
11523
11691
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
11692
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_pres"/>
11524
11693
 
11525
11694
  <!-- remove image/emf -->
11526
11695
  <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
11696
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_pres"/>
11527
11697
 
11528
11698
  <!-- remove preprocess-xslt -->
11529
11699
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
11700
+ <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
11530
11701
 
11531
- <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">
11702
+ <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']) and not(.//*[local-name() = 'fmt-name'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
11532
11703
  <xsl:copy-of select="."/>
11533
11704
  </xsl:template>
11534
11705
 
@@ -11610,6 +11781,77 @@
11610
11781
  <xsl:copy-of select="$maths"/>
11611
11782
  </xsl:template>
11612
11783
 
11784
+ <!-- update new Presentation XML -->
11785
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_step1"/>
11786
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_pres"/>
11787
+ <xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_step1"/>
11788
+ <xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
11789
+ <xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
11790
+ <xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
11791
+
11792
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
11793
+ <xsl:copy>
11794
+ <xsl:apply-templates select="@*" mode="update_xml_step1"/>
11795
+ <xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
11796
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
11797
+ </xsl:copy>
11798
+ </xsl:template>
11799
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_pres">
11800
+ <xsl:copy>
11801
+ <xsl:apply-templates select="@*" mode="update_xml_pres"/>
11802
+ <xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
11803
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
11804
+ </xsl:copy>
11805
+ </xsl:template>
11806
+
11807
+ <xsl:template match="*[local-name() = 'fmt-title']"/>
11808
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
11809
+ <xsl:element name="title" namespace="{$namespace_full}">
11810
+ <xsl:copy-of select="@*"/>
11811
+ <xsl:apply-templates mode="update_xml_step1"/>
11812
+ </xsl:element>
11813
+ </xsl:template>
11814
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
11815
+ <xsl:element name="title" namespace="{$namespace_full}">
11816
+ <xsl:copy-of select="@*"/>
11817
+ <xsl:apply-templates mode="update_xml_pres"/>
11818
+ </xsl:element>
11819
+ </xsl:template>
11820
+
11821
+ <xsl:template match="*[local-name() = 'fmt-name']"/>
11822
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
11823
+ <xsl:element name="name" namespace="{$namespace_full}">
11824
+ <xsl:copy-of select="@*"/>
11825
+ <xsl:apply-templates mode="update_xml_step1"/>
11826
+ </xsl:element>
11827
+ </xsl:template>
11828
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
11829
+ <xsl:element name="name" namespace="{$namespace_full}">
11830
+ <xsl:copy-of select="@*"/>
11831
+ <xsl:apply-templates mode="update_xml_pres"/>
11832
+ </xsl:element>
11833
+ </xsl:template>
11834
+
11835
+ <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
11836
+ <xsl:apply-templates mode="update_xml_step1"/>
11837
+ </xsl:template>
11838
+ <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_pres" priority="3">
11839
+ <xsl:apply-templates mode="update_xml_pres"/>
11840
+ </xsl:template>
11841
+
11842
+ <xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
11843
+ <xsl:apply-templates mode="update_xml_step1"/>
11844
+ </xsl:template>
11845
+ <xsl:template match="*[local-name() = 'semx']" mode="update_xml_pres">
11846
+ <xsl:apply-templates mode="update_xml_pres"/>
11847
+ </xsl:template>
11848
+
11849
+ <xsl:template match="*[local-name() = 'fmt-xref-label']"/>
11850
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
11851
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
11852
+
11853
+ <!-- END: update new Presentation XML -->
11854
+
11613
11855
  <!-- =========================================================================== -->
11614
11856
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
11615
11857
  <!-- =========================================================================== -->
@@ -11802,7 +12044,7 @@
11802
12044
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
11803
12045
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
11804
12046
 
11805
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
12047
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::*[local-name() = 'name'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
11806
12048
 
11807
12049
  <xsl:variable name="parent" select="local-name(..)"/>
11808
12050
 
@@ -12381,6 +12623,7 @@
12381
12623
  </pdf:catalog>
12382
12624
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12383
12625
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12626
+ <!-- Commented after upgrade to Apache FOP 2.10
12384
12627
  <rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
12385
12628
  <pdfaExtension:schemas>
12386
12629
  <rdf:Bag>
@@ -12413,7 +12656,7 @@
12413
12656
  </rdf:li>
12414
12657
  </rdf:Bag>
12415
12658
  </pdfaExtension:schemas>
12416
- </rdf:Description>
12659
+ </rdf:Description> -->
12417
12660
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
12418
12661
  <!-- Dublin Core properties go here -->
12419
12662
  <dc:title>
@@ -12460,7 +12703,7 @@
12460
12703
  <xsl:variable name="dc_description">
12461
12704
  <xsl:variable name="abstract">
12462
12705
 
12463
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
12706
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
12464
12707
 
12465
12708
  </xsl:variable>
12466
12709
  <rdf:Alt>
@@ -13005,31 +13248,123 @@
13005
13248
 
13006
13249
  <!-- END: insert cover page image -->
13007
13250
 
13008
- <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
13251
+ <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
13252
+ <xsl:variable name="regex_ja_spec_">[
13253
+ <!-- Rotate 90° clockwise -->
13254
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
13255
+ \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
13256
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
13257
+ \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
13258
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
13259
+ \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
13260
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
13261
+ \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
13262
+ \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
13263
+ \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
13264
+ \u3010 <!-- U+3010 LEFT BLACK LENTICULAR BRACKET (【) -->
13265
+ \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
13266
+ \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
13267
+ \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
13268
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
13269
+ \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
13270
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
13271
+ \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
13272
+ \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
13273
+ \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
13274
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
13275
+ \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
13276
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
13277
+ \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
13278
+ \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
13279
+ \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
13280
+ \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
13281
+ \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
13282
+
13283
+ \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
13284
+ \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
13285
+ \u301C <!-- U+301C WAVE DASH (〜) -->
13286
+ \u3030 <!-- U+3030 WAVY DASH (〰 )-->
13287
+ \u30FC <!-- U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK (ー) -->
13288
+ \u2329 <!-- U+2329 LEFT-POINTING ANGLE BRACKET (〈) -->
13289
+ \u232A <!-- U+232A RIGHT-POINTING ANGLE BRACKET (〉) -->
13290
+ \u3018 <!-- U+3018 LEFT WHITE TORTOISE SHELL BRACKET (〘) -->
13291
+ \u3019 <!-- U+3019 RIGHT WHITE TORTOISE SHELL BRACKET (〙) -->
13292
+ \u30A0 <!-- U+30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN (゠) -->
13293
+ \uFE59 <!-- U+FE59 SMALL LEFT PARENTHESIS (﹙) -->
13294
+ \uFE5A <!-- U+FE5A SMALL RIGHT PARENTHESIS (﹚) -->
13295
+ \uFE5B <!-- U+FE5B SMALL LEFT CURLY BRACKET (﹛) -->
13296
+ \uFE5C <!-- U+FE5C SMALL RIGHT CURLY BRACKET (﹜) -->
13297
+ \uFE5D <!-- U+FE5D SMALL LEFT TORTOISE SHELL BRACKET (﹝) -->
13298
+ \uFE5E <!-- U+FE5E SMALL RIGHT TORTOISE SHELL BRACKET (﹞) -->
13299
+ \uFF5C <!-- U+FF5C FULLWIDTH VERTICAL LINE (|) -->
13300
+ \uFF5F <!-- U+FF5F FULLWIDTH LEFT WHITE PARENTHESIS (⦅) -->
13301
+ \uFF60 <!-- U+FF60 FULLWIDTH RIGHT WHITE PARENTHESIS (⦆) -->
13302
+ \uFFE3 <!-- U+FFE3 FULLWIDTH MACRON ( ̄) -->
13303
+ \uFF3F <!-- U+FF3F FULLWIDTH LOW LINE (_) -->
13304
+ \uFF5E <!-- U+FF5E FULLWIDTH TILDE (~) -->
13305
+ <!-- Rotate 180° -->
13306
+ \u309C <!-- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜) -->
13307
+ \u3002 <!-- U+3002 IDEOGRAPHIC FULL STOP (。) -->
13308
+ \uFE52 <!-- U+FE52 SMALL FULL STOP (﹒) -->
13309
+ \uFF0E <!-- U+FF0E FULLWIDTH FULL STOP (.) -->
13310
+ ]</xsl:variable>
13311
+ <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
13009
13312
  <xsl:template name="insertVerticalChar">
13010
13313
  <xsl:param name="str"/>
13011
13314
  <xsl:param name="writing-mode">lr-tb</xsl:param>
13012
13315
  <xsl:param name="reference-orientation">90</xsl:param>
13013
- <xsl:if test="string-length($str) &gt; 0">
13014
- <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">
13015
- <xsl:if test="normalize-space($writing-mode) != ''">
13016
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13017
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
13018
- </xsl:if>
13019
- <xsl:variable name="char" select="substring($str,1,1)"/>
13020
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13021
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
13316
+ <xsl:param name="add_zero_width_space">false</xsl:param>
13317
+ <xsl:choose>
13318
+ <xsl:when test="ancestor::*[local-name() = 'span'][@class = 'norotate']">
13319
+ <xsl:value-of select="$str"/>
13320
+ </xsl:when>
13321
+ <xsl:otherwise>
13322
+ <xsl:if test="string-length($str) &gt; 0">
13323
+ <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
13324
+ <xsl:variable name="char" select="substring($str,1,1)"/>
13325
+ <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">
13326
+ <xsl:if test="normalize-space($writing-mode) != ''">
13327
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13328
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13329
+ </xsl:if>
13330
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13331
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
13332
+ </xsl:if>
13333
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
13334
+ <!-- Rotate 180°:
13335
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
13336
+ U+3002 IDEOGRAPHIC FULL STOP (。)
13337
+ U+FE52 SMALL FULL STOP (﹒)
13338
+ U+FF0E FULLWIDTH FULL STOP (.)
13339
+ -->
13340
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
13341
+ </xsl:if>
13342
+ <fo:block-container width="1em">
13343
+ <fo:block line-height="1em">
13344
+ <xsl:choose>
13345
+ <xsl:when test="$horizontal_mode = 'true'">
13346
+ <xsl:value-of select="$str"/>
13347
+ </xsl:when>
13348
+ <xsl:otherwise>
13349
+ <xsl:value-of select="$char"/>
13350
+ </xsl:otherwise>
13351
+ </xsl:choose>
13352
+ </fo:block>
13353
+ </fo:block-container>
13354
+ </fo:inline-container>
13355
+ <xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}')"><xsl:value-of select="$zero_width_space"/></xsl:if>
13356
+
13357
+ <xsl:if test="$horizontal_mode = 'false'">
13358
+ <xsl:call-template name="insertVerticalChar">
13359
+ <xsl:with-param name="str" select="substring($str, 2)"/>
13360
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
13361
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13362
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
13363
+ </xsl:call-template>
13364
+ </xsl:if>
13022
13365
  </xsl:if>
13023
- <fo:block-container width="1em">
13024
- <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
13025
- </fo:block-container>
13026
- </fo:inline-container>
13027
- <xsl:call-template name="insertVerticalChar">
13028
- <xsl:with-param name="str" select="substring($str, 2)"/>
13029
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
13030
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13031
- </xsl:call-template>
13032
- </xsl:if>
13366
+ </xsl:otherwise>
13367
+ </xsl:choose>
13033
13368
  </xsl:template>
13034
13369
 
13035
13370
  <xsl:template name="number-to-words">
@@ -5,12 +5,8 @@ require "isodoc"
5
5
  module IsoDoc
6
6
  module Cc
7
7
  class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
8
- def annex1(elem)
9
- lbl = @xrefs.anchor(elem["id"], :label)
10
- if t = elem.at(ns("./title"))
11
- t.children = "<strong>#{to_xml(t.children)}</strong>"
12
- end
13
- prefix_name(elem, "<br/>", lbl, "title")
8
+ def annex_delim(_elem)
9
+ "<br/>"
14
10
  end
15
11
 
16
12
  include Init
@@ -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.4.0 -->
20
+ <!-- VERSION v1.4.1 -->
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 Cc
3
- VERSION = "2.5.6".freeze
3
+ VERSION = "2.5.7".freeze
4
4
  end
5
5
  end
data/metanorma-cc.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 2.7.2"
32
+ spec.add_dependency "metanorma-generic", "~> 2.7.3"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.6
4
+ version: 2.5.7
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-11-11 00:00:00.000000000 Z
11
+ date: 2024-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.7.2
19
+ version: 2.7.3
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.7.2
26
+ version: 2.7.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement