metanorma-iho 0.4.5 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -419,8 +419,6 @@
419
419
 
420
420
  </xsl:template>
421
421
 
422
-
423
- <xsl:template match="iho:references/iho:bibitem" mode="contents"/>
424
422
  <!-- ============================= -->
425
423
  <!-- END CONTENTS -->
426
424
  <!-- ============================= -->
@@ -678,7 +676,10 @@
678
676
  <fo:list-item-label end-indent="label-end()">
679
677
  <fo:block>
680
678
  <fo:inline id="{@id}">
681
- <xsl:number format="[1]"/>
679
+ <xsl:value-of select="iho:docidentifier[@type = 'metanorma-ordinal']"/>
680
+ <xsl:if test="not(iho:docidentifier[@type = 'metanorma-ordinal'])">
681
+ <xsl:number format="[1]"/>
682
+ </xsl:if>
682
683
  </fo:inline>
683
684
  </fo:block>
684
685
  </fo:list-item-label>
@@ -917,13 +918,6 @@
917
918
 
918
919
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
919
920
 
920
- <title-annex lang="en">Annex </title-annex>
921
- <title-annex lang="fr">Annexe </title-annex>
922
-
923
- <title-annex lang="zh">Annex </title-annex>
924
-
925
-
926
-
927
921
  <title-edition lang="en">
928
922
 
929
923
  <xsl:text>Edition </xsl:text>
@@ -937,7 +931,8 @@
937
931
 
938
932
  </title-edition>
939
933
 
940
-
934
+
935
+ <!-- These titles of Table of contents renders different than determined in localized-strings -->
941
936
  <title-toc lang="en">
942
937
 
943
938
  <xsl:text>Contents</xsl:text>
@@ -949,21 +944,11 @@
949
944
 
950
945
  <xsl:text>Sommaire</xsl:text>
951
946
 
952
-
953
- </title-toc>
947
+ </title-toc>
954
948
 
955
949
  <title-toc lang="zh">Contents</title-toc>
956
950
 
957
951
 
958
-
959
- <title-page lang="en">Page</title-page>
960
- <title-page lang="fr">Page</title-page>
961
-
962
- <title-key lang="en">Key</title-key>
963
- <title-key lang="fr">Légende</title-key>
964
-
965
- <title-where lang="en">where</title-where>
966
- <title-where lang="fr">où</title-where>
967
952
 
968
953
  <title-descriptors lang="en">Descriptors</title-descriptors>
969
954
 
@@ -986,25 +971,6 @@
986
971
 
987
972
  </title-subpart>
988
973
 
989
- <title-modified lang="en">modified</title-modified>
990
- <title-modified lang="fr">modifiée</title-modified>
991
-
992
- <title-modified lang="zh">modified</title-modified>
993
-
994
-
995
-
996
- <title-source lang="en">
997
-
998
- <xsl:text>SOURCE</xsl:text>
999
-
1000
-
1001
- </title-source>
1002
-
1003
- <title-keywords lang="en">Keywords</title-keywords>
1004
-
1005
- <title-deprecated lang="en">DEPRECATED</title-deprecated>
1006
- <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1007
-
1008
974
  <title-list-tables lang="en">List of Tables</title-list-tables>
1009
975
 
1010
976
  <title-list-figures lang="en">List of Figures</title-list-figures>
@@ -1013,37 +979,8 @@
1013
979
 
1014
980
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1015
981
 
1016
- <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1017
-
1018
- <title-abstract lang="en">Abstract</title-abstract>
1019
-
1020
982
  <title-summary lang="en">Summary</title-summary>
1021
983
 
