metanorma-jis 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 574989410bb84b64ddf0f8d84a69835f2279d2127c305a1bd41176f58fb380c7
4
- data.tar.gz: 0175b5c4a42e1a88ce815d34a88da818054fa90336a8452decc2392ecf8652c4
3
+ metadata.gz: 413ce76333c43d3e720d8a6f99deb65ba896f4a37ef1e18d9aac3e335afae58e
4
+ data.tar.gz: 4b9f704a85a0f2337ecf6cc39f0f5dd55fce70350d9ed7d1d5ec06c9c8cf5460
5
5
  SHA512:
6
- metadata.gz: 82be9f3e0d0f86c80b1ab7c8ec8fccc535a675a2213bb4491ba7ee8bcd34ac0acb2cac908963462678fa8a310cda82fef4c2d20d59f02c0d7ee62b2802b46fb3
7
- data.tar.gz: a1bc7aa00489850f3ded8328f3cd2ce9d46438557ad6b9c977ed839806f6cec7a9ed77ab9bc5c551be6a07ff14642fb4498b60656954461178ff6c47acb45545
6
+ metadata.gz: 1175113eecfc11a79aecfbc4762d51dcbb1078c60532cde52de5f367aefc1c1d33dcb66b7ed45cd7228eaff2d6d56b237ea2e5b73ad3db23c4678dca6e6e8968
7
+ data.tar.gz: bfb468a5b9e14e0bbef57d38b5846da5389ce970437aed9ba86bbeaa39c3cfc75309cfeafac85018d67dac5f588b75d15e8c67d2a573df46c77f4c5510e3cd95
@@ -126,6 +126,31 @@
126
126
  </fo:repeatable-page-master-alternatives>
127
127
  </fo:page-sequence-master>
128
128
 
129
+ <fo:simple-page-master master-name="commentary_first_page_even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
130
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
131
+ <fo:region-before region-name="header-commentary-even-first" extent="{$marginTop}mm"/>
132
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
133
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
134
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
135
+ </fo:simple-page-master>
136
+
137
+ <fo:simple-page-master master-name="commentary_first_page_odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
138
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
139
+ <fo:region-before region-name="header-commentary-odd-first" extent="{$marginTop}mm"/>
140
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
141
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
142
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
143
+ </fo:simple-page-master>
144
+
145
+ <fo:page-sequence-master master-name="document_commentary_section">
146
+ <fo:repeatable-page-master-alternatives>
147
+ <fo:conditional-page-master-reference page-position="first" odd-or-even="even" master-reference="commentary_first_page_even"/>
148
+ <fo:conditional-page-master-reference page-position="first" odd-or-even="odd" master-reference="commentary_first_page_odd"/>
149
+ <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/>
150
+ <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/>
151
+ </fo:repeatable-page-master-alternatives>
152
+ </fo:page-sequence-master>
153
+
129
154
  <!-- landscape -->
130
155
  <fo:simple-page-master master-name="odd-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
131
156
  <fo:region-body margin-top="{$marginLeftRight1}mm" margin-bottom="{$marginLeftRight2}mm" margin-left="{$marginBottom}mm" margin-right="{$marginTop}mm"/>
@@ -348,14 +373,15 @@
348
373
  </item>
349
374
 
350
375
  <!-- Annexes -->
351
- <xsl:for-each select="/*/*[local-name()='annex']">
376
+ <!-- <xsl:for-each select="/*/*[local-name()='annex']">
352
377
  <item>
353
378
  <xsl:apply-templates select="." mode="linear_xml"/>
354
379
  </item>
355
- </xsl:for-each>
380
+ </xsl:for-each> -->
356
381
 
357
- <!-- Bibliography -->
358
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0 and not(@hidden = 'true')]">
382
+ <!-- Annexes and Bibliography -->
383
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0 and not(@hidden = 'true')]">
384
+ <xsl:sort select="@displayorder" data-type="number"/>
359
385
  <item><xsl:apply-templates select="." mode="linear_xml"/></item>
360
386
  </xsl:for-each>
361
387
 
@@ -382,6 +408,9 @@
382
408
  <!-- paged_xml=<xsl:copy-of select="$paged_xml"/> -->
383
409
 
384
410
  <xsl:for-each select="xalan:nodeset($paged_xml)/*[local-name()='page'][*]">
