metanorma-iso 2.8.6 → 2.8.7

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: ddb53f2b57b43d15c8642f188c78935c617cb9d6171f29d52ee81b8cfb14b988
4
- data.tar.gz: d170b0caf5967ebfa44259a9c76353d2ea9ebeef591e6c48fa82e4144c14b192
3
+ metadata.gz: 1a1decc1f961cb0dcf05ae91afaaf5af40ad2d9d1efc0d5a2ba735a4b99588fc
4
+ data.tar.gz: ea50bf0571dc8897676140515cb3525823f8000c49abe40b800c9735768136e1
5
5
  SHA512:
6
- metadata.gz: 585acab1303c34a7ac8b3b081262f425f6d5dceec79378172be4b77f07db26dd7a78680fda017dc4fdac72792d222daa55c87ebd7ba2c9a560838b66350422d2
7
- data.tar.gz: e1d4ba3749ae6de29bd312a2022594736f65afcf43364a48fe96810f09b019a3392eab054d6c19c862723434e07964470b66f3b3b37f739d8590a0bb780b6547
6
+ metadata.gz: 49415b45e7fc9272e220effbaaca8b115225a96602f8feaa377617072f698e3b2c55e45acdf5d898372601f3c35c3c4efe41b29728a42aa1255da2b854f3b633
7
+ data.tar.gz: 68b815821be72ede1dad90453dbf1943394b73aaef47df340ad08dc56b422801b45d2095930b50d9f81a69deeea47edcc9c471a034f34c38daca28d6486eb220
@@ -82,6 +82,9 @@ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
82
82
  p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
83
83
  font-size: {{monospacefontsize}}; }
84
84
 
85
+ sub, sup {
86
+ font-size: 0.75em; }
87
+
85
88
  article, aside, details, figcaption, figure,
86
89
  footer, header, hgroup, menu, nav, section {
87
90
  display: block; }
@@ -82,6 +82,9 @@ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
82
82
  p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
83
83
  font-size: {{monospacefontsize}}; }
84
84
 
85
+ sub, sup {
86
+ font-size: 0.75em; }
87
+
85
88
  article, aside, details, figcaption, figure,
86
89
  footer, header, hgroup, menu, nav, section {
87
90
  display: block; }
@@ -1438,6 +1438,7 @@
1438
1438
 
1439
1439
  <xsl:template name="insertCoverPage">
1440
1440
  <xsl:if test="$isGenerateTableIF = 'false'"> <!-- no need cover page for auto-layout algorithm -->
1441
+ <xsl:variable name="fo_cover_page">
1441
1442
  <!-- cover page -->
1442
1443
  <xsl:choose>
1443
1444
  <xsl:when test="$layoutVersion = '1951'">
@@ -1752,7 +1753,7 @@
1752
1753
  <!-- International
1753
1754
  Standard -->
1754
1755
  <fo:table-cell number-columns-spanned="2" padding-left="6mm">
1755
- <fo:block-container height="46mm">
1756
+ <fo:block-container height="46mm" role="SKIP">
1756
1757
  <fo:block font-size="20pt" font-weight="bold" line-height="1.25" margin-top="3mm">
1757
1758
 
1758
1759
  <xsl:variable name="updates-document-type" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:updates-document-type"/>
@@ -1816,8 +1817,7 @@
1816
1817
 
1817
1818
  <fo:table-row height="46mm">
1818
1819
  <fo:table-cell number-columns-spanned="2" border-right="{$cover_page_border}">
1819
- <fo:block>
1820
- </fo:block>
1820
+ <fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
1821
1821
  </fo:table-cell>
1822
1822
  <fo:table-cell number-columns-spanned="2" display-align="after" padding-left="6mm">
1823
1823
  <fo:block font-size="19pt" font-weight="bold" line-height="1">
@@ -1830,12 +1830,12 @@
1830
1830
  </fo:table-row>
1831
1831
 
1832
1832
  <fo:table-row height="1.4mm" font-size="0pt">
