metanorma-un 0.7.5 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -204,8 +204,9 @@
204
204
  </xsl:variable>
205
205
  <fo:block font-size="14pt" margin-top="4pt" margin-bottom="8pt" role="H1"><xsl:value-of select="$title-toc"/></fo:block>
206
206
  <xsl:variable name="title-page">
207
- <xsl:call-template name="getTitle">
208
- <xsl:with-param name="name" select="'title-page'"/>
207
+ <xsl:call-template name="getLocalizedString">
208
+ <xsl:with-param name="key">locality.page</xsl:with-param>
209
+ <xsl:with-param name="lang" select="$lang"/>
209
210
  </xsl:call-template>
210
211
  </xsl:variable>
211
212
  <fo:block font-size="9pt" text-align="right" font-style="italic" margin-bottom="6pt"><xsl:value-of select="$title-page"/></fo:block>
@@ -412,9 +413,6 @@
412
413
  <fo:inline> </fo:inline>
413
414
  </xsl:template>
414
415
 
415
-
416
- <xsl:template match="un:bibitem" mode="contents"/>
417
-
418
416
  <xsl:template match="un:references" mode="contents">
419
417
  <xsl:apply-templates mode="contents"/>
420
418
  </xsl:template>
@@ -893,7 +891,7 @@
893
891
  </xsl:when>
894
892
  <xsl:otherwise>
895
893
  <xsl:apply-templates select="un:formattedref"/>
896
- <xsl:apply-templates select="un:docidentifier[@type != 'metanorma' or not(@type)]" mode="process"/>
894
+ <xsl:apply-templates select="un:docidentifier[(@type != 'metanorma' and @type != 'metanorma-ordinal') or not(@type)]" mode="process"/>
897
895
  </xsl:otherwise>
898
896
  </xsl:choose>
899
897
  </xsl:if>
@@ -933,10 +931,10 @@
933
931
  <xsl:apply-templates/>
934
932
  </xsl:template>
935
933
 
936
- <xsl:template match="un:docidentifier[@type = 'metanorma']" mode="process">
934
+ <xsl:template match="un:docidentifier[@type = 'metanorma' or @type = 'metanorma-ordinal']" mode="process">
937
935
  <xsl:apply-templates/>
938
936
  </xsl:template>
939
- <xsl:template match="un:docidentifier[@type != 'metanorma' or not(@type)]" mode="process">
937
+ <xsl:template match="un:docidentifier[(@type != 'metanorma' and @type != 'metanorma-ordinal') or not(@type)]" mode="process">
940
938
  <xsl:text> [</xsl:text><xsl:apply-templates/><xsl:text>]</xsl:text>
941
939
  </xsl:template>
942
940
  <xsl:template match="un:docidentifier"/>
@@ -1048,13 +1046,6 @@
1048
1046
 
1049
1047
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
1050
1048
 
1051
- <title-annex lang="en">Annex </title-annex>
1052
- <title-annex lang="fr">Annexe </title-annex>
1053
-
1054
- <title-annex lang="zh">Annex </title-annex>
1055
-
1056
-
1057
-
1058
1049
  <title-edition lang="en">
1059
1050
 
1060
1051
  <xsl:text>Edition </xsl:text>
@@ -1068,7 +1059,8 @@
1068
1059
 
1069
1060
  </title-edition>
1070
1061
 
1071
-
1062
+
1063
+ <!-- These titles of Table of contents renders different than determined in localized-strings -->
1072
1064
  <title-toc lang="en">
1073
1065
 
1074
1066
  <xsl:text>Contents</xsl:text>
@@ -1080,21 +1072,11 @@
1080
1072
 
1081
1073
  <xsl:text>Sommaire</xsl:text>
1082
1074
 
1083
-
1084
- </title-toc>
1075
+ </title-toc>
1085
1076
 
1086
1077
  <title-toc lang="zh">Contents</title-toc>
1087
1078
 
1088
1079
 
1089
-
1090
- <title-page lang="en">Page</title-page>
1091
- <title-page lang="fr">Page</title-page>
1092
-
1093
- <title-key lang="en">Key</title-key>
1094
- <title-key lang="fr">Légende</title-key>
1095
-
1096
- <title-where lang="en">where</title-where>
1097
- <title-where lang="fr">où</title-where>
1098
1080
 
1099
1081
  <title-descriptors lang="en">Descriptors</title-descriptors>
1100
1082
 
@@ -1117,25 +1099,6 @@
1117
1099
 
1118
1100
  </title-subpart>
1119
1101
 
1120
- <title-modified lang="en">modified</title-modified>
1121
- <title-modified lang="fr">modifiée</title-modified>
1122
-
1123
- <title-modified lang="zh">modified</title-modified>
1124
-
1125
-
1126
-
1127
- <title-source lang="en">
1128
-
1129
- <xsl:text>SOURCE</xsl:text>
1130
-
1131
-
1132
- </title-source>
1133
-
1134
- <title-keywords lang="en">Keywords</title-keywords>
1135
-
1136
- <title-deprecated lang="en">DEPRECATED</title-deprecated>
1137
- <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1138
-
1139
1102
  <title-list-tables lang="en">List of Tables</title-list-tables>
1140
1103
 
1141
1104
  <title-list-figures lang="en">List of Figures</title-list-figures>
@@ -1144,37 +1107,8 @@
1144
1107
 
1145
1108
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1146
1109
 
1147
- <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1148
-
1149
- <title-abstract lang="en">Abstract</title-abstract>
1150
-
1151
1110
  <title-summary lang="en">Summary</title-summary>
1152
1111
 
1153
- <title-in lang="en">in </title-in>
1154
-
1155
- <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1156
- <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1157
-
1158
- <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
1159
- <title-completion-date lang="zh">本稿完成日期</title-completion-date>
1160
-
1161
- <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
1162
- <title-issuance-date lang="zh"># 发布</title-issuance-date>
1163
-
1164
- <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
1165
- <title-implementation-date lang="zh"># 实施</title-implementation-date>
1166
-
1167
- <title-obligation-normative lang="en">normative</title-obligation-normative>
1168
- <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
1169
-
1170
- <title-caution lang="en">CAUTION</title-caution>
1171
- <title-caution lang="zh">注意</title-caution>
1172
-
1173
- <title-warning lang="en">WARNING</title-warning>
1174
- <title-warning lang="zh">警告</title-warning>
1175
-
1176
- <title-amendment lang="en">AMENDMENT</title-amendment>
1177
-
1178
1112
  <title-continued lang="en">(continued)</title-continued>
1179
1113
  <title-continued lang="fr">(continué)</title-continued>
1180
1114
 
@@ -1278,11 +1212,14 @@
1278
1212
 
1279
1213
 
1280
1214
 
1215
+
1281
1216
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1282
1217
 
1283
1218
 
1284
1219
 
1220
+
1285
1221
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1222
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1286
1223
 
1287
1224
 
1288
1225
 
@@ -1299,7 +1236,6 @@
1299
1236
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1300
1237
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1301
1238
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1302
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1303
1239
 
1304
1240
 
1305
1241
 
@@ -1317,6 +1253,7 @@
1317
1253
 
1318
1254
 
1319
1255
 
1256
+
1320
1257
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1321
1258
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1322
1259
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1653,7 +1590,7 @@
1653
1590
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
1654
1591
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1655
1592
 
1656
- </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">
1593
+ </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">
1657
1594
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1658
1595
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1659
1596
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
@@ -2965,12 +2902,9 @@
2965
2902
  <fo:block margin-bottom="12pt" text-align="left">
2966
2903
 
2967
2904
  <xsl:variable name="title-where">
2968
-
2969
-
2970
- <xsl:call-template name="getTitle">
2971
- <xsl:with-param name="name" select="'title-where'"/>
2972
- </xsl:call-template>
2973
-
2905
+ <xsl:call-template name="getLocalizedString">
2906
+ <xsl:with-param name="key">where</xsl:with-param>
2907
+ </xsl:call-template>
2974
2908
  </xsl:variable>
2975
2909
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2976
2910
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2986,12 +2920,9 @@
2986
2920
 
2987
2921
 
2988
2922
  <xsl:variable name="title-where">
2989
-
2990
-
2991
- <xsl:call-template name="getTitle">
2992
- <xsl:with-param name="name" select="'title-where'"/>
2993
- </xsl:call-template>
2994
-
2923
+ <xsl:call-template name="getLocalizedString">
2924
+ <xsl:with-param name="key">where</xsl:with-param>
2925
+ </xsl:call-template>
2995
2926
  </xsl:variable>
2996
2927
  <xsl:value-of select="$title-where"/>
2997
2928
  </fo:block>
@@ -3003,12 +2934,9 @@
3003
2934
 
3004
2935
 
3005
2936
  <xsl:variable name="title-key">
3006
-
3007
-
3008
- <xsl:call-template name="getTitle">
3009
- <xsl:with-param name="name" select="'title-key'"/>
3010
- </xsl:call-template>
3011
-
2937
+ <xsl:call-template name="getLocalizedString">
2938
+ <xsl:with-param name="key">key</xsl:with-param>
2939
+ </xsl:call-template>
3012
2940
  </xsl:variable>
3013
2941
  <xsl:value-of select="$title-key"/>
3014
2942
  </fo:block>
@@ -3336,6 +3264,15 @@
3336
3264
  </fo:inline>
3337
3265
  </xsl:template><xsl:template match="*[local-name()='add']">
3338
3266
  <xsl:choose>
3267
+ <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
3268
+ <fo:inline>
3269
+ <xsl:call-template name="insertTag">
3270
+ <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
3271
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
3272
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
3273
+ </xsl:call-template>
3274
+ </fo:inline>
3275
+ </xsl:when>
3339
3276
  <xsl:when test="@amendment">
3340
3277
  <fo:inline>
3341
3278
  <xsl:call-template name="insertTag">
@@ -3370,7 +3307,6 @@
3370
3307
  </fo:inline>
3371
3308
  </xsl:otherwise>
3372
3309
  </xsl:choose>
3373
-
3374
3310
  </xsl:template><xsl:template name="insertTag">
3375
3311
  <xsl:param name="type"/>
3376
3312
  <xsl:param name="kind"/>
@@ -3386,14 +3322,14 @@
3386
3322
  <xsl:attribute name="scaling">uniform</xsl:attribute>
3387
3323
  <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
3388
3324
  <g>
3389
- <xsl:if test="$type = 'closing'">
3325
+ <xsl:if test="$type = 'closing' or $type = 'end'">
3390
3326
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
3391
3327
  </xsl:if>
3392
3328
  <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
3393
3329
  <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
3394
3330
  </g>
3395
3331
  <text font-family="Arial" x="15" y="57" font-size="40pt">
3396
- <xsl:if test="$type = 'closing'">
3332
+ <xsl:if test="$type = 'closing' or $type = 'end'">
3397
3333
  <xsl:attribute name="x">25</xsl:attribute>
3398
3334
  </xsl:if>
3399
3335
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
@@ -3886,9 +3822,9 @@
3886
3822
  <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3887
3823
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3888
3824
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3889
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3825
+ <xsl:apply-templates select="*[local-name()='name']"/>
3890
3826
  </fo:block>
3891
- <xsl:apply-templates/>
3827
+ <xsl:apply-templates select="node()[not(local-name()='name')]"/>
3892
3828
  </xsl:template><xsl:template match="*[local-name() = 'callout']">
3893
3829
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3894
3830
  </xsl:template><xsl:template match="*[local-name() = 'annotation']">
@@ -4503,11 +4439,58 @@
4503
4439
  <xsl:value-of select="."/>
4504
4440
  </xsl:template><xsl:template match="node()" mode="contents">
4505
4441
  <xsl:apply-templates mode="contents"/>
4442
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
4443
+ <xsl:variable name="level">
4444
+ <xsl:call-template name="getLevel">
4445
+ <xsl:with-param name="depth" select="@depth"/>
4446
+ </xsl:call-template>
4447
+ </xsl:variable>
4448
+
4449
+ <xsl:variable name="section">
4450
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4451
+ </xsl:variable>
4452
+
4453
+ <xsl:variable name="type">floating-title</xsl:variable>
4454
+
4455
+ <xsl:variable name="display">
4456
+ <xsl:choose>
4457
+ <xsl:when test="normalize-space(@id) = ''">false</xsl:when>
4458
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
4459
+ <xsl:otherwise>false</xsl:otherwise>
4460
+ </xsl:choose>
4461
+ </xsl:variable>
4462
+
4463
+ <xsl:variable name="skip">false</xsl:variable>
4464
+
4465
+ <xsl:if test="$skip = 'false'">
4466
+
4467
+ <xsl:variable name="title">
4468
+ <xsl:choose>
4469
+ <xsl:when test="*[local-name() = 'tab']">
4470
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
4471
+ </xsl:when>
4472
+ <xsl:otherwise>
4473
+ <xsl:copy-of select="node()"/>
4474
+ </xsl:otherwise>
4475
+ </xsl:choose>
4476
+ </xsl:variable>
4477
+
4478
+ <xsl:variable name="root">
4479
+ <xsl:if test="ancestor-or-self::*[local-name() = 'preface']">preface</xsl:if>
4480
+ <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if>
4481
+ </xsl:variable>
4482
+
4483
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
4484
+ <title>
4485
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
4486
+ </title>
4487
+ </item>
4488
+ </xsl:if>
4506
4489
  </xsl:template><xsl:template match="node()" mode="bookmarks">
4507
4490
  <xsl:apply-templates mode="bookmarks"/>
4508
4491
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4509
4492
  <xsl:apply-templates select="."/>
4510
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4493
+ </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">
4511
4494
  <xsl:apply-templates mode="bookmarks"/>
4512
4495
  </xsl:template><xsl:template name="addBookmarks">
4513
4496
  <xsl:param name="contents"/>
@@ -4678,7 +4661,10 @@
4678
4661
  </fo:block>
4679
4662
  </xsl:if>
4680
4663
  </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">
4681
- <xsl:apply-templates mode="contents_item"/>
4664
+ <xsl:param name="mode">bookmarks</xsl:param>
4665
+ <xsl:apply-templates mode="contents_item">
4666
+ <xsl:with-param name="mode" select="$mode"/>
4667
+ </xsl:apply-templates>
4682
4668
  <!-- <xsl:text> </xsl:text> -->
4683
4669
  </xsl:template><xsl:template name="getSection">
4684
4670
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
@@ -4751,6 +4737,18 @@
4751
4737
  <xsl:copy-of select="."/>
4752
4738
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4753
4739
  <xsl:text> </xsl:text>
4740
+ </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item">
4741
+ <xsl:param name="mode">bookmarks</xsl:param>
4742
+ <xsl:apply-templates mode="contents_item">
4743
+ <xsl:with-param name="mode" select="$mode"/>
4744
+ </xsl:apply-templates>
4745
+ </xsl:template><xsl:template match="*[local-name() = 'add'][starts-with(text(), $ace_tag)]" mode="contents_item">
4746
+ <xsl:param name="mode">bookmarks</xsl:param>
4747
+ <xsl:if test="$mode = 'contents'">
4748
+ <xsl:copy>
4749
+ <xsl:apply-templates mode="contents_item"/>
4750
+ </xsl:copy>
4751
+ </xsl:if>
4754
4752
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4755
4753
 
4756
4754
  <fo:block-container margin-left="0mm">
@@ -5087,42 +5085,48 @@
5087
5085
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
5088
5086
 
5089
5087
 
5090
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5091
-
5092
- <xsl:variable name="element">
5088
+ <xsl:variable name="fo_element">
5089
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
5093
5090
  block
5094
5091
 
5095
- <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
5092
+
5096
5093
  </xsl:variable>
5097
5094
 
5095
+ <!-- display 'EXAMPLE' -->
5096
+ <xsl:apply-templates select="*[local-name()='name']">
5097
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5098
+ </xsl:apply-templates>
5099
+
5098
5100
  <xsl:choose>
5099
- <xsl:when test="contains(normalize-space($element), 'block')">
5100
- <fo:block xsl:use-attribute-sets="example-body-style">
5101
- <xsl:apply-templates/>
5102
- </fo:block>
5101
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
5102
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
5103
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5104
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5105
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5106
+ </xsl:apply-templates>
5107
+ </fo:block-container>
5108
+ </fo:block-container>
5103
5109
  </xsl:when>
5104
5110
  <xsl:otherwise>
5105
5111
  <fo:inline>
5106
- <xsl:apply-templates/>
5112
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5113
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5114
+ </xsl:apply-templates>
5107
5115
  </fo:inline>
5108
5116
  </xsl:otherwise>
5109
5117
  </xsl:choose>
5110
5118
 
5111
5119
  </fo:block>
5112
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
5113
-
5114
- <xsl:variable name="element">
5115
- block
5116
-
5117
- <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
5118
- </xsl:variable>
5120
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
5121
+ <xsl:param name="fo_element">block</xsl:param>
5122
+
5119
5123
  <xsl:choose>
5120
5124
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
5121
5125
  <fo:inline>
5122
5126
  <xsl:apply-templates/>
5123
5127
  </fo:inline>
5124
5128
  </xsl:when>
5125
- <xsl:when test="contains(normalize-space($element), 'block')">
5129
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
5126
5130
  <fo:block xsl:use-attribute-sets="example-name-style">
5127
5131
  <xsl:apply-templates/>
5128
5132
  </fo:block>
@@ -5135,17 +5139,17 @@
5135
5139
  </xsl:choose>
5136
5140
 
5137
5141
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
5142
+ <xsl:param name="fo_element">block</xsl:param>
5143
+
5138
5144
  <xsl:variable name="num"><xsl:number/></xsl:variable>
5139
5145
  <xsl:variable name="element">
5140
- block
5141
-
5142
5146
 
5147
+ <xsl:value-of select="$fo_element"/>
5143
5148
  </xsl:variable>
5144
5149
  <xsl:choose>
5145
- <xsl:when test="normalize-space($element) = 'block'">
5150
+ <xsl:when test="starts-with(normalize-space($element), 'block')">
5146
5151
  <fo:block xsl:use-attribute-sets="example-p-style">
5147
5152
 
5148
- <xsl:variable name="num"><xsl:number/></xsl:variable>
5149
5153
  <xsl:if test="$num = 1">
5150
5154
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
5151
5155
  </xsl:if>
@@ -5215,12 +5219,9 @@
5215
5219
  </fo:basic-link>
5216
5220
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
5217
5221
  <xsl:variable name="title-modified">
5218
-
5219
-
5220
- <xsl:call-template name="getTitle">
5221
- <xsl:with-param name="name" select="'title-modified'"/>
5222
- </xsl:call-template>
5223
-
5222
+ <xsl:call-template name="getLocalizedString">
5223
+ <xsl:with-param name="key">modified</xsl:with-param>
5224
+ </xsl:call-template>
5224
5225
  </xsl:variable>
5225
5226
 
5226
5227
  <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
@@ -5409,12 +5410,9 @@
5409
5410
  </fo:block>
5410
5411
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5411
5412
  <xsl:variable name="title-deprecated">
5412
-
5413
-
5414
- <xsl:call-template name="getTitle">
5415
- <xsl:with-param name="name" select="'title-deprecated'"/>
5416
- </xsl:call-template>
5417
-
5413
+ <xsl:call-template name="getLocalizedString">
5414
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5415
+ </xsl:call-template>
5418
5416
  </xsl:variable>
5419
5417
  <fo:block xsl:use-attribute-sets="deprecates-style">
5420
5418
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5423,6 +5421,8 @@
5423
5421
  <xsl:if test="*[local-name() = 'strong']">
5424
5422
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5425
5423
  </xsl:if>
5424
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]">
5425
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
5426
5426
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
5427
5427
  <fo:block xsl:use-attribute-sets="definition-style">
5428
5428
  <xsl:apply-templates/>
@@ -5755,16 +5755,30 @@
5755
5755
 
5756
5756
 
5757
5757
 
5758
-
5758
+
5759
+
5760
+
5761
+
5762
+
5763
+
5759
5764
 
5760
5765
 
5761
5766
 
5762
5767
 
5763
5768
 
5769
+
5770
+
5771
+
5772
+
5773
+ <!-- end MPFD bibitem processing -->
5774
+
5775
+ <!-- start M3D bibitem processing -->
5764
5776
 
5765
5777
 
5778
+
5779
+
5766
5780
  </xsl:template><xsl:template name="processBibitemDocId">
5767
- <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')]"/>
5781
+ <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')]"/>
5768
5782
  <xsl:choose>
5769
5783
  <xsl:when test="normalize-space($_doc_ident) != ''">
5770
5784
  <!-- <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"/>
@@ -5778,7 +5792,7 @@
5778
5792
  <xsl:if test="$type != ''">
5779
5793
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5780
5794
  </xsl:if> -->
5781
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
5795
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
5782
5796
  </xsl:otherwise>
5783
5797
  </xsl:choose>
5784
5798
  </xsl:template><xsl:template name="processPersonalAuthor">
@@ -5884,8 +5898,12 @@
5884
5898
  <fo:block> </fo:block>
5885
5899
  </fo:block-container>
5886
5900
  </xsl:template><xsl:variable name="toc_level">
5901
+ <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
5902
+ <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:-->
5903
+ <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 -->
5887
5904
  <xsl:choose>
5888
- <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
5905
+ <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
5906
+ <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
5889
5907
  <xsl:otherwise><!-- default value -->
5890
5908
 
5891
5909
 
@@ -5987,7 +6005,7 @@
5987
6005
  </td>
5988
6006
  </xsl:for-each>
5989
6007
  <td>333</td> <!-- page number, just for fill -->
5990
- </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6008
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5991
6009
  <fo:inline padding-right="5mm"> </fo:inline>
5992
6010
  <fo:inline><xsl:apply-templates/></fo:inline>
5993
6011
  </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
@@ -6359,9 +6377,15 @@
6359
6377
  </xsl:template><xsl:template name="getLocalizedString">
6360
6378
  <xsl:param name="key"/>
6361
6379
  <xsl:param name="formatted">false</xsl:param>
6380
+ <xsl:param name="lang"/>
6362
6381
 
6363
6382
  <xsl:variable name="curr_lang">
6364
- <xsl:call-template name="getLang"/>
6383
+ <xsl:choose>
6384
+ <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
6385
+ <xsl:otherwise>
6386
+ <xsl:call-template name="getLang"/>
6387
+ </xsl:otherwise>
6388
+ </xsl:choose>
6365
6389
  </xsl:variable>
6366
6390
 
6367
6391
  <xsl:variable name="data_value">
File without changes
File without changes
File without changes
@@ -1,9 +1,9 @@
1
1
  require "asciidoctor"
2
- require "asciidoctor/standoc/converter"
2
+ require "metanorma/standoc/converter"
3
3
  require "fileutils"
4
4
  require_relative "validate"
5
5
 
6
- module Asciidoctor
6
+ module Metanorma
7
7
  module UN
8
8
  class Converter < Standoc::Converter
9
9
  XML_ROOT_TAG = "un-standard".freeze
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- module Asciidoctor
1
+ module Metanorma
2
2
  module UN
3
3
  class Converter < Standoc::Converter
4
4
  def content_validate(doc)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module UN
3
- VERSION = "0.7.5".freeze
3
+ VERSION = "0.8.0".freeze
4
4
  end
5
5
  end
data/lib/metanorma/un.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "metanorma/un/processor"
2
2
  require "metanorma/un/input"
3
3
  require "metanorma/un/version"
4
+ require "metanorma/un/converter"
4
5
 
5
6
  module Metanorma
6
7
  module UN
data/lib/metanorma-un.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require "metanorma/un"
2
2
  require "asciidoctor"
3
- require "asciidoctor/un"
4
3
  require "isodoc/un"
5
4
 
6
5
  if defined? Metanorma
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "roman-numerals"
31
31
  spec.add_dependency "twitter_cldr"
32
32
 
33
- spec.add_dependency "metanorma-standoc", "~> 1.11.0"
33
+ spec.add_dependency "metanorma-standoc", "~> 2.0.0"
34
34
 
35
35
  spec.add_development_dependency "debug"
36
36
  spec.add_development_dependency "equivalent-xml", "~> 0.6"