411
+
412
+ <xsl:variable name="isCommentary" select="normalize-space(.//jis:annex[@commentary = 'true'] and 1 = 1)"/> <!-- true or false -->
413
+ <!-- DEBUG: <xsl:copy-of select="."/> -->
385
414
  <fo:page-sequence master-reference="document" force-page-count="no-force">
386
415
  <xsl:if test="position() = 1">
387
416
  <xsl:attribute name="master-reference">document_first_section</xsl:attribute>
@@ -389,6 +418,9 @@
389
418
  <xsl:if test="@orientation = 'landscape'">
390
419
  <xsl:attribute name="master-reference">document-<xsl:value-of select="@orientation"/></xsl:attribute>
391
420
  </xsl:if>
421
+ <xsl:if test="$isCommentary = 'true'">
422
+ <xsl:attribute name="master-reference">document_commentary_section</xsl:attribute>
423
+ </xsl:if>
392
424
  <xsl:if test="position() = 1">
393
425
  <xsl:attribute name="initial-page-number">1</xsl:attribute>
394
426
  </xsl:if>
@@ -398,10 +430,31 @@
398
430
  </fo:block>
399
431
  </fo:static-content>
400
432
 
433
+ <xsl:variable name="section_title">
434
+ <xsl:if test="$isCommentary = 'true'">
435
+ <fo:inline font-family="IPAexGothic" padding-left="2mm">
436
+ <xsl:text> </xsl:text>
437
+ <xsl:call-template name="getLocalizedString">
438
+ <xsl:with-param name="key">commentary</xsl:with-param>
439
+ </xsl:call-template>
440
+ </fo:inline>
441
+ </xsl:if>
442
+ </xsl:variable>
443
+
444
+ <xsl:variable name="section">
445
+ <xsl:choose>
446
+ <xsl:when test="$isCommentary = 'true'">commentary</xsl:when>
447
+ <xsl:otherwise>main</xsl:otherwise>
448
+ </xsl:choose>
449
+ </xsl:variable>
450
+
401
451
  <xsl:call-template name="insertHeaderFooter">
402
452
  <xsl:with-param name="docidentifier" select="$docidentifier"/>
403
453
  <xsl:with-param name="copyrightText" select="$copyrightText"/>
404
- <xsl:with-param name="section">main</xsl:with-param>
454
+ <xsl:with-param name="section" select="$section"/>
455
+ <xsl:with-param name="section_title">
456
+ <xsl:copy-of select="$section_title"/>
457
+ </xsl:with-param>
405
458
  </xsl:call-template>
406
459
 
407
460
  <fo:flow flow-name="xsl-region-body">
@@ -446,6 +499,20 @@
446
499
 
447
500
  </xsl:if>
448
501
 
502
+ <!-- Annex Commentary first page -->
503
+ <xsl:if test="$isCommentary = 'true'">
504
+
505
+ <!-- Example: JIS Z 8301:2019 -->
506
+ <fo:block font-family="IPAexGothic" font-size="15pt" text-align="center">
507
+ <fo:inline font-family="Arial">JIS <xsl:value-of select="$docidentifier_number"/></fo:inline>
508
+ <fo:inline baseline-shift="10%"><fo:inline font-size="10pt">:</fo:inline>
509
+ <fo:inline font-family="Times New Roman" font-size="10pt"><xsl:value-of select="$docidentifier_year"/></fo:inline></fo:inline>
510
+ </fo:block>
511
+
512
+ <!-- title -->
513
+ <fo:block role="H1" font-family="IPAexGothic" font-size="16pt" text-align="center" margin-top="6mm"><xsl:value-of select="$title_ja"/></fo:block>
514
+ </xsl:if>
515
+
449
516
  <xsl:apply-templates select="*" mode="page"/>
450
517
 
451
518
  </fo:flow>
@@ -488,9 +555,7 @@
488
555
  <xsl:for-each select="$contents/doc[@num = $num]//item[@display = 'true'][@level &lt;= $toc_level or @type='figure' or @type = 'table']">
489
556
  <fo:block role="TOCI">
490
557
  <xsl:choose>
491
- <xsl:when test="@type = 'bibliography'">
492
- </xsl:when>
493
- <xsl:when test="@type = 'annex'">
558
+ <xsl:when test="@type = 'annex' or @type = 'bibliography'">
494
559
  <fo:block space-after="5pt">