1833
- <fo:table-cell border-bottom="{$cover_page_border}"><fo:block> </fo:block></fo:table-cell>
1834
- <fo:table-cell number-columns-spanned="2"><fo:block> </fo:block></fo:table-cell>
1835
- <fo:table-cell border-bottom="{$cover_page_border}"><fo:block> </fo:block></fo:table-cell>
1833
+ <fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
1834
+ <fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
1835
+ <fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
1836
1836
  </fo:table-row>
1837
1837
  <fo:table-row height="1.4mm" font-size="0pt">
1838
- <fo:table-cell number-columns-spanned="4"><fo:block> </fo:block></fo:table-cell>
1838
+ <fo:table-cell number-columns-spanned="4"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
1839
1839
  </fo:table-row>
1840
1840
 
1841
1841
  <fo:table-row>
@@ -1870,7 +1870,7 @@
1870
1870
  </fo:block-container>
1871
1871
  </fo:table-cell>
1872
1872
  <fo:table-cell number-columns-spanned="2" padding-left="6mm">
1873
- <fo:block margin-top="2.5mm" line-height="1.1">
1873
+ <fo:block margin-top="2.5mm" line-height="1.1" role="SKIP">
1874
1874
 
1875
1875
  <xsl:if test="not($stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM')">
1876
1876
  <xsl:variable name="edition_and_date">
@@ -2509,7 +2509,7 @@
2509
2509
  </fo:block>
2510
2510
  </fo:block-container>
2511
2511
  </fo:flow>
2512
- </xsl:otherwise>
2512
+ </xsl:otherwise>
2513
2513
  </xsl:choose>
2514
2514
 
2515
2515
  </fo:page-sequence>
@@ -2709,7 +2709,11 @@
2709
2709
  </fo:page-sequence>
2710
2710
  </xsl:otherwise>
2711
2711
  </xsl:choose>
2712
- </xsl:if> <!-- $isGenerateTableIF = ' false' -->
2712
+ </xsl:variable>
2713
+
2714
+ <xsl:apply-templates select="xalan:nodeset($fo_cover_page)" mode="set_table_role_skip"/>
2715
+
2716
+ </xsl:if> <!-- $isGenerateTableIF = 'false' -->
2713
2717
  </xsl:template> <!-- END insertCoverPage -->
2714
2718
 
2715
2719
  <xsl:template match="iso:preface/iso:introduction" mode="update_xml_step1" priority="3">
@@ -4833,6 +4837,7 @@
4833
4837
  <xsl:template name="insertLastPage_2024">
4834
4838
  <fo:page-sequence master-reference="last-page_2024" force-page-count="no-force">
4835
4839
  <fo:flow flow-name="xsl-region-body">
4840
+ <xsl:variable name="fo_last_page">
4836
4841
  <fo:table table-layout="fixed" width="100%" margin-bottom="-1mm">
4837
4842
  <xsl:call-template name="insertInterFont"/>
4838
4843
  <fo:table-column column-width="proportional-column-width(73)"/>
@@ -4846,15 +4851,15 @@
4846
4851
  <xsl:call-template name="insertLogoImages2024"/>
4847
4852
  </fo:block>
4848
4853
  </fo:table-cell>
4849
- <fo:table-cell number-columns-spanned="2"><fo:block> </fo:block></fo:table-cell>
4854
+ <fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4850
4855
  </fo:table-row>
4851
4856
  <fo:table-row height="1.4mm" font-size="0pt">
4852
- <fo:table-cell border-bottom="{$cover_page_border}"><fo:block> </fo:block></fo:table-cell>
4853
- <fo:table-cell number-columns-spanned="2"><fo:block> </fo:block></fo:table-cell>
4854
- <fo:table-cell border-bottom="{$cover_page_border}"><fo:block> </fo:block></fo:table-cell>
4857
+ <fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4858
+ <fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4859
+ <fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4855
4860
  </fo:table-row>
4856
4861
  <fo:table-row height="2mm" font-size="0pt">