1022
- <title-in lang="en">in </title-in>
1023
-
1024
- <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1025
- <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1026
-
1027
- <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
1028
- <title-completion-date lang="zh">本稿完成日期</title-completion-date>
1029
-
1030
- <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
1031
- <title-issuance-date lang="zh"># 发布</title-issuance-date>
1032
-
1033
- <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
1034
- <title-implementation-date lang="zh"># 实施</title-implementation-date>
1035
-
1036
- <title-obligation-normative lang="en">normative</title-obligation-normative>
1037
- <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
1038
-
1039
- <title-caution lang="en">CAUTION</title-caution>
1040
- <title-caution lang="zh">注意</title-caution>
1041
-
1042
- <title-warning lang="en">WARNING</title-warning>
1043
- <title-warning lang="zh">警告</title-warning>
1044
-
1045
- <title-amendment lang="en">AMENDMENT</title-amendment>
1046
-
1047
984
  <title-continued lang="en">(continued)</title-continued>
1048
985
  <title-continued lang="fr">(continué)</title-continued>
1049
986
 
@@ -1148,6 +1085,7 @@
1148
1085
 
1149
1086
 
1150
1087
 
1088
+
1151
1089
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1152
1090
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
1153
1091
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1164,7 +1102,9 @@
1164
1102
 
1165
1103
 
1166
1104
 
1105
+
1167
1106
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1107
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1168
1108
 
1169
1109
 
1170
1110
 
@@ -1190,6 +1130,7 @@
1190
1130
 
1191
1131
 
1192
1132
 
1133
+
1193
1134
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1194
1135
  <xsl:attribute name="margin-left">12.7mm</xsl:attribute>
1195
1136
 
@@ -1555,7 +1496,7 @@
1555
1496
 
1556
1497
 
1557
1498
 
1558
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1499
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1559
1500
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1560
1501
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1561
1502
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
@@ -2834,12 +2775,9 @@
2834
2775
  <fo:block margin-bottom="12pt" text-align="left">
2835
2776
 
2836
2777
  <xsl:variable name="title-where">
2837
-
2838
-
2839
- <xsl:call-template name="getTitle">
2840
- <xsl:with-param name="name" select="'title-where'"/>
2841
- </xsl:call-template>
2842
-
2778
+ <xsl:call-template name="getLocalizedString">
2779
+ <xsl:with-param name="key">where</xsl:with-param>
2780
+ </xsl:call-template>
2843
2781
  </xsl:variable>
2844
2782
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2845
2783
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2855,12 +2793,9 @@
2855
2793
 
2856
2794
 
2857
2795
  <xsl:variable name="title-where">
2858
-
2859
-
2860
- <xsl:call-template name="getTitle">
2861
- <xsl:with-param name="name" select="'title-where'"/>
2862
- </xsl:call-template>
2863
-
2796
+ <xsl:call-template name="getLocalizedString">
2797
+ <xsl:with-param name="key">where</xsl:with-param>
2798
+ </xsl:call-template>
2864
2799
  </xsl:variable>
2865
2800
  <xsl:value-of select="$title-where"/>
2866
2801
  </fo:block>
@@ -2872,12 +2807,9 @@
2872
2807
 
2873
2808
 
2874
2809
  <xsl:variable name="title-key">
2875
-
2876
-
2877
- <xsl:call-template name="getTitle">
2878
- <xsl:with-param name="name" select="'title-key'"/>
2879
- </xsl:call-template>
2880
-
2810
+ <xsl:call-template name="getLocalizedString">
2811
+ <xsl:with-param name="key">key</xsl:with-param>
2812
+ </xsl:call-template>
2881
2813
  </xsl:variable>
2882
2814
  <xsl:value-of select="$title-key"/>
2883
2815
  </fo:block>
@@ -3212,6 +3144,15 @@
3212
3144
  </fo:inline>
3213
3145
  </xsl:template><xsl:template match="*[local-name()='add']">
3214
3146
  <xsl:choose>
3147
+ <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
3148
+ <fo:inline>
3149
+ <xsl:call-template name="insertTag">
3150
+ <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
3151
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
3152
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
3153
+ </xsl:call-template>
3154
+ </fo:inline>
3155
+ </xsl:when>
3215
3156
  <xsl:when test="@amendment">
3216
3157
  <fo:inline>
3217
3158
  <xsl:call-template name="insertTag">
@@ -3246,7 +3187,6 @@
3246
3187
  </fo:inline>
3247
3188
  </xsl:otherwise>
3248
3189
  </xsl:choose>
3249
-
3250
3190
  </xsl:template><xsl:template name="insertTag">
3251
3191
  <xsl:param name="type"/>
3252
3192
  <xsl:param name="kind"/>
@@ -3262,14 +3202,14 @@
3262
3202
  <xsl:attribute name="scaling">uniform</xsl:attribute>
3263
3203
  <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
3264
3204
  <g>
3265
- <xsl:if test="$type = 'closing'">
3205
+ <xsl:if test="$type = 'closing' or $type = 'end'">
3266
3206
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
3267
3207
  </xsl:if>
3268
3208
  <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
3269
3209
  <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
3270
3210
  </g>
3271
3211
  <text font-family="Arial" x="15" y="57" font-size="40pt">
3272
- <xsl:if test="$type = 'closing'">
3212
+ <xsl:if test="$type = 'closing' or $type = 'end'">
3273
3213
  <xsl:attribute name="x">25</xsl:attribute>
3274
3214
  </xsl:if>
3275
3215
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
@@ -3762,9 +3702,9 @@
3762
3702
  <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3763
3703
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3764
3704
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3765
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3705
+ <xsl:apply-templates select="*[local-name()='name']"/>
3766
3706
  </fo:block>
3767
- <xsl:apply-templates/>
3707
+ <xsl:apply-templates select="node()[not(local-name()='name')]"/>
3768
3708
  </xsl:template><xsl:template match="*[local-name() = 'callout']">
3769
3709
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3770
3710
  </xsl:template><xsl:template match="*[local-name() = 'annotation']">
@@ -4361,11 +4301,58 @@
4361
4301
  <xsl:value-of select="."/>
4362
4302
  </xsl:template><xsl:template match="node()" mode="contents">
4363
4303
  <xsl:apply-templates mode="contents"/>
4304
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
4305
+ <xsl:variable name="level">
4306
+ <xsl:call-template name="getLevel">
4307
+ <xsl:with-param name="depth" select="@depth"/>
4308
+ </xsl:call-template>
4309
+ </xsl:variable>
4310
+
4311
+ <xsl:variable name="section">
4312
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4313
+ </xsl:variable>
4314
+
4315
+ <xsl:variable name="type">floating-title</xsl:variable>
4316
+
4317
+ <xsl:variable name="display">
4318
+ <xsl:choose>
4319
+ <xsl:when test="normalize-space(@id) = ''">false</xsl:when>
4320
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
4321
+ <xsl:otherwise>false</xsl:otherwise>
4322
+ </xsl:choose>
4323
+ </xsl:variable>
4324
+
4325
+ <xsl:variable name="skip">false</xsl:variable>
4326
+
4327
+ <xsl:if test="$skip = 'false'">
4328
+
4329
+ <xsl:variable name="title">
4330
+ <xsl:choose>
4331
+ <xsl:when test="*[local-name() = 'tab']">
4332
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
4333
+ </xsl:when>
4334
+ <xsl:otherwise>
4335
+ <xsl:copy-of select="node()"/>
4336
+ </xsl:otherwise>
4337
+ </xsl:choose>
4338
+ </xsl:variable>
4339
+
4340
+ <xsl:variable name="root">
4341
+ <xsl:if test="ancestor-or-self::*[local-name() = 'preface']">preface</xsl:if>
4342
+ <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if>
4343
+ </xsl:variable>
4344
+
4345
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
4346
+ <title>
4347
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
4348
+ </title>
4349
+ </item>
4350
+ </xsl:if>
4364
4351
  </xsl:template><xsl:template match="node()" mode="bookmarks">
4365
4352
  <xsl:apply-templates mode="bookmarks"/>
4366
4353
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4367
4354
  <xsl:apply-templates select="."/>
4368
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4355
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4369
4356
  <xsl:apply-templates mode="bookmarks"/>
4370
4357
  </xsl:template><xsl:template name="addBookmarks">
4371
4358
  <xsl:param name="contents"/>
@@ -4536,7 +4523,10 @@
4536
4523
  </fo:block>
4537
4524
  </xsl:if>
4538
4525
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
4539
- <xsl:apply-templates mode="contents_item"/>
4526
+ <xsl:param name="mode">bookmarks</xsl:param>
4527
+ <xsl:apply-templates mode="contents_item">
4528
+ <xsl:with-param name="mode" select="$mode"/>
4529
+ </xsl:apply-templates>
4540
4530
  <!-- <xsl:text> </xsl:text> -->
4541
4531
  </xsl:template><xsl:template name="getSection">
4542
4532
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
@@ -4609,6 +4599,18 @@
4609
4599
  <xsl:copy-of select="."/>
4610
4600
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4611
4601
  <xsl:text> </xsl:text>
4602
+ </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item">
4603
+ <xsl:param name="mode">bookmarks</xsl:param>
4604
+ <xsl:apply-templates mode="contents_item">
4605
+ <xsl:with-param name="mode" select="$mode"/>
4606
+ </xsl:apply-templates>
4607
+ </xsl:template><xsl:template match="*[local-name() = 'add'][starts-with(text(), $ace_tag)]" mode="contents_item">
4608
+ <xsl:param name="mode">bookmarks</xsl:param>
4609
+ <xsl:if test="$mode = 'contents'">
4610
+ <xsl:copy>
4611
+ <xsl:apply-templates mode="contents_item"/>
4612
+ </xsl:copy>
4613
+ </xsl:if>
4612
4614
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4613
4615
 
4614
4616
  <fo:block-container margin-left="0mm">
@@ -4945,42 +4947,48 @@
4945
4947
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4946
4948
 
4947
4949
 
4948
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4949
-
4950
- <xsl:variable name="element">
4950
+ <xsl:variable name="fo_element">
4951
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
4951
4952
  block
4952
4953
 
4953
- <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
4954
+
4954
4955
  </xsl:variable>
4955
4956
 
4957
+ <!-- display 'EXAMPLE' -->
4958
+ <xsl:apply-templates select="*[local-name()='name']">
4959
+ <xsl:with-param name="fo_element" select="$fo_element"/>
4960
+ </xsl:apply-templates>
4961
+
4956
4962
  <xsl:choose>
4957
- <xsl:when test="contains(normalize-space($element), 'block')">
4958
- <fo:block xsl:use-attribute-sets="example-body-style">
4959
- <xsl:apply-templates/>
4960
- </fo:block>
4963
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
4964
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
4965
+ <fo:block-container margin-left="0mm" margin-right="0mm">
4966
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
4967
+ <xsl:with-param name="fo_element" select="$fo_element"/>
4968
+ </xsl:apply-templates>
4969
+ </fo:block-container>
4970
+ </fo:block-container>
4961
4971
  </xsl:when>
4962
4972
  <xsl:otherwise>
4963
4973
  <fo:inline>
4964
- <xsl:apply-templates/>
4974
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
4975
+ <xsl:with-param name="fo_element" select="$fo_element"/>
4976
+ </xsl:apply-templates>
4965
4977
  </fo:inline>
4966
4978
  </xsl:otherwise>
4967
4979
  </xsl:choose>
4968
4980
 
4969
4981
  </fo:block>
4970
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
4971
-
4972
- <xsl:variable name="element">
4973
- block
4974
-
4975
- <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
4976
- </xsl:variable>
4982
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
4983
+ <xsl:param name="fo_element">block</xsl:param>
4984
+
4977
4985
  <xsl:choose>
4978
4986
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
4979
4987
  <fo:inline>
4980
4988
  <xsl:apply-templates/>
4981
4989
  </fo:inline>
4982
4990
  </xsl:when>
4983
- <xsl:when test="contains(normalize-space($element), 'block')">
4991
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
4984
4992
  <fo:block xsl:use-attribute-sets="example-name-style">
4985
4993
  <xsl:apply-templates/>
4986
4994
  </fo:block>
@@ -4993,14 +5001,15 @@
4993
5001
  </xsl:choose>
4994
5002
 
4995
5003
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
5004
+ <xsl:param name="fo_element">block</xsl:param>
5005
+
4996
5006
  <xsl:variable name="num"><xsl:number/></xsl:variable>
4997
5007
  <xsl:variable name="element">
4998
- block
4999
-
5000
5008
 
5009
+ <xsl:value-of select="$fo_element"/>
5001
5010
  </xsl:variable>
5002
5011
  <xsl:choose>
5003
- <xsl:when test="normalize-space($element) = 'block'">
5012
+ <xsl:when test="starts-with(normalize-space($element), 'block')">
5004
5013
  <fo:block xsl:use-attribute-sets="example-p-style">
5005
5014
 
5006
5015
  <xsl:apply-templates/>
@@ -5068,12 +5077,9 @@
5068
5077
  </fo:basic-link>
5069
5078
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
5070
5079
  <xsl:variable name="title-modified">
5071
-
5072
-
5073
- <xsl:call-template name="getTitle">
5074
- <xsl:with-param name="name" select="'title-modified'"/>
5075
- </xsl:call-template>
5076
-
5080
+ <xsl:call-template name="getLocalizedString">
5081
+ <xsl:with-param name="key">modified</xsl:with-param>
5082
+ </xsl:call-template>
5077
5083
  </xsl:variable>
5078
5084
 
5079
5085
  <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
@@ -5266,12 +5272,9 @@
5266
5272
  </fo:block>
5267
5273
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5268
5274
  <xsl:variable name="title-deprecated">
5269
-
5270
- <xsl:call-template name="getLocalizedString">
5271
- <xsl:with-param name="key">deprecated</xsl:with-param>
5272
- </xsl:call-template>
5273
-
5274
-
5275
+ <xsl:call-template name="getLocalizedString">
5276
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5277
+ </xsl:call-template>
5275
5278
  </xsl:variable>
5276
5279
  <fo:block xsl:use-attribute-sets="deprecates-style">
5277
5280
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5280,6 +5283,8 @@
5280
5283
  <xsl:if test="*[local-name() = 'strong']">
5281
5284
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5282
5285
  </xsl:if>
5286
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]">
5287
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
5283
5288
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
5284
5289
  <fo:block xsl:use-attribute-sets="definition-style">
5285
5290
  <xsl:apply-templates/>
@@ -5600,7 +5605,12 @@
5600
5605
 
5601
5606
 
5602
5607
 
5603
-
5608
+
5609
+
5610
+
5611
+
5612
+
5613
+
5604
5614
 
5605
5615
 
5606
5616
 
@@ -5705,10 +5715,19 @@
5705
5715
 
5706
5716
 
5707
5717
 
5718
+
5719
+
5720
+
5721
+
5722
+ <!-- end MPFD bibitem processing -->
5723
+
5724
+ <!-- start M3D bibitem processing -->
5708
5725
 
5709
5726
 
5727
+
5728
+
5710
5729
  </xsl:template><xsl:template name="processBibitemDocId">
5711
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
5730
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
5712
5731
  <xsl:choose>
5713
5732
  <xsl:when test="normalize-space($_doc_ident) != ''">
5714
5733
  <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
@@ -5722,7 +5741,7 @@
5722
5741
  <xsl:if test="$type != ''">
5723
5742
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5724
5743
  </xsl:if> -->
5725
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
5744
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
5726
5745
  </xsl:otherwise>
5727
5746
  </xsl:choose>
5728
5747
  </xsl:template><xsl:template name="processPersonalAuthor">
@@ -5828,8 +5847,12 @@
5828
5847
  <fo:block> </fo:block>
5829
5848
  </fo:block-container>
5830
5849
  </xsl:template><xsl:variable name="toc_level">
5850
+ <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
5851
+ <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
5852
+ <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
5831
5853
  <xsl:choose>
5832
- <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
5854
+ <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
5855
+ <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
5833
5856
  <xsl:otherwise><!-- default value -->
5834
5857
 
5835
5858
 
@@ -5931,7 +5954,7 @@
5931
5954
  </td>
5932
5955
  </xsl:for-each>
5933
5956
  <td>333</td> <!-- page number, just for fill -->
5934
- </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5957
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5935
5958
  <fo:inline padding-right="5mm"> </fo:inline>
5936
5959
  <fo:inline><xsl:apply-templates/></fo:inline>
5937
5960
  </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
@@ -6303,9 +6326,15 @@
6303
6326
  </xsl:template><xsl:template name="getLocalizedString">
6304
6327
  <xsl:param name="key"/>
6305
6328
  <xsl:param name="formatted">false</xsl:param>
6329
+ <xsl:param name="lang"/>
6306
6330
 
6307
6331
  <xsl:variable name="curr_lang">
6308
- <xsl:call-template name="getLang"/>
6332
+ <xsl:choose>
6333
+ <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
6334
+ <xsl:otherwise>
6335
+ <xsl:call-template name="getLang"/>
6336
+ </xsl:otherwise>
6337
+ </xsl:choose>
6309
6338
  </xsl:variable>
6310
6339
 
6311
6340
  <xsl:variable name="data_value">
File without changes
File without changes
File without changes
@@ -1,12 +1,12 @@
1
- require "asciidoctor/standoc/converter"
2
- require "asciidoctor/generic/converter"
1
+ require "metanorma/standoc/converter"
2
+ require "metanorma/generic/converter"
3
3
 
4
- module Asciidoctor
4
+ module Metanorma
5
5
  module IHO
6
6
  # A {Converter} implementation that generates RSD output, and a document
7
7
  # schema encapsulation of the document for validation
8
8
  #
9
- class Converter < Asciidoctor::Generic::Converter
9
+ class Converter < Metanorma::Generic::Converter
10
10
  XML_ROOT_TAG = "iho-standard".freeze
11
11
  XML_NAMESPACE = "https://www.metanorma.org/ns/iho".freeze
12
12
 
File without changes
@@ -32,6 +32,19 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="bibitem">
36
+ <element name="bibitem">
37
+ <attribute name="id">
38
+ <data type="ID"/>
39
+ </attribute>
40
+ <optional>
41
+ <attribute name="hidden">
42
+ <data type="boolean"/>
43
+ </attribute>
44
+ </optional>
45
+ <ref name="BibliographicItem"/>
46
+ </element>
47
+ </define>
35
48
  <define name="section-title">
36
49
  <element name="title">
37
50
  <zeroOrMore>
@@ -690,6 +703,7 @@
690
703
  <ref name="terms"/>
691
704
  <ref name="term-clause"/>
692
705
  <ref name="definitions"/>
706
+ <ref name="floating-title"/>
693
707
  </choice>
694
708
  </oneOrMore>
695
709
  </element>
@@ -1680,6 +1694,7 @@
1680
1694
  <ref name="clause-subsection"/>
1681
1695
  <ref name="terms"/>
1682
1696
  <ref name="definitions"/>
1697
+ <ref name="floating-title"/>
1683
1698
  </choice>
1684
1699
  </oneOrMore>
1685
1700
  </choice>
@@ -1722,6 +1737,7 @@
1722
1737
  <ref name="terms"/>
1723
1738
  <ref name="definitions"/>
1724
1739
  <ref name="references"/>
1740
+ <ref name="floating-title"/>
1725
1741
  </choice>
1726
1742
  </zeroOrMore>
1727
1743
  </group>
@@ -2534,4 +2550,17 @@
2534
2550
  </oneOrMore>
2535
2551
  </element>
2536
2552
  </define>
2553
+ <define name="floating-title">
2554
+ <element name="floating-title">
2555
+ <attribute name="id">
2556
+ <data type="ID"/>
2557
+ </attribute>
2558
+ <attribute name="depth">
2559
+ <data type="int"/>
2560
+ </attribute>
2561
+ <zeroOrMore>
2562
+ <ref name="TextElement"/>
2563
+ </zeroOrMore>
2564
+ </element>
2565
+ </define>
2537
2566
  </grammar>
File without changes
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.4.5".freeze
3
+ VERSION = "0.5.0".freeze
4
4
  end
5
5
  end