495
560
  <xsl:call-template name="insertTocItem"/>
496
561
  </fo:block>
@@ -559,6 +624,10 @@
559
624
  </fo:block>
560
625
  </xsl:template>
561
626
 
627
+ <!-- docidentifier, 3 part: number, colon and year-->
628
+ <xsl:variable name="docidentifier_jis" select="/*/jis:bibdata/jis:docidentifier[@type = 'JIS']"/>
629
+ <xsl:variable name="docidentifier_number" select="java:replaceAll(java:java.lang.String.new($docidentifier_jis), '^(.*)(:)(.*)$', '$1')"/>
630
+ <xsl:variable name="docidentifier_year" select="java:replaceAll(java:java.lang.String.new($docidentifier_jis), '^(.*)(:)(.*)$', '$3')"/>
562
631
  <xsl:template name="insertCoverPage">
563
632
  <xsl:param name="num"/>
564
633
  <xsl:param name="copyrightText"/>
@@ -578,10 +647,6 @@
578
647
  <fo:block-container text-align="center">
579
648
  <!-- title -->
580
649
  <fo:block role="H1" font-family="IPAexGothic" font-size="22pt" margin-top="27mm"><xsl:apply-templates select="/*/jis:bibdata/jis:title[@language = 'ja' and @type = 'main']/node()"/></fo:block>
581
- <!-- docidentifier, 3 part: number, colon and year-->
582
- <xsl:variable name="docidentifier" select="/*/jis:bibdata/jis:docidentifier[@type = 'JIS']"/>
583
- <xsl:variable name="docidentifier_number" select="java:replaceAll(java:java.lang.String.new($docidentifier), '^(.*)(:)(.*)$', '$1')"/>
584
- <xsl:variable name="docidentifier_year" select="java:replaceAll(java:java.lang.String.new($docidentifier), '^(.*)(:)(.*)$', '$3')"/>
585
650
 
586
651
  <fo:block font-family="IPAexGothic" font-size="20pt" margin-top="15mm">
587
652
  <fo:inline font-family="Arial">JIS <xsl:value-of select="$docidentifier_number"/></fo:inline>
@@ -777,6 +842,7 @@
777
842
  <xsl:choose>
778
843
  <xsl:when test="@type = 'section-title'">18pt</xsl:when>
779
844
  <xsl:when test="@ancestor = 'foreword' and $level = '1'">14pt</xsl:when>
845
+ <xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[1][local-name() = 'annex' and @commentary = 'true']">16pt</xsl:when>
780
846
  <xsl:when test="@ancestor = 'annex' and $level = '1'">14pt</xsl:when>
781
847
  <!-- <xsl:when test="@ancestor = 'foreword' and $level &gt;= '2'">12pt</xsl:when>
782
848
  <xsl:when test=". = 'Executive summary'">18pt</xsl:when>
@@ -813,6 +879,7 @@
813
879
  <xsl:variable name="margin-top">
814
880
  <xsl:choose>
815
881
  <xsl:when test="@ancestor = 'foreword' and $level = 1">9mm</xsl:when>
882
+ <xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[1][local-name() = 'annex' and @commentary = 'true']">1mm</xsl:when>
816
883
  <xsl:when test="$level = 1">6.5mm</xsl:when>
817
884
  <xsl:when test="@ancestor = 'foreword' and $level = 2">0mm</xsl:when>
818
885
  <xsl:when test="@ancestor = 'annex' and $level = 2">4.5mm</xsl:when>
@@ -833,6 +900,7 @@
833
900
  <xsl:variable name="margin-bottom">
834
901
  <xsl:choose>
835
902
  <xsl:when test="@ancestor = 'foreword' and $level = 1">9mm</xsl:when>
903
+ <xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[1][local-name() = 'annex' and @commentary = 'true']">7mm</xsl:when>
836
904
  <xsl:when test="$level = 1 and following-sibling::jis:clause">8pt</xsl:when>
837
905
  <xsl:when test="$level = 1">12pt</xsl:when>
838
906
  <xsl:when test="$level = 2 and following-sibling::jis:clause">8pt</xsl:when>
@@ -1011,17 +1079,8 @@
1011
1079
  <xsl:call-template name="append_add-style"/>
1012
1080
  </xsl:if>
1013
1081
 