4857
- <fo:table-cell number-columns-spanned="4"><fo:block> </fo:block></fo:table-cell>
4862
+ <fo:table-cell number-columns-spanned="4"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4858
4863
  </fo:table-row>
4859
4864
  <fo:table-row height="182mm"> <!-- 174 -->
4860
4865
  <fo:table-cell number-columns-spanned="2" display-align="after" border-right="{$cover_page_border}">
@@ -4890,6 +4895,8 @@
4890
4895
  </fo:table-row>
4891
4896
  </fo:table-body>
4892
4897
  </fo:table>
4898
+ </xsl:variable>
4899
+ <xsl:apply-templates select="xalan:nodeset($fo_last_page)" mode="set_table_role_skip"/>
4893
4900
  </fo:flow>
4894
4901
  </fo:page-sequence>
4895
4902
  </xsl:template> <!-- END: insertLastPage_2024 -->
@@ -5080,7 +5087,7 @@
5080
5087
  </xsl:template>
5081
5088
 
5082
5089
  <xsl:template name="insertLastBlock">
5083
- <fo:block id="lastBlock" font-size="1pt" keep-with-previous="always" role="SKIP"> </fo:block>
5090
+ <fo:block id="lastBlock" font-size="1pt" keep-with-previous="always" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
5084
5091
  </xsl:template>
5085
5092
 
5086
5093
  <xsl:strip-space elements="iso:xref"/>
@@ -8596,6 +8603,7 @@
8596
8603
 
8597
8604
  <fo:block role="SKIP">
8598
8605
  <xsl:apply-templates/>
8606
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
8599
8607
  </fo:block>
8600
8608
  </fo:table-cell>
8601
8609
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -8659,6 +8667,8 @@
8659
8667
 
8660
8668
  <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
8661
8669
 
8670
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
8671
+
8662
8672
  </fo:block>
8663
8673
  </fo:table-cell>
8664
8674
  </xsl:template> <!-- td -->
@@ -11557,14 +11567,16 @@
11557
11567
  <xsl:template match="*[local-name()='link']" name="link">
11558
11568
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
11559
11569
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
11570
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
11560
11571
  <xsl:variable name="target">
11561
11572
  <xsl:choose>
11562
11573
  <xsl:when test="@updatetype = 'true'">
11563
11574
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
11564
11575
  </xsl:when>
11565
11576
  <!-- link to the PDF attachment -->
11566
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
11567
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
11577
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
11578
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
11579
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
11568
11580
  </xsl:when>
11569
11581
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
11570
11582
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -11595,6 +11607,11 @@
11595
11607
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
11596
11608
  </xsl:if>
11597
11609
 
11610
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
11611
+ <xsl:attribute name="color">inherit</xsl:attribute>
11612
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
11613
+ </xsl:if>
11614
+
11598
11615
  <xsl:call-template name="refine_link-style"/>
11599
11616
 
11600
11617
  <xsl:choose>
@@ -11605,6 +11622,9 @@
11605
11622
  <xsl:call-template name="insert_basic_link">
11606
11623
  <xsl:with-param name="element">
11607
11624
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
11625
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
11626
+ <xsl:attribute name="role">Annot</xsl:attribute>
11627
+ </xsl:if>
11608
11628
  <xsl:choose>
11609
11629
  <xsl:when test="normalize-space(.) = ''">
11610
11630
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -11617,6 +11637,10 @@
11617
11637
  </xsl:otherwise>
11618
11638
  </xsl:choose>
11619
11639
  </fo:basic-link>
11640
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
11641
+ <!-- reserve space at right for PaperClip icon -->
11642
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
11643
+ </xsl:if>
11620
11644
  </xsl:with-param>
11621
11645
  </xsl:call-template>
11622
11646
  </xsl:otherwise>
@@ -17293,9 +17317,14 @@
17293
17317
  </x:xmpmeta>
17294
17318
  <!-- add attachments -->
17295
17319
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
17296
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
17297
-
17298
- <pdf:embedded-file filename="{@name}">
17320
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
17321
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
17322
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
17323
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
17324
+ <!-- Todo: need update -->
17325
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
17326
+
17327
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
17299
17328
  <xsl:attribute name="src">
