metanorma-cc 2.8.0 → 2.8.1

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: 7c80db3e135f995e13f7459b98f7085de83e185636f0986326bb5fe4fca86692
4
- data.tar.gz: 62ed996afcb67f966a34632724c388ba0bed95177643a76cc01c49442faffb0b
3
+ metadata.gz: fbdee3c5ec8406ed5b5874fde2171f4558e48c1d34c5fb757f4270dd8882ce37
4
+ data.tar.gz: 3ed6a8df1f9dd8540f70c72b625cbfbb70f7b98fd5462ea977b37158a457c89d
5
5
  SHA512:
6
- metadata.gz: 66312c95c05747bdc27817346a75529cfed5b90b70cde5552fbd569630ed0f18347aa8aad4fac406fb51c33cb43d58d7bd5f7c20cd70aeaf0b27e9e9abaf5f89
7
- data.tar.gz: 7007fd2f5181ea82e72a2114050ecb884053b7c9fc8729b062ef645f401fc7a8afe06a919ff2d9c6c59f357be2538cff6cbc0f0fb771f7be649a17f50275ec33
6
+ metadata.gz: 2a1aeb7a0668530f5dff2bd3c868760e6c71deeb09552ec88fa629f33989bcda8b513c3cab363a1dad4f1ac675c04a8077bd26508290482038f67dbe9063ce9c
7
+ data.tar.gz: 72d5964f39a259ca947fb68413ee9092490ec92322699410d1c11415861937dcab313aea09ab13ac4b2429bd496ed6052c8df3b9d0040b017cb5e794c81fede8
@@ -23,6 +23,7 @@
23
23
  <mnx:contents>
24
24
  <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
25
25
  <xsl:call-template name="processMainSectionsDefault_Contents"/>
26
+ <xsl:apply-templates select="//mn:indexsect" mode="contents"/>
26
27
  <xsl:call-template name="processTablesFigures_Contents"/>
27
28
  </mnx:contents>
28
29
  </xsl:variable>
@@ -117,7 +118,7 @@
117
118
  <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
118
119
  <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
119
120
  </fo:simple-page-master>
120
- <!-- Preface even pages -->
121
+ <!-- Document even pages -->
121
122
  <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
122
123
  <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
123
124
  <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
@@ -147,6 +148,27 @@
147
148
  </fo:repeatable-page-master-alternatives>
148
149
  </fo:page-sequence-master>
149
150
 
151
+ <!-- Index pages (two columns) -->
152
+ <fo:simple-page-master master-name="index-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
153
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm" xsl:use-attribute-sets="indexsect-region-body-style"/>
154
+ <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
155
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
156
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
157
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
158
+ </fo:simple-page-master>
159
+ <fo:simple-page-master master-name="index-even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
160
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm" xsl:use-attribute-sets="indexsect-region-body-style"/>
161
+ <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
162
+ <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
163
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
164
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
165
+ </fo:simple-page-master>
166
+ <fo:page-sequence-master master-name="index">
167
+ <fo:repeatable-page-master-alternatives>
168
+ <fo:conditional-page-master-reference odd-or-even="even" master-reference="index-even"/>
169
+ <fo:conditional-page-master-reference odd-or-even="odd" master-reference="index-odd"/>
170
+ </fo:repeatable-page-master-alternatives>
171
+ </fo:page-sequence-master>
150
172
  </fo:layout-master-set>
151
173
  </xsl:template> <!-- END: layout-master-set -->
152
174
 
@@ -261,6 +283,8 @@
261
283
  </xsl:for-each>
262
284
  </xsl:for-each>
263
285
 
286
+ <xsl:call-template name="index-pages"/>
287
+
264
288
  </xsl:for-each>
265
289
 
266
290
  <xsl:call-template name="back-page"/>
@@ -499,6 +523,8 @@
499
523
  </xsl:call-template>
500
524
  </xsl:variable>
501
525
 
526
+ <xsl:variable name="type" select="local-name()"/>
527
+
502
528
  <xsl:variable name="display">
503
529
  <xsl:choose>
504
530
  <xsl:when test="$level &gt; $toc_level">false</xsl:when>
@@ -526,10 +552,15 @@
526
552
  </xsl:variable>
527
553
 
528
554
  <mnx:item id="{@id}" level="{$level}" section="{$section}" display="{$display}">
555
+ <xsl:if test="$type = 'indexsect'">
556
+ <xsl:attribute name="level">1</xsl:attribute>
557
+ </xsl:if>
529
558
  <mnx:title>
530
559
  <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
531
560
  </mnx:title>
532
- <xsl:apply-templates mode="contents"/>
561
+ <xsl:if test="$type != 'indexsect'">
562
+ <xsl:apply-templates mode="contents"/>
563
+ </xsl:if>
533
564
  </mnx:item>
534
565
  </xsl:if>
535
566
 
@@ -609,20 +640,6 @@
609
640
  </xsl:if>
610
641
  </xsl:template>
611
642
 
612
- <xsl:template match="mn:fmt-xref" priority="2">
613
- <xsl:call-template name="insert_basic_link">
614
- <xsl:with-param name="element">
615
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
616
- <xsl:if test="not(starts-with(text(), 'Figure') or starts-with(text(), 'Table'))">
617
- <xsl:attribute name="color">blue</xsl:attribute>
618
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
619
- </xsl:if>
620
- <xsl:apply-templates/>
621
- </fo:basic-link>
622
- </xsl:with-param>
623
- </xsl:call-template>
624
- </xsl:template>
625
-
626
643
  <xsl:template name="insertHeaderFooter">
627
644
  <xsl:call-template name="insertHeader"/>
628
645
  <xsl:call-template name="insertFooter"/>
@@ -2148,7 +2165,23 @@
2148
2165
  <xsl:sort select="@displayorder" data-type="number"/>
2149
2166
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
2150
2167
  <xsl:attribute name="main_page_sequence"/>
2151
- <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2168
+
2169
+ <!-- from common <xsl:template name="index-pages"> -->
2170
+ <xsl:variable name="docid">
2171
+ <xsl:call-template name="getDocumentId"/>
2172
+ </xsl:variable>
2173
+
2174
+ <xsl:variable name="current_document_index_id">
2175
+ <xsl:apply-templates select="." mode="index_add_id">
2176
+ <xsl:with-param name="docid" select="$docid"/>
2177
+ </xsl:apply-templates>
2178
+ </xsl:variable>
2179
+ <xsl:variable name="current_document_index">
2180
+ <xsl:apply-templates select="xalan:nodeset($current_document_index_id)" mode="index_update"/>
2181
+ </xsl:variable>
2182
+
2183
+ <!-- xalan:nodeset($current_document_index) -->
2184
+ <xsl:apply-templates select="xalan:nodeset($current_document_index)" mode="update_xml_step_move_pagebreak"/>
2152
2185
  </xsl:element>
2153
2186
  </xsl:for-each>
2154
2187
  </xsl:template>
@@ -3186,6 +3219,7 @@
3186
3219
  </xsl:template>
3187
3220
 
3188
3221
  <xsl:attribute-set name="tt-style">
3222
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
3189
3223
  <xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
3190
3224
  </xsl:attribute-set>
3191
3225
 
@@ -4916,6 +4950,11 @@
4916
4950
  <!-- Display table's name before table as standalone block -->
4917
4951
  <!-- $namespace = 'iso' or -->
4918
4952
  <xsl:apply-templates select="mn:fmt-name"/> <!-- table's title rendered before table -->
4953
+ <xsl:if test="not(mn:fmt-name)"> <!-- for https://github.com/metanorma/mn-samples-jis/issues/75#issuecomment-3922169930 -->
4954
+ <xsl:apply-templates select="mn:name">
4955
+ <xsl:with-param name="process">true</xsl:with-param>
4956
+ </xsl:apply-templates>
4957
+ </xsl:if>
4919
4958
  <xsl:call-template name="table_name_fn_display"/>
4920
4959
 