1014
- <xsl:variable name="list_item_label_">
1015
- <xsl:call-template name="getListItemFormat"/>
1016
- </xsl:variable>
1017
-
1018
1082
  <xsl:variable name="list_item_label">
1019
- <xsl:choose>
1020
- <xsl:when test="(../@type = 'arabic' or ../@type = 'alphabet' or ../@type = 'alphabetic' or ../@type = 'roman') and not(java:endsWith(java:java.lang.String.new($list_item_label_),')'))">
1021
- <xsl:value-of select="concat($list_item_label_, ')')"/>
1022
- </xsl:when>
1023
- <xsl:otherwise><xsl:value-of select="$list_item_label_"/></xsl:otherwise>
1024
- </xsl:choose>
1083
+ <xsl:call-template name="getListItemFormat"/>
1025
1084
  </xsl:variable>
1026
1085
 
1027
1086
  <xsl:choose>
@@ -1300,7 +1359,7 @@
1300
1359
  </fo:static-content>
1301
1360
  <fo:static-content flow-name="header-odd" role="artifact">
1302
1361
  <fo:block-container font-family="Arial" font-size="9pt" height="26mm" display-align="after" text-align="right">
1303
- <xsl:if test="$section = 'main'"><fo:block><fo:page-number/></fo:block></xsl:if>
1362
+ <xsl:if test="$section = 'main' or $section = 'commentary'"><fo:block><fo:page-number/></fo:block></xsl:if>
1304
1363
  <fo:block>
1305
1364
  <xsl:copy-of select="$docidentifier"/>
1306
1365
  <xsl:copy-of select="$section_title"/>
@@ -1309,13 +1368,28 @@
1309
1368
  </fo:static-content>
1310
1369
  <fo:static-content flow-name="header-even" role="artifact">
1311
1370
  <fo:block-container font-family="Arial" font-size="9pt" height="26mm" display-align="after">
1312
- <xsl:if test="$section = 'main'"><fo:block><fo:page-number/></fo:block></xsl:if>
1371
+ <xsl:if test="$section = 'main' or $section = 'commentary'"><fo:block><fo:page-number/></fo:block></xsl:if>
1313
1372
  <fo:block>
1314
1373
  <xsl:copy-of select="$docidentifier"/>
1315
1374
  <xsl:copy-of select="$section_title"/>
1316
1375
  </fo:block>
1317
1376
  </fo:block-container>
1318
1377
  </fo:static-content>
1378
+
1379
+ <fo:static-content flow-name="header-commentary-even-first" role="artifact">
1380
+ <fo:block-container font-family="Arial" font-size="9pt" height="26mm" display-align="after" text-align="left">
1381
+ <fo:block><fo:page-number/></fo:block>
1382
+ <fo:block> </fo:block>
1383
+ </fo:block-container>
1384
+ </fo:static-content>
1385
+
1386
+ <fo:static-content flow-name="header-commentary-odd-first" role="artifact">
1387
+ <fo:block-container font-family="Arial" font-size="9pt" height="26mm" display-align="after" text-align="right">
1388
+ <fo:block><fo:page-number/></fo:block>
1389
+ <fo:block> </fo:block>
1390
+ </fo:block-container>
1391
+ </fo:static-content>
1392
+
1319
1393
  <xsl:call-template name="insertFooter">
1320
1394
  <xsl:with-param name="section" select="$section"/>
1321
1395
  <xsl:with-param name="copyrightText" select="$copyrightText"/>
@@ -1330,6 +1404,16 @@
1330
1404
  <xsl:if test="$section = 'preface'">
1331
1405
  <fo:block font-size="9pt" text-align="center" space-after="10pt">(<fo:inline font-family="Times New Roman"><fo:page-number/></fo:inline>)</fo:block>
1332
1406
  </xsl:if>
1407
+ <xsl:if test="$section = 'commentary'">
1408
+ <fo:block font-size="9pt" text-align="center" space-after="12pt">
1409
+ <fo:inline font-family="IPAexGothic" padding-right="3mm">
1410
+ <xsl:call-template name="getLocalizedString">
1411
+ <xsl:with-param name="key">commentary_page</xsl:with-param>
1412
+ </xsl:call-template>
1413
+ </fo:inline>
1414
+ <fo:inline font-weight="bold" font-family="Times New Roman" id="_independent_page_number_commentary"><fo:page-number/></fo:inline>
1415
+ </fo:block>
1416
+ </xsl:if>
1333
1417
  <!-- copyright restriction -->
1334
1418
  <fo:block font-size="7pt" text-align="center" font-family="IPAexMincho" margin-bottom="13mm"><xsl:value-of select="$copyrightText"/></fo:block>
1335
1419
  </fo:block-container>
@@ -2355,6 +2439,10 @@
2355
2439
  </xsl:attribute-set> <!-- formula-stem-number-style -->
2356
2440
  <!-- End Formula's styles -->
2357
2441
 
2442
+ <xsl:template name="refine_formula-stem-number-style">
2443
+
2444
+ </xsl:template>
2445
+
2358
2446
  <xsl:attribute-set name="image-style">
2359
2447
  <xsl:attribute name="text-align">center</xsl:attribute>
2360
2448
 
@@ -2835,13 +2923,13 @@
2835
2923
 
2836
2924
  <xsl:template name="processPrefaceSectionsDefault_Contents">
2837
2925
  <xsl:variable name="nodes_preface_">
2838
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2926
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
2839
2927
  <node id="{@id}"/>
2840
2928
  </xsl:for-each>
2841
2929
  </xsl:variable>
2842
2930
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2843
2931
 
2844
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2932
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
2845
2933
  <xsl:sort select="@displayorder" data-type="number"/>
2846
2934
 
2847
2935
  <!-- process Section's title -->
@@ -2875,12 +2963,12 @@
2875
2963
  <xsl:apply-templates select="." mode="contents"/>
2876
2964
  </xsl:for-each>
2877
2965
 
2878
- <xsl:for-each select="/*/*[local-name()='annex']">
2966
+ <!-- <xsl:for-each select="/*/*[local-name()='annex']">
2879
2967
  <xsl:sort select="@displayorder" data-type="number"/>
2880
2968
  <xsl:apply-templates select="." mode="contents"/>
2881
- </xsl:for-each>
2969
+ </xsl:for-each> -->
2882
2970
 
2883
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0]">
2971
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0]">
2884
2972
  <xsl:sort select="@displayorder" data-type="number"/>
2885
2973
  <xsl:apply-templates select="." mode="contents"/>
2886
2974
  </xsl:for-each>
@@ -3358,7 +3446,7 @@
3358
3446
  <xsl:param name="continued"/>
3359
3447
  <xsl:if test="normalize-space() != ''">
3360
3448
 
3361
- <fo:block xsl:use-attribute-sets="table-name-style">
3449
+ <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
3362
3450
 
3363
3451
  <xsl:call-template name="refine_table-name-style">
3364
3452
  <xsl:with-param name="continued" select="$continued"/>
@@ -3743,8 +3831,8 @@
3743
3831
  <xsl:template name="table-header-title">
3744
3832
  <xsl:param name="cols-count"/>
3745
3833
  <!-- row for title -->
3746
- <fo:table-row>
3747
- <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
3834
+ <fo:table-row role="SKIP">
3835
+ <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black" role="SKIP">
3748
3836
 
3749
3837
  <xsl:call-template name="refine_table-header-title-style"/>
3750
3838
 
@@ -3753,7 +3841,7 @@
3753
3841
  </xsl:apply-templates>
3754
3842
 
3755
3843
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
3756
- <fo:block/>
3844
+ <fo:block role="SKIP"/>
3757
3845
  </xsl:if>
3758
3846
 
3759
3847
  </fo:table-cell>
@@ -4064,7 +4152,7 @@
4064
4152
 
4065
4153
  <xsl:call-template name="refine_table-header-cell-style"/>
4066
4154
 
4067
- <fo:block>
4155
+ <fo:block role="SKIP">
4068
4156
  <xsl:apply-templates/>
4069
4157
  </fo:block>
4070
4158
  </fo:table-cell>
@@ -4117,7 +4205,7 @@
4117
4205
  <xsl:attribute name="text-align">left</xsl:attribute>
4118
4206
  </xsl:if>
4119
4207
 
4120
- <fo:block>
4208
+ <fo:block role="SKIP">
4121
4209
 
4122
4210
  <xsl:if test="$isGenerateTableIF = 'true'">
4123
4211
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -4996,7 +5084,7 @@
4996
5084
  -->
4997
5085
  <fo:table-row>