17300
17329
  <xsl:choose>
17301
17330
  <xsl:when test="normalize-space() != ''">
@@ -17311,18 +17340,27 @@
17311
17340
  <xsl:if test="$description != ''">
17312
17341
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
17313
17342
  </xsl:if>
17343
+ <xsl:if test="$afrelationship != ''">
17344
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
17345
+ </xsl:if>
17314
17346
  </pdf:embedded-file>
17315
17347
  </xsl:for-each>
17316
17348
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
17317
17349
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
17318
17350
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
17319
17351
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
17352
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
17320
17353
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
17321
17354
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
17322
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
17355
+ <!-- Todo: need update -->
17356
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
17357
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
17323
17358
  <xsl:if test="$description != ''">
17324
17359
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
17325
17360
  </xsl:if>
17361
+ <xsl:if test="$afrelationship != ''">
17362
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
17363
+ </xsl:if>
17326
17364
  </pdf:embedded-file>
17327
17365
  </xsl:for-each>
17328
17366
  </xsl:if>
@@ -17342,6 +17380,12 @@
17342
17380
  <!-- Get or calculate depth of the element -->
17343
17381
  <xsl:template name="getLevel">
17344
17382
  <xsl:param name="depth"/>
17383
+ <!-- <xsl:message>
17384
+ <xsl:choose>
17385
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
17386
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
17387
+ </xsl:choose>
17388
+ </xsl:message> -->
17345
17389
  <xsl:choose>
17346
17390
  <xsl:when test="normalize-space(@depth) != ''">
17347
17391
  <xsl:value-of select="@depth"/>
@@ -17362,8 +17406,27 @@
17362
17406
  <xsl:when test="ancestor::*[local-name() = 'preface']">
17363
17407
  <xsl:value-of select="$level_total - 2"/>
17364
17408
  </xsl:when>
17409
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
17410
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
17411
+ <xsl:choose>
17412
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
17413
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
17414
+ </xsl:when>
17415
+ <xsl:otherwise>
17416
+ <xsl:value-of select="$level_total - 2"/>
17417
+ </xsl:otherwise>
17418
+ </xsl:choose>
17419
+ </xsl:when>
17365
17420
  <xsl:when test="ancestor::*[local-name() = 'sections']">
17366
- <xsl:value-of select="$level_total - 1"/>
17421
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
17422
+ <xsl:choose>
17423
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
17424
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
17425
+ </xsl:when>
17426
+ <xsl:otherwise>
17427
+ <xsl:value-of select="$level_total - 1"/>
17428
+ </xsl:otherwise>
17429
+ </xsl:choose>
17367
17430
  </xsl:when>
17368
17431
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
17369
17432
  <xsl:value-of select="$level_total - 1"/>
@@ -17371,6 +17434,17 @@
17371
17434
  <xsl:when test="parent::*[local-name() = 'annex']">
17372
17435
  <xsl:value-of select="$level_total - 1"/>
17373
17436
  </xsl:when>
17437
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
17438
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
17439
+ <xsl:choose>
17440
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
17441
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
17442
+ </xsl:when>
17443
+ <xsl:otherwise>
17444
+ <xsl:value-of select="$level_total - 1"/>
17445
+ </xsl:otherwise>
17446
+ </xsl:choose>
17447
+ </xsl:when>
17374
17448
  <xsl:when test="ancestor::*[local-name() = 'annex']">
17375
17449
  <xsl:value-of select="$level_total"/>
17376
17450
  </xsl:when>
@@ -17729,6 +17803,20 @@
17729
17803
 
17730
17804
  <!-- END: insert cover page image -->
17731
17805
 
17806
+ <xsl:template name="insertVerticalChar">
17807
+ <xsl:param name="str"/>
17808
+ <xsl:if test="string-length($str) &gt; 0">
17809
+ <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
17810
+ <fo:block-container width="1em">
17811
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
17812
+ </fo:block-container>
17813
+ </fo:inline-container>
17814
+ <xsl:call-template name="insertVerticalChar">
17815
+ <xsl:with-param name="str" select="substring($str, 2)"/>
17816
+ </xsl:call-template>
17817
+ </xsl:if>
17818
+ </xsl:template>
17819
+
17732
17820
  <xsl:template name="number-to-words">
17733
17821
  <xsl:param name="number"/>
17734
17822
  <xsl:param name="first"/>
@@ -18016,4 +18104,18 @@
18016
18104
  </xsl:if>
18017
18105
  </xsl:template>
18018
18106
 
18107
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
18108
+ <xsl:copy>
18109
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
18110
+ </xsl:copy>
18111
+ </xsl:template>
18112
+
18113
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
18114
+ <xsl:copy>
18115
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
18116
+ <xsl:attribute name="role">SKIP</xsl:attribute>
18117
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
18118
+ </xsl:copy>
18119
+ </xsl:template>
18120
+
18019
18121
  </xsl:stylesheet>
@@ -1438,6 +1438,7 @@
1438
1438
 
1439
1439
  <xsl:template name="insertCoverPage">
1440
1440
  <xsl:if test="$isGenerateTableIF = 'false'"> <!-- no need cover page for auto-layout algorithm -->
1441
+ <xsl:variable name="fo_cover_page">
1441
1442
  <!-- cover page -->
1442
1443
  <xsl:choose>
1443
1444
  <xsl:when test="$layoutVersion = '1951'">
@@ -1752,7 +1753,7 @@
1752
1753
  <!-- International
1753
1754
  Standard -->
1754
1755
  <fo:table-cell number-columns-spanned="2" padding-left="6mm">
1755
- <fo:block-container height="46mm">
1756
+ <fo:block-container height="46mm" role="SKIP">
1756
1757
  <fo:block font-size="20pt" font-weight="bold" line-height="1.25" margin-top="3mm">
1757
1758
 
1758
1759
  <xsl:variable name="updates-document-type" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:updates-document-type"/>
@@ -1816,8 +1817,7 @@
1816
1817
 
1817
1818
  <fo:table-row height="46mm">
1818
1819
  <fo:table-cell number-columns-spanned="2" border-right="{$cover_page_border}">
1819
- <fo:block>
1820
- </fo:block>
1820
+ <fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
1821
1821
  </fo:table-cell>
1822
1822
  <fo:table-cell number-columns-spanned="2" display-align="after" padding-left="6mm">
1823
1823
  <fo:block font-size="19pt" font-weight="bold" line-height="1">
@@ -1830,12 +1830,12 @@
1830
1830
  </fo:table-row>
1831
1831
 
1832
1832
  <fo:table-row height="1.4mm" font-size="0pt">
1833
- <fo:table-cell border-bottom="{$cover_page_border}"><fo:block> </fo:block></fo:table-cell>
1834
- <fo:table-cell number-columns-spanned="2"><fo:block> </fo:block></fo:table-cell>
1835
- <fo:table-cell border-bottom="{$cover_page_border}"><fo:block> </fo:block></fo:table-cell>
1833
+ <fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
1834
+ <fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
1835
+ <fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
1836
1836
  </fo:table-row>
1837
1837
  <fo:table-row height="1.4mm" font-size="0pt">
1838
- <fo:table-cell number-columns-spanned="4"><fo:block> </fo:block></fo:table-cell>
1838
+ <fo:table-cell number-columns-spanned="4"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
1839
1839
  </fo:table-row>
1840
1840
 
1841
1841
  <fo:table-row>
@@ -1870,7 +1870,7 @@
1870
1870
  </fo:block-container>
1871
1871
  </fo:table-cell>
1872
1872
  <fo:table-cell number-columns-spanned="2" padding-left="6mm">
1873
- <fo:block margin-top="2.5mm" line-height="1.1">
1873
+ <fo:block margin-top="2.5mm" line-height="1.1" role="SKIP">
1874
1874
 