4921
4960
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/mn:tr[1]/mn:td)"/>
@@ -5164,7 +5203,13 @@
5164
5203
  </xsl:template>
5165
5204
 
5166
5205
  <!-- table/name-->
5167
- <xsl:template match="*[local-name()='table']/mn:fmt-name">
5206
+ <xsl:template match="mn:table[not(mn:fmt-name)]/mn:name"> <!-- for https://github.com/metanorma/mn-samples-jis/issues/75#issuecomment-3922169930 -->
5207
+ <xsl:param name="process">false</xsl:param>
5208
+ <xsl:if test="$process = 'true'">
5209
+ <xsl:call-template name="table_name"/>
5210
+ </xsl:if>
5211
+ </xsl:template>
5212
+ <xsl:template match="*[local-name()='table']/mn:fmt-name" name="table_name">
5168
5213
  <xsl:param name="continued"/>
5169
5214
  <xsl:param name="cols-count"/>
5170
5215
  <xsl:if test="normalize-space() != ''">
@@ -5640,12 +5685,14 @@
5640
5685
  <xsl:param name="colwidths"/>
5641
5686
  <xsl:param name="colgroup"/>
5642
5687
 
5643
- <xsl:variable name="isNoteOrFnExist" select="../mn:note[not(@type = 'units')] or ../mn:example or ../mn:dl or ../mn:key or ..//mn:fn[not(parent::mn:fmt-name)] or ../mn:fmt-source or ../mn:p"/>
5688
+ <xsl:variable name="isNoteOrFnExist" select="../mn:note[not(@type = 'units')] or ../mn:example or ../mn:dl or ../mn:key or (..//mn:fn[not(parent::mn:fmt-name)] and not(ancestor::mn:table[1]//mn:tfoot//mn:fmt-footnote-container)) or ../mn:fmt-source or ../mn:p"/>
5689
+ <!-- in JIS fmt-footnote-container renders in tfoot, so no need render fn in the separate table -->
5644
5690
 
5645
- <xsl:variable name="isNoteOrFnExistShowAfterTable">
5691
+ <xsl:variable name="isNoteOrFnExistShowAfterTable_">
5646
5692
  </xsl:variable>
5693
+ <xsl:variable name="isNoteOrFnExistShowAfterTable" select="normalize-space($isNoteOrFnExistShowAfterTable_)"/>
5647
5694
 
5648
- <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
5695
+ <xsl:if test="$isNoteOrFnExist = 'true' or $isNoteOrFnExistShowAfterTable = 'true'">
5649
5696
 
5650
5697
  <xsl:variable name="cols-count">
5651
5698
  <xsl:choose>
@@ -7862,6 +7909,10 @@
7862
7909
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[self::mn:table or self::mn:dl])">
7863
7910
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7864
7911
  </xsl:if>
7912
+ <xsl:if test="not(starts-with(text(), 'Figure') or starts-with(text(), 'Table'))">
7913
+ <xsl:attribute name="color">blue</xsl:attribute>
7914
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
7915
+ </xsl:if>
7865
7916
  <xsl:if test="parent::mn:add">
7866
7917
  <xsl:call-template name="append_add-style"/>
7867
7918
  </xsl:if>
@@ -7881,6 +7932,18 @@
7881
7932
  </xsl:with-param>
7882
7933
  </xsl:call-template>
7883
7934
  </xsl:template> <!-- xref -->
7935
+ <xsl:template match="mn:indexsect//mn:fmt-xref[@pagenumber = 'true']" priority="2">
7936
+ <xsl:call-template name="insert_basic_link">
7937
+ <xsl:with-param name="element">
7938
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7939
+ <fo:inline>
7940
+ <xsl:copy-of select="@id"/>
7941
+ <fo:page-number-citation ref-id="{@target}"/>
7942
+ </fo:inline>
7943
+ </fo:basic-link>
7944
+ </xsl:with-param>
7945
+ </xsl:call-template>
7946
+ </xsl:template>
7884
7947
 
7885
7948
  <!-- command between two xref points to non-standard bibitem -->
7886
7949
  <xsl:template match="text()[. = ','][preceding-sibling::node()[1][self::mn:sup][mn:fmt-xref[@type = 'footnote']] and following-sibling::node()[1][self::mn:sup][mn:fmt-xref[@type = 'footnote']]]"><xsl:value-of select="."/>
@@ -11183,8 +11246,24 @@
11183
11246
  <!-- End Highlight syntax styles -->
11184
11247
 
11185
11248
  <!-- Index section styles -->
11249
+
11250
+ <xsl:attribute-set name="indexsect-region-body-style">
11251
+ <xsl:attribute name="column-count">2</xsl:attribute>
11252
+ <xsl:attribute name="column-gap">10mm</xsl:attribute>
11253
+ </xsl:attribute-set>
11254
+
11255
+ <xsl:attribute-set name="indexsect-title-block-style">
11256
+ <xsl:attribute name="role">SKIP</xsl:attribute>
11257
+ <xsl:attribute name="span">all</xsl:attribute>
11258
+ </xsl:attribute-set>
11259
+
11186
11260
  <xsl:attribute-set name="indexsect-title-style">
11187
11261
  <xsl:attribute name="role">H1</xsl:attribute>
11262
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
11263
+ <xsl:attribute name="margin-bottom">24pt</xsl:attribute>
11264
+ <xsl:attribute name="font-size">13pt</xsl:attribute>
11265
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
11266
+ <xsl:attribute name="color">rgb(14, 26, 133)</xsl:attribute>
11188
11267
  </xsl:attribute-set> <!-- indexsect-title-style -->
11189
11268
 
11190
11269
  <xsl:template name="refine_indexsect-title-style">
@@ -11210,6 +11289,44 @@
11210
11289
  </xsl:for-each>
11211
11290
  </xsl:variable>
11212
11291
 
11292
+ <xsl:template name="index-pages">
11293
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
11294
+
11295
+ <xsl:variable name="docid">
11296
+ <xsl:call-template name="getDocumentId"/>
11297
+ </xsl:variable>
11298
+
11299
+ <xsl:variable name="current_document_index_id">
11300
+ <xsl:apply-templates select="//mn:indexsect" mode="index_add_id">
11301
+ <xsl:with-param name="docid" select="$docid"/>
11302
+ </xsl:apply-templates>
11303
+ </xsl:variable>
11304
+ <xsl:variable name="current_document_index">
11305
+ <xsl:apply-templates select="xalan:nodeset($current_document_index_id)" mode="index_update"/>
11306
+ </xsl:variable>
11307
+
11308
+ <xsl:apply-templates select="xalan:nodeset($current_document_index)" mode="index">
11309
+ <xsl:with-param name="num" select="$num"/>
11310
+ </xsl:apply-templates>
11311
+ </xsl:template>
11312
+ <xsl:template match="mn:indexsect"/>
11313
+ <xsl:template match="mn:indexsect" mode="index">
11314
+ <xsl:param name="num"/>
11315
+ <fo:page-sequence master-reference="index" force-page-count="no-force">
11316
+ <xsl:call-template name="insertHeaderFooter">
11317
+ <xsl:with-param name="section">main</xsl:with-param>
11318
+ </xsl:call-template>
11319
+ <fo:flow flow-name="xsl-region-body">
11320
+ <fo:block id="{@id}" xsl:use-attribute-sets="indexsect-title-block-style">
11321
+ <xsl:apply-templates select="mn:fmt-title"/>
11322
+ </fo:block>
11323
+ <fo:block role="Index">
11324
+ <xsl:apply-templates select="*[not(self::mn:fmt-title)]"/>
11325
+ </fo:block>
11326
+ </fo:flow>
11327
+ </fo:page-sequence>
11328
+ </xsl:template>
11329
+
11213
11330
  <xsl:template match="@*|node()" mode="index_add_id">
11214
11331
  <xsl:param name="docid"/>
11215
11332
  <xsl:copy>
@@ -11262,7 +11379,7 @@
11262
11379
  <xsl:template match="mn:indexsect//mn:li" mode="index_update">
11263
11380
  <xsl:copy>
11264
11381
  <xsl:apply-templates select="@*" mode="index_update"/>
11265
- <xsl:apply-templates select="node()[not(self::mn:fmt-name)][1]" mode="process_li_element"/>
11382
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)][1]" mode="process_li_element"/>
11266
11383
  </xsl:copy>
11267
11384
  </xsl:template>
11268
11385
 
@@ -11470,11 +11587,24 @@
11470
11587
  <!-- End of Index processing -->
11471
11588
  <!-- =================== -->
11472
11589
 
11473
- <!-- =================== -->
11590
+ <xsl:attribute-set name="form-checkbox-style">
11591
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
11592
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
11593
+ </xsl:attribute-set>
11594
+
11595
+ <xsl:variable name="METANORMA_FORM_START_PREFIX">_metanorma_form_start</xsl:variable>
11596
+ <xsl:variable name="METANORMA_FORM_ITEM_PREFIX">_metanorma_form_item_</xsl:variable>
11597
+ <xsl:variable name="METANORMA_FORM_ITEM_BORDER">1pt solid black</xsl:variable>
11598
+
11599
+ <!-- =================== -->
11474
11600
  <!-- Form's elements processing -->
11475
11601
  <!-- =================== -->
11476
11602
  <xsl:template match="mn:form">
11477
11603
  <fo:block>
11604
+ <fo:inline>
11605
+ <xsl:attribute name="id"><xsl:value-of select="concat($METANORMA_FORM_START_PREFIX, '___', @id, '___', @name)"/></xsl:attribute>
11606
+ <xsl:value-of select="$hair_space"/>
11607
+ </fo:inline>
11478
11608
  <xsl:apply-templates/>
11479
11609
  </fo:block>
11480
11610
  </xsl:template>
@@ -11483,7 +11613,23 @@
11483
11613
  <fo:inline><xsl:apply-templates/></fo:inline>
11484
11614
  </xsl:template>
11485
11615
 
11486
- <xsl:template match="mn:form//mn:input[@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
11616
+ <xsl:template match="mn:form//mn:input[@type = 'text']">
11617
+ <!-- add helper id for mn2pdf class FOPIFFormsHandler (_metanorma_form_item_border_) -->
11618
+ <fo:inline>
11619
+ <xsl:call-template name="set_id_metanorma_form_item">
11620
+ <xsl:with-param name="add_border_prefix">true</xsl:with-param>
11621
+ </xsl:call-template>
11622
+ <xsl:value-of select="$hair_space"/>
11623
+ </fo:inline>
11624
+ <fo:inline border="{$METANORMA_FORM_ITEM_BORDER}"><!-- don't remove, this border needs for mn2pdf FOPIFFormsHandler -->
11625
+ <fo:inline>
11626
+ <xsl:call-template name="set_id_metanorma_form_item"/>
11627
+ <xsl:call-template name="text_input"/>
11628
+ </fo:inline>
11629
+ </fo:inline>
11630
+ </xsl:template>
11631
+
11632
+ <xsl:template match="mn:form//mn:input[@type = 'date' or @type = 'file' or @type = 'password']">
11487
11633
  <fo:inline>
11488
11634
  <xsl:call-template name="text_input"/>
11489
11635
  </fo:inline>
@@ -11515,7 +11661,20 @@
11515
11661
  </xsl:template>
11516
11662
 
11517
11663
  <xsl:template match="mn:form//mn:input[@type = 'checkbox']">
11518
- <fo:inline padding-right="1mm">
11664
+ <xsl:variable name="form_item_type">checkbox</xsl:variable>
11665
+ <!-- add helper id for mn2pdf class FOPIFFormsHandler (_metanorma_form_item_border_) -->
11666
+ <fo:inline>
11667
+ <xsl:call-template name="set_id_metanorma_form_item">
11668
+ <xsl:with-param name="form_item_type" select="$form_item_type"/>
11669
+ <xsl:with-param name="add_border_prefix">true</xsl:with-param>
11670
+ </xsl:call-template>
11671
+ <xsl:value-of select="$hair_space"/>
11672
+ </fo:inline>
11673
+
11674
+ <fo:inline border="{$METANORMA_FORM_ITEM_BORDER}"><!-- don't remove 'border', this border needs for mn2pdf FOPIFFormsHandler -->
11675
+ <xsl:call-template name="set_id_metanorma_form_item">
11676
+ <xsl:with-param name="form_item_type" select="$form_item_type"/>
11677
+ </xsl:call-template>
11519
11678
  <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
11520
11679
  <xsl:attribute name="height">3.5mm</xsl:attribute>
11521
11680
  <xsl:attribute name="content-width">100%</xsl:attribute>
@@ -11525,11 +11684,24 @@
11525
11684
  <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
11526
11685
  </svg>
11527
11686
  </fo:instream-foreign-object>
11528
- </fo:inline>
11687
+ </fo:inline><fo:inline padding-right="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
11529
11688
  </xsl:template>
11530
11689
 
11531
11690
  <xsl:template match="mn:form//mn:input[@type = 'radio']">
11532
- <fo:inline padding-right="1mm">
11691
+ <xsl:variable name="form_item_type">radiobutton</xsl:variable>
11692
+ <!-- add helper id for mn2pdf class FOPIFFormsHandler (_metanorma_form_item_border_) -->
11693
+ <fo:inline>
11694
+ <xsl:call-template name="set_id_metanorma_form_item">
11695
+ <xsl:with-param name="form_item_type" select="$form_item_type"/>
11696
+ <xsl:with-param name="add_border_prefix">true</xsl:with-param>
11697
+ </xsl:call-template>
11698
+ <xsl:value-of select="$hair_space"/>
11699
+ </fo:inline>
11700
+
11701
+ <fo:inline border="{$METANORMA_FORM_ITEM_BORDER}"><!-- don't remove 'border', this border needs for mn2pdf FOPIFFormsHandler -->
11702
+ <xsl:call-template name="set_id_metanorma_form_item">
11703
+ <xsl:with-param name="form_item_type" select="$form_item_type"/>
11704
+ </xsl:call-template>
11533
11705
  <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
11534
11706
  <xsl:attribute name="height">3.5mm</xsl:attribute>
11535
11707
  <xsl:attribute name="content-width">100%</xsl:attribute>
@@ -11541,6 +11713,7 @@
11541
11713
  </svg>
11542
11714
  </fo:instream-foreign-object>
11543
11715
  </fo:inline>
11716
+ <fo:inline padding-right="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
11544
11717
  </xsl:template>
11545
11718
 
11546
11719
  <xsl:template match="mn:form//mn:select">
@@ -11550,11 +11723,28 @@
11550
11723
  </xsl:template>
11551
11724
 
11552
11725
  <xsl:template match="mn:form//mn:textarea">
11553
- <fo:block-container border="1pt solid black" width="50%">
11726
+ <fo:block-container border="{$METANORMA_FORM_ITEM_BORDER}" width="50%">
11554
11727
  <fo:block> </fo:block>
11555
11728
  </fo:block-container>
11556
11729
  </xsl:template>
11557
11730
 
11731
+ <xsl:template name="set_id_metanorma_form_item">
11732
+ <xsl:param name="form_item_type">textfield</xsl:param>
11733
+ <xsl:param name="add_border_prefix">false</xsl:param>
11734
+ <xsl:variable name="border_prefix"><xsl:if test="normalize-space($add_border_prefix) = 'true'">border_</xsl:if></xsl:variable>
11735
+ <xsl:if test="@id">
11736
+ <!-- _metanorma_form_item_border____form_item_type___id___name___value -->
11737
+ <!-- split by '___': [2] - form_item_type, [3] - id, [4] - name, [5] - value -->
11738
+ <xsl:variable name="value">
11739
+ <xsl:choose>
11740
+ <xsl:when test="@type = 'checkbox'"><xsl:value-of select="normalize-space(@checked = 'true')"/><!-- true or false --></xsl:when>
11741
+ <xsl:otherwise><xsl:value-of select="@value"/></xsl:otherwise>
11742
+ </xsl:choose>
11743
+ </xsl:variable>
11744
+ <xsl:attribute name="id"><xsl:value-of select="concat($METANORMA_FORM_ITEM_PREFIX, $border_prefix, '___', $form_item_type, '___', @id, '___', @name, '___', $value)"/></xsl:attribute>
11745
+ </xsl:if>
11746
+ </xsl:template>
11747
+
11558
11748
  <!-- =================== -->
11559
11749
  <!-- End Form's elements processing -->
11560
11750
  <!-- =================== -->
@@ -11607,6 +11797,7 @@
11607
11797
  </xsl:template>
11608
11798
 
11609
11799
  <xsl:attribute-set name="toc-pagenumber-style">
11800
+ <xsl:attribute name="role">SKIP</xsl:attribute>
11610
11801
  </xsl:attribute-set>
11611
11802
 
11612
11803
  <xsl:template name="refine_toc-pagenumber-style">
@@ -13444,7 +13635,12 @@
13444
13635
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
13445
13636
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
13446
13637
  <xsl:choose>
13447
- <xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
13638
+ <xsl:when test="$internal-destination = 'true'">
13639
+ <fo:wrapper role="Reference">
13640
+ <xsl:copy-of select="$element_node"/>
13641
+ </fo:wrapper>
13642
+ </xsl:when>
13643
+ <xsl:when test="$external-destination = 'true'">
13448
13644
  <xsl:copy-of select="$element_node"/>
13449
13645
  </xsl:when>
13450
13646
  <xsl:otherwise>
@@ -920,20 +920,24 @@ p.Biblio::before, p.NormRef::before {
920
920
  padding-right: 1em;
921
921
  }
922
922
 
923
+ .Biblio.note, .Biblio.Note, .NormRef.note, .NormRef.Note {
924
+ margin-left: 2em;
925
+ }
926
+
923
927
  /* Blocks */
924
- .figure .FigureTitle, .figure .figure-title {
928
+ figure figcaption {
925
929
  font-weight: 700;
926
930
  font-size: 1em;
927
931
  text-align: center;
928
932
  }
929
- .figure > img, .figure > svg {
933
+ figure > img, figure > svg {
930
934
  margin-left: auto;
931
935
  margin-right: auto;
932
936
  display: block;
933
937
  max-width: 100%;
934
938
  height: auto;
935
939
  }
936
- .figure {
940
+ figure {
937
941
  line-height: 1.6em;
938
942
  padding: 1.5em;
939
943
  margin: 2em 0 1em 0;
@@ -942,7 +946,7 @@ p.Biblio::before, p.NormRef::before {
942
946
  font-variant-ligatures: none;
943
947
  }
944
948
 
945
- table div.figure {
949
+ table figure {
946
950
  padding: 0;
947
951
  margin: 0;
948
952
  }
@@ -1105,7 +1109,7 @@ table table.plain, table table.plain th, table table.plain td {
1105
1109
  font-size: 0.95em;
1106
1110
  }
1107
1111
 
1108
- p.TableTitle {
1112
+ table > caption {
1109
1113
  text-align: center;
1110
1114
  margin-top: 2.5em;
1111
1115
  font-weight: 400;
@@ -207,15 +207,19 @@ p.Biblio::before, p.NormRef::before {
207
207
  padding-right: 1em;
208
208
  }
209
209
 
210
+ .Biblio.note, .Biblio.Note, .NormRef.note, .NormRef.Note {
211
+ margin-left: 2em;
212
+ }
213
+
210
214
 
211
215
  /* Blocks */
212
216
 
213
- .figure {
217
+ figure {
214
218
  @include figureBlock();
215
219
  @include monospaceBlockStyle();
216
220
  }
217
221
 
218
- table div.figure {
222
+ table figure {
219
223
  padding: 0;
220
224
  margin: 0;
221
225
  }
@@ -322,7 +326,7 @@ table {
322
326
  @include table($border: 1px solid black);
323
327
  }
324
328
 
325
- p.TableTitle {
329
+ table > caption {
326
330
  text-align: center;
327
331
  margin-top: 2.5em;
328
332
  font-weight: 400;
@@ -208,11 +208,15 @@ Applicable to modify and delete</a:documentation>
208
208
  </zeroOrMore>
209
209
  <optional>
210
210
  <element name="newcontent">
211
- <a:documentation>New content to be added to the document; applicable to add and modify</a:documentation>
211
+ <a:documentation>New content to be added to the document; applicable to add and modify.
212
+ Can be blocks and/or sections</a:documentation>
212
213
  <ref name="OptionalId"/>
213
214
  <zeroOrMore>
214
215
  <ref name="BasicBlock"/>
215
216
  </zeroOrMore>
217
+ <zeroOrMore>
218
+ <ref name="section"/>
219
+ </zeroOrMore>
216
220
  </element>
217
221
  </optional>
218
222
  <zeroOrMore>
@@ -0,0 +1,7 @@
1
+ module Metanorma
2
+ module Cc
3
+ class Cleanup < Metanorma::Generic::Cleanup
4
+ extend Forwardable
5
+ end
6
+ end
7
+ end
@@ -3,9 +3,8 @@ require "isodoc/cc/html_convert"
3
3
  require "isodoc/cc/word_convert"
4
4
  require "isodoc/cc/presentation_xml_convert"
5
5
  require "metanorma/cc"
6
- require "metanorma/standoc/converter"
6
+ require "metanorma-standoc"
7
7
  require "metanorma/generic/converter"
8
- require_relative "validate_section"
9
8
 
10
9
  module Metanorma
11
10
  module Cc
@@ -3,7 +3,7 @@ require "metanorma-generic"
3
3
 
4
4
  module Metanorma
5
5
  module Cc
6
- class Converter < Metanorma::Generic::Converter
6
+ class Validate < Metanorma::Generic::Validate
7
7
  def section_validate(doc)
8
8
  advisory = doc.root.at("//bibdata/ext[doctype = 'advisory']")
9
9
  symbols_validate(doc.root) unless advisory
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Cc
3
- VERSION = "2.8.0".freeze
3
+ VERSION = "2.8.1".freeze
4
4
  end
5
5
  end
data/lib/metanorma-cc.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "metanorma/cc/converter"
3
+ require_relative "metanorma/cc/cleanup"
4
+ require_relative "metanorma/cc/validate"
3
5
  require_relative "isodoc/cc/html_convert"
4
6
  require_relative "isodoc/cc/word_convert"
5
7
  require_relative "isodoc/cc/pdf_convert"
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", "~> 3.2.3"
32
+ spec.add_dependency "metanorma-generic", "~> 3.3.0"
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.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-02-16 00:00:00.000000000 Z
11
+ date: 2026-03-02 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: 3.2.3
19
+ version: 3.3.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: 3.2.3
26
+ version: 3.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -244,13 +244,14 @@ files:
244
244
  - lib/metanorma/cc/biblio.rng
245
245
  - lib/metanorma/cc/boilerplate.adoc
246
246
  - lib/metanorma/cc/cc.rng
247
+ - lib/metanorma/cc/cleanup.rb
247
248
  - lib/metanorma/cc/converter.rb
248
249
  - lib/metanorma/cc/isodoc.rng
249
250
  - lib/metanorma/cc/log.rb
250
251
  - lib/metanorma/cc/processor.rb
251
252
  - lib/metanorma/cc/relaton-cc.rng
252
253
  - lib/metanorma/cc/reqt.rng
253
- - lib/metanorma/cc/validate_section.rb
254
+ - lib/metanorma/cc/validate.rb
254
255
  - lib/metanorma/cc/version.rb
255
256
  - metanorma-cc.gemspec
256
257
  - metanorma.yml