4998
5086
  <fo:table-cell number-columns-spanned="2">
4999
- <fo:block>
5087
+ <fo:block role="SKIP">
5000
5088
  <xsl:call-template name="note"/>
5001
5089
  </fo:block>
5002
5090
  </fo:table-cell>
@@ -5061,7 +5149,7 @@
5061
5149
 
5062
5150
  <xsl:call-template name="refine_dt-cell-style"/>
5063
5151
 
5064
- <fo:block xsl:use-attribute-sets="dt-block-style">
5152
+ <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
5065
5153
  <xsl:copy-of select="@id"/>
5066
5154
 
5067
5155
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -5091,7 +5179,7 @@
5091
5179
 
5092
5180
  <xsl:call-template name="refine_dd-cell-style"/>
5093
5181
 
5094
- <fo:block>
5182
+ <fo:block role="SKIP">
5095
5183
 
5096
5184
  <xsl:if test="$isGenerateTableIF = 'true'">
5097
5185
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -5466,11 +5554,41 @@
5466
5554
 
5467
5555
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5468
5556
  <xsl:variable name="text" select="normalize-space(.)"/>
5469
- <fo:inline font-size="75%">
5557
+ <fo:inline font-size="75%" role="SKIP">
5470
5558
  <xsl:if test="string-length($text) &gt; 0">
5471
- <xsl:call-template name="recursiveSmallCaps">
5472
- <xsl:with-param name="text" select="$text"/>
5473
- </xsl:call-template>
5559
+ <xsl:variable name="smallCapsText">
5560
+ <xsl:call-template name="recursiveSmallCaps">
5561
+ <xsl:with-param name="text" select="$text"/>
5562
+ </xsl:call-template>
5563
+ </xsl:variable>
5564
+ <!-- merge neighboring fo:inline -->
5565
+ <xsl:for-each select="xalan:nodeset($smallCapsText)/node()">
5566
+ <xsl:choose>
5567
+ <xsl:when test="self::fo:inline and preceding-sibling::node()[1][self::fo:inline]"><!-- <xsl:copy-of select="."/> --></xsl:when>
5568
+ <xsl:when test="self::fo:inline and @font-size">
5569
+ <xsl:variable name="curr_pos" select="count(preceding-sibling::node()) + 1"/>
5570
+ <!-- <curr_pos><xsl:value-of select="$curr_pos"/></curr_pos> -->
5571
+ <xsl:variable name="next_text_" select="count(following-sibling::node()[not(local-name() = 'inline')][1]/preceding-sibling::node())"/>
5572
+ <xsl:variable name="next_text">
5573
+ <xsl:choose>
5574
+ <xsl:when test="$next_text_ = 0">99999999</xsl:when>
5575
+ <xsl:otherwise><xsl:value-of select="$next_text_ + 1"/></xsl:otherwise>
5576
+ </xsl:choose>
5577
+ </xsl:variable>
5578
+ <!-- <next_text><xsl:value-of select="$next_text"/></next_text> -->
5579
+ <fo:inline>
5580
+ <xsl:copy-of select="@*"/>
5581
+ <xsl:copy-of select="./node()"/>
5582
+ <xsl:for-each select="following-sibling::node()[position() &lt; $next_text - $curr_pos]"> <!-- [self::fo:inline] -->
5583
+ <xsl:copy-of select="./node()"/>
5584
+ </xsl:for-each>
5585
+ </fo:inline>
5586
+ </xsl:when>
5587
+ <xsl:otherwise>
5588
+ <xsl:copy-of select="."/>
5589
+ </xsl:otherwise>
5590
+ </xsl:choose>
5591
+ </xsl:for-each>
5474
5592
  </xsl:if>
5475
5593
  </fo:inline>
5476
5594
  </xsl:template>
@@ -5482,7 +5600,7 @@
5482
5600
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
5483
5601
  <xsl:choose>
5484
5602
  <xsl:when test="$char=$upperCase">
5485
- <fo:inline font-size="{100 div 0.75}%">
5603
+ <fo:inline font-size="{100 div 0.75}%" role="SKIP">
5486
5604
  <xsl:value-of select="$upperCase"/>
5487
5605
  </fo:inline>
5488
5606
  </xsl:when>
@@ -5648,6 +5766,10 @@
5648
5766
 
5649
5767
  <xsl:when test="not(contains($text, $separator))">
5650
5768
  <word>
5769
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5770
+ <xsl:text>
5771
+  </xsl:text> <!-- to add distance between dt and dd -->
5772
+ </xsl:if>
5651
5773
  <xsl:call-template name="enclose_text_in_tags">
5652
5774
  <xsl:with-param name="text" select="normalize-space($text)"/>
5653
5775
  <xsl:with-param name="tags" select="$tags"/>
@@ -5656,6 +5778,10 @@
5656
5778
  </xsl:when>
5657
5779
  <xsl:otherwise>
5658
5780
  <word>
5781
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5782
+ <xsl:text>
5783
+  </xsl:text> <!-- to add distance between dt and dd -->
5784
+ </xsl:if>
5659
5785
  <xsl:call-template name="enclose_text_in_tags">
5660
5786
  <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
5661
5787
  <xsl:with-param name="tags" select="$tags"/>
@@ -5839,6 +5965,10 @@
5839
5965
  <xsl:template name="getSimpleTable">
5840
5966
  <xsl:param name="id"/>
5841
5967
 
5968
+ <!-- <test0>
5969
+ <xsl:copy-of select="."/>
5970
+ </test0> -->
5971
+
5842
5972
  <xsl:variable name="simple-table">
5843
5973
 
5844
5974
  <!-- Step 0. replace <br/> to <p>...</p> -->
@@ -6884,7 +7014,7 @@
6884
7014
  <fo:table-body>
6885
7015
  <fo:table-row>
6886
7016
  <fo:table-cell display-align="center">
6887
- <fo:block xsl:use-attribute-sets="formula-stem-block-style">
7017
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">
6888
7018
 
6889
7019
  <xsl:call-template name="refine_formula-stem-block-style"/>
6890
7020
 
@@ -6892,7 +7022,10 @@
6892
7022
  </fo:block>
6893
7023
  </fo:table-cell>
6894
7024
  <fo:table-cell display-align="center">
6895
- <fo:block xsl:use-attribute-sets="formula-stem-number-style">
7025
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
7026
+
7027
+ <xsl:call-template name="refine_formula-stem-number-style"/>
7028
+
6896
7029
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
6897
7030
  </fo:block>
6898
7031
  </fo:table-cell>
@@ -8395,7 +8528,7 @@
8395
8528
  <!-- second td with sourcecode -->
8396
8529
  <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8397
8530
  <fo:table-cell>
8398
- <fo:block>
8531
+ <fo:block role="SKIP">
8399
8532
  <xsl:apply-templates/>
8400
8533
  </fo:block>
8401
8534
  </fo:table-cell>
@@ -8882,7 +9015,7 @@
8882
9015
 
8883
9016
  <xsl:call-template name="setTableCellAttributes"/>
8884
9017
 
8885
- <fo:block>
9018
+ <fo:block role="SKIP">
8886
9019
  <xsl:apply-templates/>
8887
9020
  </fo:block>
8888
9021
  </fo:table-cell>
@@ -8904,7 +9037,7 @@
8904
9037
 
8905
9038
  <xsl:call-template name="setTableCellAttributes"/>
8906
9039
 
8907
- <fo:block>
9040
+ <fo:block role="SKIP">
8908
9041
  <xsl:apply-templates/>
8909
9042
  </fo:block>
8910
9043
  </fo:table-cell>
@@ -9671,7 +9804,48 @@
9671
9804
  </xsl:choose>
9672
9805
  </xsl:when>
9673
9806
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
9674
- <xsl:value-of select="@label"/>
9807
+
9808
+ <xsl:variable name="label">
9809
+
9810
+ <xsl:variable name="type" select="../@type"/>
9811
+
9812
+ <xsl:variable name="style_prefix_">
9813
+ <xsl:if test="$type = 'roman'">
9814
+ <!-- Example: (i) -->
9815
+ </xsl:if>
9816
+ </xsl:variable>
9817
+ <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
9818
+
9819
+ <xsl:variable name="style_suffix_">
9820
+ <xsl:choose>
9821
+ <xsl:when test="$type = 'arabic'">
9822
+ )
9823
+ </xsl:when>
9824
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
9825
+ )
9826
+ </xsl:when>
9827
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
9828
+ .
9829
+ </xsl:when>
9830
+ <xsl:when test="$type = 'roman'">
9831
+ )
9832
+ </xsl:when>
9833
+ <xsl:when test="$type = 'roman_upper'">.</xsl:when> <!-- Example: I. -->
9834
+ </xsl:choose>
9835
+ </xsl:variable>
9836
+ <xsl:variable name="style_suffix" select="normalize-space($style_suffix_)"/>
9837
+
9838
+ <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
9839
+ <xsl:value-of select="$style_prefix"/>
9840
+ </xsl:if>
9841
+ <xsl:value-of select="@label"/>
9842
+ <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
9843
+ <xsl:value-of select="$style_suffix"/>
9844
+ </xsl:if>
9845
+ </xsl:variable>
9846
+
9847
+ <xsl:value-of select="normalize-space($label)"/>
9848
+
9675
9849
  </xsl:when>
9676
9850
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
9677
9851
 
@@ -9871,7 +10045,7 @@
9871
10045
  <xsl:call-template name="refine_list-item-style"/>
9872
10046
 
9873
10047
  <fo:list-item-label end-indent="label-end()">
9874
- <fo:block xsl:use-attribute-sets="list-item-label-style">
10048
+ <fo:block xsl:use-attribute-sets="list-item-label-style" role="SKIP">
9875
10049
 
9876
10050
  <xsl:call-template name="refine_list-item-label-style"/>
9877
10051
 
@@ -9885,7 +10059,7 @@
9885
10059
  </fo:block>
9886
10060
  </fo:list-item-label>
9887
10061
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9888
- <fo:block>
10062
+ <fo:block role="SKIP">
9889
10063
 
9890
10064
  <xsl:call-template name="refine_list-item-body-style"/>
9891
10065
 
@@ -10164,10 +10338,10 @@
10164
10338
  <fo:table-body>
10165
10339
  <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
10166
10340
 
10167
- <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
10168
- <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
10169
- <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
10170
- <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
10341
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Date</fo:block></fo:table-cell>
10342
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Type</fo:block></fo:table-cell>
10343
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Change</fo:block></fo:table-cell>
10344
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Pages</fo:block></fo:table-cell>
10171
10345
  </fo:table-row>
10172
10346
  <xsl:apply-templates/>
10173
10347
  </fo:table-body>
@@ -10182,7 +10356,7 @@
10182
10356
 
10183
10357
  <xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
10184
10358
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
10185
- <fo:block><xsl:apply-templates/></fo:block>
10359
+ <fo:block role="SKIP"><xsl:apply-templates/></fo:block>
10186
10360
  </fo:table-cell>
10187
10361
  </xsl:template>
10188
10362
  <!-- ============ -->
@@ -10267,8 +10441,8 @@
10267
10441
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
10268
10442
  <fo:list-item>
10269
10443
  <fo:list-item-label end-indent="label-end()">
10270
- <fo:block>
10271
- <fo:inline>
10444
+ <fo:block role="SKIP">
10445
+ <fo:inline role="SKIP">
10272
10446
 
10273
10447
  <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10274
10448
  <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
@@ -10277,7 +10451,7 @@
10277
10451
  </fo:block>
10278
10452
  </fo:list-item-label>
10279
10453
  <fo:list-item-body start-indent="body-start()">
10280
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
10454
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10281
10455
  <xsl:call-template name="processBibitem">
10282
10456
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10283
10457
  </xsl:call-template>
@@ -10498,7 +10672,7 @@
10498
10672
  <xsl:for-each select="*[local-name() = 'tab']">
10499
10673
  <xsl:variable name="current_id" select="generate-id()"/>
10500
10674
  <fo:table-cell>
10501
- <fo:block line-height-shift-adjustment="disregard-shifts">
10675
+ <fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
10502
10676
  <xsl:call-template name="insert_basic_link">
10503
10677
  <xsl:with-param name="element">
10504
10678
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -10516,7 +10690,7 @@
10516
10690
  </xsl:for-each>
10517
10691
  <!-- last column - for page numbers -->
10518
10692
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
10519
- <fo:block>
10693
+ <fo:block role="SKIP">
10520
10694
  <xsl:call-template name="insert_basic_link">
10521
10695
  <xsl:with-param name="element">
10522
10696
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module JIS
3
- VERSION = "0.0.7".freeze
3
+ VERSION = "0.0.8".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-05 00:00:00.000000000 Z
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso