metanorma-ogc 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,7 @@
32
32
  <xsl:attribute name="margin-top">18pt</xsl:attribute>
33
33
  <xsl:attribute name="margin-bottom">18pt</xsl:attribute>
34
34
  <xsl:attribute name="line-height">110%</xsl:attribute>
35
+ <xsl:attribute name="role">H1</xsl:attribute>
35
36
  </xsl:attribute-set>
36
37
 
37
38
  <xsl:attribute-set name="title-depth2-style">
@@ -42,6 +43,7 @@
42
43
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
43
44
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
44
45
  <xsl:attribute name="line-height">110%</xsl:attribute>
46
+ <xsl:attribute name="role">H2</xsl:attribute>
45
47
  </xsl:attribute-set>
46
48
 
47
49
  <xsl:attribute-set name="title-depth3-style">
@@ -51,7 +53,8 @@
51
53
  <xsl:attribute name="color">rgb(21, 43, 77)</xsl:attribute>
52
54
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
53
55
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
54
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
56
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
57
+ <xsl:attribute name="role">H3</xsl:attribute>
55
58
  </xsl:attribute-set>
56
59
 
57
60
  <xsl:attribute-set name="empty-style">
@@ -126,7 +129,7 @@
126
129
 
127
130
  <fo:block-container margin-left="-12mm" margin-right="-9mm">
128
131
  <fo:block-container margin-left="0mm" margin-right="0mm">
129
- <fo:block font-size="36pt" background-color="{$color}" color="white" margin-left="2.5mm" padding-top="1mm" padding-left="1mm">
132
+ <fo:block font-size="36pt" background-color="{$color}" color="white" margin-left="2.5mm" padding-top="1mm" padding-left="1mm" role="H1">
130
133
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:title/node()"/>
131
134
  </fo:block>
132
135
  </fo:block-container>
@@ -216,43 +219,45 @@
216
219
  <fo:block break-after="page"/>
217
220
 
218
221
  <fo:block-container line-height="1.08" font-family="Lato">
219
- <fo:block xsl:use-attribute-sets="title-toc-style">
220
- <xsl:text>Table of Contents</xsl:text>
221
- </fo:block>
222
- <xsl:variable name="margin-left">3.9</xsl:variable>
223
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
224
- <fo:block margin-top="8pt" margin-bottom="5pt" margin-left="{(@level - 1) * $margin-left}mm" text-align-last="justify">
225
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
226
- <xsl:if test="@section != ''">
227
- <xsl:value-of select="@section"/><xsl:text> </xsl:text>
228
- </xsl:if>
229
- <xsl:apply-templates select="title"/>
230
- <fo:inline keep-together.within-line="always">
231
- <fo:leader leader-pattern="dots"/>
232
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
233
- </fo:inline>
234
- </fo:basic-link>
222
+ <fo:block role="TOC">
223
+ <fo:block xsl:use-attribute-sets="title-toc-style" role="H1">
224
+ <xsl:text>Table of Contents</xsl:text>
235
225
  </fo:block>
236
- </xsl:for-each>
237
-
238
- <xsl:if test="//ogc:figure[@id and ogc:name] or //ogc:table[@id and ogc:name]">
239
- <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
240
- <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
241
- <fo:block xsl:use-attribute-sets="title-toc-style">
242
- <xsl:text>Table of Figures</xsl:text>
243
- </fo:block>
244
- <xsl:for-each select="//ogc:figure[@id and ogc:name] | //ogc:table[@id and ogc:name]">
245
- <fo:block margin-top="8pt" margin-bottom="5pt" text-align-last="justify">
246
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
247
- <xsl:apply-templates select="ogc:name" mode="contents"/>
226
+ <xsl:variable name="margin-left">3.9</xsl:variable>
227
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
228
+ <fo:block margin-top="8pt" margin-bottom="5pt" margin-left="{(@level - 1) * $margin-left}mm" text-align-last="justify" role="TOCI">
229
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
230
+ <xsl:if test="@section != ''">
231
+ <xsl:value-of select="@section"/><xsl:text> </xsl:text>
232
+ </xsl:if>
233
+ <xsl:apply-templates select="title"/>
248
234
  <fo:inline keep-together.within-line="always">
249
235
  <fo:leader leader-pattern="dots"/>
250
- <fo:page-number-citation ref-id="{@id}"/>
236
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
251
237
  </fo:inline>
252
238
  </fo:basic-link>
253
239
  </fo:block>
254
240
  </xsl:for-each>
255
- </xsl:if>
241
+
242
+ <xsl:if test="//ogc:figure[@id and ogc:name] or //ogc:table[@id and ogc:name]">
243
+ <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
244
+ <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
245
+ <fo:block xsl:use-attribute-sets="title-toc-style">
246
+ <xsl:text>Table of Figures</xsl:text>
247
+ </fo:block>
248
+ <xsl:for-each select="//ogc:figure[@id and ogc:name] | //ogc:table[@id and ogc:name]">
249
+ <fo:block margin-top="8pt" margin-bottom="5pt" text-align-last="justify" role="TOCI">
250
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
251
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
252
+ <fo:inline keep-together.within-line="always">
253
+ <fo:leader leader-pattern="dots"/>
254
+ <fo:page-number-citation ref-id="{@id}"/>
255
+ </fo:inline>
256
+ </fo:basic-link>
257
+ </fo:block>
258
+ </xsl:for-each>
259
+ </xsl:if>
260
+ </fo:block>
256
261
  </fo:block-container>
257
262
 
258
263
 
@@ -417,7 +422,10 @@
417
422
  </xsl:template>
418
423
 
419
424
  <xsl:template match="ogc:license-statement//ogc:title">
420
- <fo:block font-family="Lato" text-align="center" font-weight="bold" margin-top="4pt">
425
+ <xsl:variable name="level">
426
+ <xsl:call-template name="getLevel"/>
427
+ </xsl:variable>
428
+ <fo:block font-family="Lato" text-align="center" font-weight="bold" margin-top="4pt" role="H{$level}">
421
429
  <xsl:apply-templates/>
422
430
  </fo:block>
423
431
  </xsl:template>
@@ -450,7 +458,10 @@
450
458
  </xsl:template>
451
459
 
452
460
  <xsl:template match="ogc:copyright-statement//ogc:title | ogc:legal-statement//ogc:title">
453
- <fo:block font-family="Lato" text-align="center" font-weight="bold">
461
+ <xsl:variable name="level">
462
+ <xsl:call-template name="getLevel"/>
463
+ </xsl:variable>
464
+ <fo:block font-family="Lato" text-align="center" font-weight="bold" role="H{$level}">
454
465
  <xsl:apply-templates/>
455
466
  </fo:block>
456
467
  </xsl:template>
@@ -489,8 +500,9 @@
489
500
  <!-- ====== -->
490
501
 
491
502
  <xsl:template match="ogc:annex/ogc:title">
492
- <fo:block xsl:use-attribute-sets="title-depth1-style">
503
+ <fo:block xsl:use-attribute-sets="title-depth1-style" role="H1">
493
504
  <xsl:apply-templates/>
505
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
494
506
  </fo:block>
495
507
  </xsl:template>
496
508
 
@@ -520,7 +532,7 @@
520
532
  </fo:inline>
521
533
  </xsl:when>
522
534
  <xsl:otherwise>
523
- <fo:inline font-family="Lato">
535
+ <fo:inline font-family="Lato" role="H{$level}">
524
536
  <xsl:apply-templates/>
525
537
  </fo:inline>
526
538
  </xsl:otherwise>
@@ -531,21 +543,25 @@
531
543
  <xsl:when test="$level = 1">
532
544
  <fo:block xsl:use-attribute-sets="title-depth1-style">
533
545
  <xsl:apply-templates/>
546
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
534
547
  </fo:block>
535
548
  </xsl:when>
536
549
  <xsl:when test="$level = 2">
537
550
  <fo:block xsl:use-attribute-sets="title-depth2-style">
538
551
  <xsl:apply-templates/>
552
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
539
553
  </fo:block>
540
554
  </xsl:when>
541
555
  <xsl:when test="$level = 3">
542
556
  <fo:block xsl:use-attribute-sets="title-depth3-style">
543
557
  <xsl:apply-templates/>
558
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
544
559
  </fo:block>
545
560
  </xsl:when>
546
561
  <xsl:otherwise>
547
- <fo:block font-family="Lato">
562
+ <fo:block font-family="Lato" role="H{$level}">
548
563
  <xsl:apply-templates/>
564
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
549
565
  </fo:block>
550
566
  </xsl:otherwise>
551
567
  </xsl:choose>
@@ -751,7 +767,10 @@
751
767
  <xsl:otherwise>12pt</xsl:otherwise>
752
768
  </xsl:choose>
753
769
  </xsl:variable>
754
- <fo:block font-size="{$font-size}">
770
+ <xsl:variable name="levelTerm">
771
+ <xsl:call-template name="getLevelTermName"/>
772
+ </xsl:variable>
773
+ <fo:block font-size="{$font-size}" role="H{$levelTerm}">
755
774
  <fo:block font-weight="bold" keep-with-next="always">
756
775
  <xsl:apply-templates select="ancestor::ogc:term/ogc:name" mode="presentation"/>
757
776
  </fo:block>
@@ -861,13 +880,13 @@
861
880
  </fo:block>
862
881
  </fo:static-content>
863
882
 
864
- <fo:static-content flow-name="header">
883
+ <fo:static-content flow-name="header" role="artifact">
865
884
  <fo:block-container height="16.5mm" background-color="{$color}">
866
885
  <fo:block> </fo:block>
867
886
  </fo:block-container>
868
887
  </fo:static-content>
869
888
 
870
- <fo:static-content flow-name="footer">
889
+ <fo:static-content flow-name="footer" role="artifact">
871
890
  <fo:block-container height="100%" display-align="after">
872
891
  <fo:block-container height="23.5mm" background-color="{$color}" color="rgb(231, 230, 230)" display-align="after">
873
892
  <fo:block-container margin-left="1in" margin-right="1in">
@@ -1072,6 +1091,7 @@
1072
1091
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1073
1092
  <xsl:attribute name="white-space">pre</xsl:attribute>
1074
1093
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1094
+ <xsl:attribute name="role">Code</xsl:attribute>
1075
1095
 
1076
1096
 
1077
1097
 
@@ -1124,8 +1144,13 @@
1124
1144
 
1125
1145
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1126
1146
 
1127
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1128
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1147
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
1148
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
1149
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
1150
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
1151
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
1152
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
1153
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
1129
1154
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1130
1155
 
1131
1156
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -1365,7 +1390,8 @@
1365
1390
 
1366
1391
 
1367
1392
 
1368
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1393
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1394
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
1369
1395
 
1370
1396
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1371
1397
  <xsl:attribute name="margin-left">13mm</xsl:attribute>
@@ -1576,7 +1602,9 @@
1576
1602
  <!-- Display table's name before table as standalone block -->
1577
1603
  <!-- $namespace = 'iso' or -->
1578
1604
 
1579
-
1605
+
1606
+
1607
+
1580
1608
 
1581
1609
  <xsl:call-template name="fn_name_display"/>
1582
1610
 
@@ -3466,16 +3494,68 @@
3466
3494
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3467
3495
  </xsl:call-template>
3468
3496
 
3497
+
3498
+
3469
3499
  <xsl:variable name="mathml">
3470
3500
  <xsl:apply-templates select="." mode="mathml"/>
3471
3501
  </xsl:variable>
3472
3502
  <fo:instream-foreign-object fox:alt-text="Math">
3473
3503
 
3474
3504
 
3505
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3506
+ <xsl:variable name="comment_text_">
3507
+ <xsl:choose>
3508
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3509
+ <xsl:value-of select="$comment_text_following"/>
3510
+ </xsl:when>
3511
+ <xsl:otherwise>
3512
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3513
+ </xsl:otherwise>
3514
+ </xsl:choose>
3515
+ </xsl:variable>
3516
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3517
+
3518
+ <xsl:if test="normalize-space($comment_text) != ''">
3519
+ <!-- put Mathin Alternate Text -->
3520
+ <xsl:attribute name="fox:alt-text">
3521
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3522
+ </xsl:attribute>
3523
+ </xsl:if>
3524
+
3525
+ <xsl:variable name="mathml_content">
3526
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3527
+ </xsl:variable>
3528
+ <!-- put MathML in Actual Text -->
3529
+ <xsl:attribute name="fox:actual-text">
3530
+ <xsl:value-of select="$mathml_content"/>
3531
+ </xsl:attribute>
3532
+
3533
+
3475
3534
  <!-- <xsl:copy-of select="."/> -->
3476
3535
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3477
3536
  </fo:instream-foreign-object>
3478
3537
  </fo:inline>
3538
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3539
+ <!-- <xsl:text>a+b</xsl:text> -->
3540
+ <xsl:text>&lt;</xsl:text>
3541
+ <xsl:value-of select="local-name()"/>
3542
+ <xsl:if test="local-name() = 'math'">
3543
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
3544
+ </xsl:if>
3545
+ <xsl:for-each select="@*">
3546
+ <xsl:text> </xsl:text>
3547
+ <xsl:value-of select="local-name()"/>
3548
+ <xsl:text>="</xsl:text>
3549
+ <xsl:value-of select="."/>
3550
+ <xsl:text>"</xsl:text>
3551
+ </xsl:for-each>
3552
+ <xsl:text>&gt;</xsl:text>
3553
+ <xsl:apply-templates mode="mathml_actual_text"/>
3554
+ <xsl:text>&lt;/</xsl:text>
3555
+ <xsl:value-of select="local-name()"/>
3556
+ <xsl:text>&gt;</xsl:text>
3557
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
3558
+ <xsl:value-of select="normalize-space()"/>
3479
3559
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3480
3560
  <xsl:copy>
3481
3561
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3537,7 +3617,10 @@
3537
3617
  </fo:block>
3538
3618
  <xsl:apply-templates/>
3539
3619
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3540
- <fo:inline><xsl:apply-templates/></fo:inline>
3620
+ <xsl:variable name="level">
3621
+ <xsl:call-template name="getLevel"/>
3622
+ </xsl:variable>
3623
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3541
3624
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3542
3625
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3543
3626
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3572,9 +3655,10 @@
3572
3655
 
3573
3656
  </xsl:variable>
3574
3657
 
3658
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3575
3659
  <xsl:choose>
3576
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3577
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3660
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
3661
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
3578
3662
  </xsl:choose>
3579
3663
  <xsl:apply-templates/>
3580
3664
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3724,7 +3808,10 @@
3724
3808
  </fo:block>
3725
3809
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3726
3810
  <xsl:if test="normalize-space() != ''">
3727
- <fo:inline>
3811
+ <xsl:variable name="level">
3812
+ <xsl:call-template name="getLevelTermName"/>
3813
+ </xsl:variable>
3814
+ <fo:inline role="H{$level}">
3728
3815
  <xsl:apply-templates/>
3729
3816
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3730
3817
  <xsl:text>.</xsl:text>
@@ -4366,6 +4453,7 @@
4366
4453
  </xsl:when>
4367
4454
  <xsl:otherwise>
4368
4455
  <xsl:apply-templates/>
4456
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4369
4457
  </xsl:otherwise>
4370
4458
  </xsl:choose>
4371
4459
  </fo:block>
@@ -4514,14 +4602,6 @@
4514
4602
  <fo:block>
4515
4603
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4516
4604
  </fo:block>
4517
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4518
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4519
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4520
- </fo:block>
4521
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4522
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4523
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4524
- </fo:block>
4525
4605
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4526
4606
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4527
4607
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4538,6 +4618,38 @@
4538
4618
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4539
4619
  <xsl:apply-templates/>
4540
4620
  </fo:block>
4621
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4622
+ <fo:block xsl:use-attribute-sets="subject-style">
4623
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4624
+ </fo:block>
4625
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
4626
+ <fo:block xsl:use-attribute-sets="subject-style">
4627
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4628
+ </fo:block>
4629
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
4630
+ <fo:block xsl:use-attribute-sets="inherit-style">
4631
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4632
+ </fo:block>
4633
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
4634
+ <fo:block xsl:use-attribute-sets="description-style">
4635
+ <xsl:apply-templates/>
4636
+ </fo:block>
4637
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
4638
+ <fo:block xsl:use-attribute-sets="specification-style">
4639
+ <xsl:apply-templates/>
4640
+ </fo:block>
4641
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
4642
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
4643
+ <xsl:apply-templates/>
4644
+ </fo:block>
4645
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
4646
+ <fo:block xsl:use-attribute-sets="verification-style">
4647
+ <xsl:apply-templates/>
4648
+ </fo:block>
4649
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
4650
+ <fo:block xsl:use-attribute-sets="import-style">
4651
+ <xsl:apply-templates/>
4652
+ </fo:block>
4541
4653
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4542
4654
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4543
4655
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -5560,6 +5672,9 @@
5560
5672
  <fo:block-container border="1pt solid black" width="50%">
5561
5673
  <fo:block> </fo:block>
5562
5674
  </fo:block-container>
5675
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5676
+ <fo:inline padding-right="5mm"> </fo:inline>
5677
+ <fo:inline><xsl:apply-templates/></fo:inline>
5563
5678
  </xsl:template><xsl:template name="convertDate">
5564
5679
  <xsl:param name="date"/>
5565
5680
  <xsl:param name="format" select="'short'"/>
@@ -5798,6 +5913,26 @@
5798
5913
  <xsl:value-of select="$level"/>
5799
5914
  </xsl:otherwise>
5800
5915
  </xsl:choose>
5916
+ </xsl:template><xsl:template name="getLevelTermName">
5917
+ <xsl:choose>
5918
+ <xsl:when test="normalize-space(../@depth) != ''">
5919
+ <xsl:value-of select="../@depth"/>
5920
+ </xsl:when>
5921
+ <xsl:otherwise>
5922
+ <xsl:variable name="title_level_">
5923
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
5924
+ <xsl:call-template name="getLevel"/>
5925
+ </xsl:for-each>
5926
+ </xsl:variable>
5927
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
5928
+ <xsl:choose>
5929
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
5930
+ <xsl:otherwise>
5931
+ <xsl:call-template name="getLevel"/>
5932
+ </xsl:otherwise>
5933
+ </xsl:choose>
5934
+ </xsl:otherwise>
5935
+ </xsl:choose>
5801
5936
  </xsl:template><xsl:template name="split">
5802
5937
  <xsl:param name="pText" select="."/>
5803
5938
  <xsl:param name="sep" select="','"/>
@@ -20,15 +20,15 @@ module IsoDoc
20
20
 
21
21
  def preface_init_insert_pt(docxml)
22
22
  docxml.at(ns("//preface")) ||
23
- docxml.at(ns("//sections")).
24
- add_previous_sibling("<preface> </preface>").first
23
+ docxml.at(ns("//sections"))
24
+ .add_previous_sibling("<preface> </preface>").first
25
25
  end
26
26
 
27
27
  def submit_orgs_append_pt(docxml)
28
28
  docxml.at(ns("//introduction")) ||
29
- docxml.at(ns("//foreword")) ||
30
- docxml.at(ns("//preface/clause[@type = 'keywords']")) ||
31
- docxml.at(ns("//preface/abstract"))
29
+ docxml.at(ns("//foreword")) ||
30
+ docxml.at(ns("//preface/clause[@type = 'keywords']")) ||
31
+ docxml.at(ns("//preface/abstract"))
32
32
  end
33
33
 
34
34
  def insert_security(docxml)
@@ -37,8 +37,8 @@ module IsoDoc
37
37
  if a = submit_orgs_append_pt(docxml)
38
38
  a.next = s
39
39
  else
40
- preface_init_insert_pt(docxml)&.children&.first&.
41
- add_previous_sibling(s)
40
+ preface_init_insert_pt(docxml)&.children&.first
41
+ &.add_previous_sibling(s)
42
42
  end
43
43
  end
44
44
 
@@ -46,33 +46,34 @@ module IsoDoc
46
46
  orgs = []
47
47
  docxml.xpath(ns(submittingorgs_path)).each { |org| orgs << org.text }
48
48
  return if orgs.empty?
49
+
49
50
  if a = submit_orgs_append_pt(docxml)
50
51
  a.next = submitting_orgs_clause(orgs)
51
52
  else
52
- preface_init_insert_pt(docxml)&.children&.first&.
53
- add_previous_sibling(submitting_orgs_clause(orgs))
53
+ preface_init_insert_pt(docxml)&.children&.first
54
+ &.add_previous_sibling(submitting_orgs_clause(orgs))
54
55
  end
55
56
  end
56
57
 
57
58
  def submitting_orgs_clause(orgs)
58
- <<~END
59
- <clause id="_#{UUIDTools::UUID.random_create}" type="submitting_orgs">
60
- <title>Submitting Organizations</title>
61
- <p>The following organizations submitted this Document to the
62
- Open Geospatial Consortium (OGC):</p>
63
- <ul>#{orgs.map { |m| "<li>#{m}</li>" }.join("\n")}</ul>
64
- </clause>
65
- END
66
- end
67
-
68
- def keyword_clause(kw)
69
- <<~END
70
- <clause id="_#{UUIDTools::UUID.random_create}" type="keywords">
71
- <title>Keywords</title>
72
- <p>The following are keywords to be used by search engines and
73
- document catalogues.</p>
74
- <p>#{kw.join(", ")}</p></clause>
75
- END
59
+ <<~SUBMITTING
60
+ <clause id="_#{UUIDTools::UUID.random_create}" type="submitting_orgs">
61
+ <title>Submitting Organizations</title>
62
+ <p>The following organizations submitted this Document to the
63
+ Open Geospatial Consortium (OGC):</p>
64
+ <ul>#{orgs.map { |m| "<li>#{m}</li>" }.join("\n")}</ul>
65
+ </clause>
66
+ SUBMITTING
67
+ end
68
+
69
+ def keyword_clause(kwords)
70
+ <<~KEYWORDS
71
+ <clause id="_#{UUIDTools::UUID.random_create}" type="keywords">
72
+ <title>Keywords</title>
73
+ <p>The following are keywords to be used by search engines and
74
+ document catalogues.</p>
75
+ <p>#{kwords.join(', ')}</p></clause>
76
+ KEYWORDS
76
77
  end
77
78
 
78
79
  def insert_keywords(docxml)
@@ -81,28 +82,29 @@ module IsoDoc
81
82
  if abstract = docxml.at(ns("//preface/abstract"))
82
83
  abstract.next = keyword_clause(kw)
83
84
  else
84
- preface_init_insert_pt(docxml)&.children&.first&.
85
- add_previous_sibling(keyword_clause(kw))
85
+ preface_init_insert_pt(docxml)&.children&.first
86
+ &.add_previous_sibling(keyword_clause(kw))
86
87
  end
87
88
  end
88
89
 
89
- def example1(f)
90
- lbl = @xrefs.anchor(f['id'], :label, false) or return
91
- prefix_name(f, "&nbsp;&mdash; ", l10n("#{@i18n.example} #{lbl}"), "name")
90
+ def example1(elem)
91
+ lbl = @xrefs.anchor(elem["id"], :label, false) or return
92
+ prefix_name(elem, "&nbsp;&mdash; ", l10n("#{@i18n.example} #{lbl}"),
93
+ "name")
92
94
  end
93
95
 
94
- def recommendation1(f, type)
95
- type = recommendation_class_label(f)
96
- label = f&.at(ns("./label"))&.text
97
- if inject_crossreference_reqt?(f, label)
96
+ def recommendation1(elem, _type)
97
+ type = recommendation_class_label(elem)
98
+ label = elem&.at(ns("./label"))&.text
99
+ if inject_crossreference_reqt?(elem, label)
98
100
  n = @xrefs.anchor(@xrefs.reqtlabels[label], :xref, false)
99
101
  lbl = (n.nil? ? type : n)
100
- f&.at(ns("./title"))&.remove # suppress from display if embedded
102
+ elem&.at(ns("./title"))&.remove # suppress from display if embedded
101
103
  else
102
- n = @xrefs.anchor(f['id'], :label, false)
104
+ n = @xrefs.anchor(elem["id"], :label, false)
103
105
  lbl = (n.nil? ? type : l10n("#{type} #{n}"))
104
106
  end
105
- prefix_name(f, "", lbl, "name")
107
+ prefix_name(elem, "", lbl, "name")
106
108
  end
107
109
 
108
110
  # embedded reqts xref to top level reqts via label lookup
@@ -126,23 +128,29 @@ module IsoDoc
126
128
  end
127
129
  end
128
130
 
129
- def annex1(f)
130
- lbl = @xrefs.anchor(f['id'], :label)
131
- if t = f.at(ns("./title"))
131
+ def annex1(elem)
132
+ lbl = @xrefs.anchor(elem["id"], :label)
133
+ if t = elem.at(ns("./title"))
132
134
  t.children = "<strong>#{t.children.to_xml}</strong>"
133
135
  end
134
- prefix_name(f, "<br/>", lbl, "title")
136
+ prefix_name(elem, "<br/>", lbl, "title")
135
137
  end
136
138
 
137
139
  def clause(docxml)
138
140
  super
139
141
  docxml.xpath(ns("//foreword | //preface/abstract | "\
140
- "//submitters | //introduction | //acknowledgements")).
141
- each do |f|
142
+ "//submitters | //introduction | //acknowledgements"))
143
+ .each do |f|
142
144
  clause1(f)
143
145
  end
144
146
  end
145
147
 
148
+ def clause1(elem)
149
+ return if elem.name == "terms" && elem.parent.name == "annex"
150
+
151
+ super
152
+ end
153
+
146
154
  def block(docxml)
147
155
  super
148
156
  recommendation_to_table(docxml)
@@ -166,4 +174,3 @@ module IsoDoc
166
174
  end
167
175
  end
168
176
  end
169
-