1875
1875
  <xsl:if test="not($stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM')">
1876
1876
  <xsl:variable name="edition_and_date">
@@ -2509,7 +2509,7 @@
2509
2509
  </fo:block>
2510
2510
  </fo:block-container>
2511
2511
  </fo:flow>
2512
- </xsl:otherwise>
2512
+ </xsl:otherwise>
2513
2513
  </xsl:choose>
2514
2514
 
2515
2515
  </fo:page-sequence>
@@ -2709,7 +2709,11 @@
2709
2709
  </fo:page-sequence>
2710
2710
  </xsl:otherwise>
2711
2711
  </xsl:choose>
2712
- </xsl:if> <!-- $isGenerateTableIF = ' false' -->
2712
+ </xsl:variable>
2713
+
2714
+ <xsl:apply-templates select="xalan:nodeset($fo_cover_page)" mode="set_table_role_skip"/>
2715
+
2716
+ </xsl:if> <!-- $isGenerateTableIF = 'false' -->
2713
2717
  </xsl:template> <!-- END insertCoverPage -->
2714
2718
 
2715
2719
  <xsl:template match="iso:preface/iso:introduction" mode="update_xml_step1" priority="3">
@@ -4833,6 +4837,7 @@
4833
4837
  <xsl:template name="insertLastPage_2024">
4834
4838
  <fo:page-sequence master-reference="last-page_2024" force-page-count="no-force">
4835
4839
  <fo:flow flow-name="xsl-region-body">
4840
+ <xsl:variable name="fo_last_page">
4836
4841
  <fo:table table-layout="fixed" width="100%" margin-bottom="-1mm">
4837
4842
  <xsl:call-template name="insertInterFont"/>
4838
4843
  <fo:table-column column-width="proportional-column-width(73)"/>
@@ -4846,15 +4851,15 @@
4846
4851
  <xsl:call-template name="insertLogoImages2024"/>
4847
4852
  </fo:block>
4848
4853
  </fo:table-cell>
4849
- <fo:table-cell number-columns-spanned="2"><fo:block> </fo:block></fo:table-cell>
4854
+ <fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4850
4855
  </fo:table-row>
4851
4856
  <fo:table-row height="1.4mm" font-size="0pt">
4852
- <fo:table-cell border-bottom="{$cover_page_border}"><fo:block> </fo:block></fo:table-cell>
4853
- <fo:table-cell number-columns-spanned="2"><fo:block> </fo:block></fo:table-cell>
4854
- <fo:table-cell border-bottom="{$cover_page_border}"><fo:block> </fo:block></fo:table-cell>
4857
+ <fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4858
+ <fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4859
+ <fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4855
4860
  </fo:table-row>
4856
4861
  <fo:table-row height="2mm" font-size="0pt">
4857
- <fo:table-cell number-columns-spanned="4"><fo:block> </fo:block></fo:table-cell>
4862
+ <fo:table-cell number-columns-spanned="4"><fo:block role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block></fo:table-cell>
4858
4863
  </fo:table-row>
4859
4864
  <fo:table-row height="182mm"> <!-- 174 -->
4860
4865
  <fo:table-cell number-columns-spanned="2" display-align="after" border-right="{$cover_page_border}">
@@ -4890,6 +4895,8 @@
4890
4895
  </fo:table-row>
4891
4896
  </fo:table-body>
4892
4897
  </fo:table>
4898
+ </xsl:variable>
4899
+ <xsl:apply-templates select="xalan:nodeset($fo_last_page)" mode="set_table_role_skip"/>
4893
4900
  </fo:flow>
4894
4901
  </fo:page-sequence>
4895
4902
  </xsl:template> <!-- END: insertLastPage_2024 -->
@@ -5080,7 +5087,7 @@
5080
5087
  </xsl:template>
5081
5088
 
5082
5089
  <xsl:template name="insertLastBlock">
5083
- <fo:block id="lastBlock" font-size="1pt" keep-with-previous="always" role="SKIP"> </fo:block>
5090
+ <fo:block id="lastBlock" font-size="1pt" keep-with-previous="always" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
5084
5091
  </xsl:template>
5085
5092
 
5086
5093
  <xsl:strip-space elements="iso:xref"/>
@@ -8596,6 +8603,7 @@
8596
8603
 
8597
8604
  <fo:block role="SKIP">
8598
8605
  <xsl:apply-templates/>
8606
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
8599
8607
  </fo:block>
8600
8608
  </fo:table-cell>
8601
8609
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -8659,6 +8667,8 @@
8659
8667
 
8660
8668
  <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
8661
8669
 
8670
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
8671
+
8662
8672
  </fo:block>
8663
8673
  </fo:table-cell>
8664
8674
  </xsl:template> <!-- td -->
@@ -11557,14 +11567,16 @@
11557
11567
  <xsl:template match="*[local-name()='link']" name="link">
11558
11568
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
11559
11569
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
11570
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
11560
11571
  <xsl:variable name="target">
11561
11572
  <xsl:choose>
11562
11573
  <xsl:when test="@updatetype = 'true'">
11563
11574
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
11564
11575
  </xsl:when>
11565
11576
  <!-- link to the PDF attachment -->
11566
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
11567
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
11577
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
11578
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
11579
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
11568
11580
  </xsl:when>
11569
11581
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
11570
11582
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -11595,6 +11607,11 @@
11595
11607
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
11596
11608
  </xsl:if>
11597
11609
 
11610
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
11611
+ <xsl:attribute name="color">inherit</xsl:attribute>
11612
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
11613
+ </xsl:if>
11614
+
11598
11615
  <xsl:call-template name="refine_link-style"/>
11599
11616
 
11600
11617
  <xsl:choose>
@@ -11605,6 +11622,9 @@
11605
11622
  <xsl:call-template name="insert_basic_link">
11606
11623
  <xsl:with-param name="element">
11607
11624
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
11625
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
11626
+ <xsl:attribute name="role">Annot</xsl:attribute>
11627
+ </xsl:if>
11608
11628
  <xsl:choose>
11609
11629
  <xsl:when test="normalize-space(.) = ''">
11610
11630
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -11617,6 +11637,10 @@
11617
11637
  </xsl:otherwise>
11618
11638
  </xsl:choose>
11619
11639
  </fo:basic-link>
11640
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
11641
+ <!-- reserve space at right for PaperClip icon -->
11642
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
11643
+ </xsl:if>
11620
11644
  </xsl:with-param>
11621
11645
  </xsl:call-template>
11622
11646
  </xsl:otherwise>
@@ -17293,9 +17317,14 @@
17293
17317
  </x:xmpmeta>
17294
17318
  <!-- add attachments -->
17295
17319
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
17296
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
17297
-
17298
- <pdf:embedded-file filename="{@name}">
17320
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
17321
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
17322
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
17323
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
17324
+ <!-- Todo: need update -->
17325
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
17326
+
17327
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
17299
17328
  <xsl:attribute name="src">
17300
17329
  <xsl:choose>
17301
17330
  <xsl:when test="normalize-space() != ''">
@@ -17311,18 +17340,27 @@
17311
17340
  <xsl:if test="$description != ''">
17312
17341
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
17313
17342
  </xsl:if>
17343
+ <xsl:if test="$afrelationship != ''">
17344
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
17345
+ </xsl:if>
17314
17346
  </pdf:embedded-file>
17315
17347
  </xsl:for-each>
17316
17348
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
17317
17349
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
17318
17350
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
17319
17351
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
17352
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
17320
17353
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
17321
17354
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
17322
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
17355
+ <!-- Todo: need update -->
17356
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
17357
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
17323
17358
  <xsl:if test="$description != ''">
17324
17359
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
17325
17360
  </xsl:if>
17361
+ <xsl:if test="$afrelationship != ''">
17362
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
17363
+ </xsl:if>
17326
17364
  </pdf:embedded-file>
17327
17365
  </xsl:for-each>
17328
17366
  </xsl:if>
@@ -17342,6 +17380,12 @@
17342
17380
  <!-- Get or calculate depth of the element -->
17343
17381
  <xsl:template name="getLevel">
17344
17382
  <xsl:param name="depth"/>
17383
+ <!-- <xsl:message>
17384
+ <xsl:choose>
17385
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
17386
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
17387
+ </xsl:choose>
17388
+ </xsl:message> -->
17345
17389
  <xsl:choose>
17346
17390
  <xsl:when test="normalize-space(@depth) != ''">
17347
17391
  <xsl:value-of select="@depth"/>
@@ -17362,8 +17406,27 @@
17362
17406
  <xsl:when test="ancestor::*[local-name() = 'preface']">
17363
17407
  <xsl:value-of select="$level_total - 2"/>
17364
17408
  </xsl:when>
17409
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
17410
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
17411
+ <xsl:choose>
17412
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
17413
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
17414
+ </xsl:when>
17415
+ <xsl:otherwise>
17416
+ <xsl:value-of select="$level_total - 2"/>
17417
+ </xsl:otherwise>
17418
+ </xsl:choose>
17419
+ </xsl:when>
17365
17420
  <xsl:when test="ancestor::*[local-name() = 'sections']">
17366
- <xsl:value-of select="$level_total - 1"/>
17421
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
17422
+ <xsl:choose>
17423
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
17424
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
17425
+ </xsl:when>
17426
+ <xsl:otherwise>
17427
+ <xsl:value-of select="$level_total - 1"/>
17428
+ </xsl:otherwise>
17429
+ </xsl:choose>
17367
17430
  </xsl:when>
17368
17431
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
17369
17432
  <xsl:value-of select="$level_total - 1"/>
@@ -17371,6 +17434,17 @@
17371
17434
  <xsl:when test="parent::*[local-name() = 'annex']">
17372
17435
  <xsl:value-of select="$level_total - 1"/>
17373
17436
  </xsl:when>
17437
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
17438
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
17439
+ <xsl:choose>
17440
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
17441
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
17442
+ </xsl:when>
17443
+ <xsl:otherwise>
17444
+ <xsl:value-of select="$level_total - 1"/>
17445
+ </xsl:otherwise>
17446
+ </xsl:choose>
17447
+ </xsl:when>
17374
17448
  <xsl:when test="ancestor::*[local-name() = 'annex']">
17375
17449
  <xsl:value-of select="$level_total"/>
17376
17450
  </xsl:when>
@@ -17729,6 +17803,20 @@
17729
17803
 
17730
17804
  <!-- END: insert cover page image -->
17731
17805
 
17806
+ <xsl:template name="insertVerticalChar">
17807
+ <xsl:param name="str"/>
17808
+ <xsl:if test="string-length($str) &gt; 0">
17809
+ <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
17810
+ <fo:block-container width="1em">
17811
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
17812
+ </fo:block-container>
17813
+ </fo:inline-container>
17814
+ <xsl:call-template name="insertVerticalChar">
17815
+ <xsl:with-param name="str" select="substring($str, 2)"/>
17816
+ </xsl:call-template>
17817
+ </xsl:if>
17818
+ </xsl:template>
17819
+
17732
17820
  <xsl:template name="number-to-words">
17733
17821
  <xsl:param name="number"/>
17734
17822
  <xsl:param name="first"/>
@@ -18016,4 +18104,18 @@
18016
18104
  </xsl:if>
18017
18105
  </xsl:template>
18018
18106
 
18107
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
18108
+ <xsl:copy>
18109
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
18110
+ </xsl:copy>
18111
+ </xsl:template>
18112
+
18113
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
18114
+ <xsl:copy>
18115
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
18116
+ <xsl:attribute name="role">SKIP</xsl:attribute>
18117
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
18118
+ </xsl:copy>
18119
+ </xsl:template>
18120
+
18019
18121
  </xsl:stylesheet>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "2.8.6".freeze
3
+ VERSION = "2.8.7".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.6
4
+ version: 2.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-16 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc