metanorma-itu 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1699,27 +1699,6 @@
1699
1699
  </xsl:element>
1700
1700
  </xsl:template>
1701
1701
 
1702
-
1703
-
1704
- <!-- Examples:
1705
- [b-ASM] b-ASM, http://www.eecs.umich.edu/gasm/ (accessed 20 March 2018).
1706
- [b-Börger & Stärk] b-Börger & Stärk, Börger, E., and Stärk, R. S. (2003), Abstract State Machines: A Method for High-Level System Design and Analysis, Springer-Verlag.
1707
- -->
1708
- <xsl:template match="itu:annex//itu:bibitem" priority="3">
1709
- <fo:block margin-top="6pt" margin-left="10mm" text-indent="-10mm">
1710
- <fo:inline id="{@id}" padding-right="5mm">[<xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>]</fo:inline>
1711
- <xsl:text> </xsl:text>
1712
- <xsl:apply-templates select="itu:docidentifier[not(@type = 'metanorma-ordinal')]" mode="content"/>
1713
- <xsl:if test="node()[local-name(.) != current()/itu:docidentifier]">, </xsl:if>
1714
- <xsl:apply-templates/>
1715
- </fo:block>
1716
- </xsl:template>
1717
-
1718
- <xsl:template match="itu:docidentifier" mode="content">
1719
- <xsl:apply-templates/>
1720
- </xsl:template>
1721
- <xsl:template match="itu:docidentifier"/>
1722
-
1723
1702
 
1724
1703
  <xsl:template match="itu:ul | itu:ol | itu:sections/itu:ul | itu:sections/itu:ol" mode="list" priority="2">
1725
1704
  <xsl:if test="preceding-sibling::*[1][local-name() = 'title'] and $doctype != 'service-publication'">
@@ -2071,14 +2050,41 @@
2071
2050
  </xsl:if>
2072
2051
  </xsl:template>
2073
2052
 
2074
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_">
2053
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:variable name="table_widths_from_if_calculated_">
2054
+ <xsl:for-each select="$table_widths_from_if//table">
2055
+ <xsl:copy>
2056
+ <xsl:copy-of select="@*"/>
2057
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/>
2058
+ </xsl:copy>
2059
+ </xsl:for-each>
2060
+ </xsl:variable><xsl:variable name="table_widths_from_if_calculated" select="xalan:nodeset($table_widths_from_if_calculated_)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_">
2075
2061
  false
2076
2062
  </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
2077
2063
  <xsl:call-template name="getLang"/>
2078
- </xsl:variable><xsl:variable name="pageWidth_">
2079
- 210
2064
+ </xsl:variable><xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/><xsl:variable name="papersize_width_">
2065
+ <xsl:choose>
2066
+ <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
2067
+ <xsl:when test="$papersize = 'a4'">210</xsl:when>
2068
+ </xsl:choose>
2069
+ </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_">
2070
+ <xsl:choose>
2071
+ <xsl:when test="$papersize = 'letter'">279.4</xsl:when>
2072
+ <xsl:when test="$papersize = 'a4'">297</xsl:when>
2073
+ </xsl:choose>
2074
+ </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_">
2075
+ <xsl:choose>
2076
+ <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when>
2077
+ <xsl:otherwise>
2078
+ 210
2079
+ </xsl:otherwise>
2080
+ </xsl:choose>
2080
2081
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
2081
- 297
2082
+ <xsl:choose>
2083
+ <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when>
2084
+ <xsl:otherwise>
2085
+ 297
2086
+ </xsl:otherwise>
2087
+ </xsl:choose>
2082
2088
  </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
2083
2089
  20
2084
2090
  </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
@@ -2651,6 +2657,25 @@
2651
2657
 
2652
2658
 
2653
2659
 
2660
+ </xsl:attribute-set><xsl:attribute-set name="dl-name-style">
2661
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2662
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2663
+
2664
+
2665
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2666
+
2667
+
2668
+
2669
+
2670
+
2671
+
2672
+
2673
+
2674
+
2675
+
2676
+
2677
+
2678
+
2654
2679
  </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
2655
2680
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
2656
2681
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
@@ -2960,6 +2985,24 @@
2960
2985
 
2961
2986
 
2962
2987
 
2988
+ </xsl:attribute-set><xsl:attribute-set name="list-name-style">
2989
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2990
+
2991
+
2992
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2993
+
2994
+
2995
+
2996
+
2997
+
2998
+
2999
+
3000
+
3001
+
3002
+
3003
+
3004
+
3005
+
2963
3006
  </xsl:attribute-set><xsl:attribute-set name="list-item-style">
2964
3007
 
2965
3008
 
@@ -3359,13 +3402,13 @@
3359
3402
 
3360
3403
  </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="processPrefaceSectionsDefault_Contents">
3361
3404
  <xsl:variable name="nodes_preface_">
3362
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3405
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3363
3406
  <node id="{@id}"/>
3364
3407
  </xsl:for-each>
3365
3408
  </xsl:variable>
3366
3409
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
3367
3410
 
3368
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3411
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3369
3412
  <xsl:sort select="@displayorder" data-type="number"/>
3370
3413
 
3371
3414
  <!-- process Section's title -->
@@ -3431,7 +3474,7 @@
3431
3474
  </xsl:for-each>
3432
3475
  </figures>
3433
3476
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3434
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3477
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3435
3478
  <xsl:sort select="@displayorder" data-type="number"/>
3436
3479
  <xsl:apply-templates select="."/>
3437
3480
  </xsl:for-each>
@@ -4057,8 +4100,9 @@
4057
4100
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
4058
4101
  </xsl:if>
4059
4102
  </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
4060
- <xsl:param name="table"/>
4061
- <xsl:param name="if">false</xsl:param> <!-- via intermediate format -->
4103
+ <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
4104
+
4105
+ <!-- via intermediate format -->
4062
4106
 
4063
4107
  <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
4064
4108
 
@@ -4069,9 +4113,8 @@
4069
4113
  <!-- get current table id -->
4070
4114
  <xsl:variable name="table_id" select="@id"/>
4071
4115
  <!-- find table by id in the file 'table_widths' -->
4072
- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
4073
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/>
4074
-
4116
+ <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
4117
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
4075
4118
 
4076
4119
  <!-- table='<xsl:copy-of select="$table"/>' -->
4077
4120
  <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
@@ -4079,24 +4122,13 @@
4079
4122
  <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
4080
4123
 
4081
4124
  <xsl:variable name="table_with_cell_widths_">
4082
- <xsl:choose>
4083
- <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF -->
4084
-
4085
- <!-- Example: <column>10</column>
4086
- <column>11</column>
4087
- -->
4088
- <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/>
4089
- </xsl:when>
4090
- <xsl:otherwise>
4091
- <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/>
4092
- </xsl:otherwise>
4093
- </xsl:choose>
4125
+ <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
4094
4126
  </xsl:variable>
4095
4127
  <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
4096
4128
 
4097
- <xsl:if test="$table_if_debug = 'true'">
4129
+ <!-- <xsl:if test="$table_if_debug = 'true'">
4098
4130
  <xsl:copy-of select="$table_with_cell_widths"/>
4099
- </xsl:if>
4131
+ </xsl:if> -->
4100
4132
 
4101
4133
 
4102
4134
  <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
@@ -4142,8 +4174,12 @@
4142
4174
 
4143
4175
  <xsl:variable name="page_width">
4144
4176
  <xsl:choose>
4145
- <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when>
4146
- <xsl:otherwise>75</xsl:otherwise>
4177
+ <xsl:when test="$parent_table_page-width != ''">
4178
+ <xsl:value-of select="$parent_table_page-width"/>
4179
+ </xsl:when>
4180
+ <xsl:otherwise>
4181
+ <xsl:value-of select="@page-width"/>
4182
+ </xsl:otherwise>
4147
4183
  </xsl:choose>
4148
4184
  </xsl:variable>
4149
4185
 
@@ -4151,9 +4187,6 @@
4151
4187
  <table_width>
4152
4188
  <xsl:copy-of select="$table_widths"/>
4153
4189
  </table_width>
4154
- <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug>
4155
- <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug>
4156
- -->
4157
4190
  <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
4158
4191
  </xsl:if>
4159
4192
 
@@ -4164,11 +4197,11 @@
4164
4197
  <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
4165
4198
  <!-- call old algorithm -->
4166
4199
  <case1/>
4167
- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
4200
+ <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
4168
4201
  <xsl:call-template name="calculate-column-widths-proportional">
4169
4202
  <xsl:with-param name="cols-count" select="$cols-count"/>
4170
4203
  <xsl:with-param name="table" select="$table"/>
4171
- </xsl:call-template>
4204
+ </xsl:call-template> -->
4172
4205
  </xsl:when>
4173
4206
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
4174
4207
  <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
@@ -4212,95 +4245,49 @@
4212
4245
  <xsl:otherwise><unknown_case/></xsl:otherwise>
4213
4246
  </xsl:choose>
4214
4247
 
4248
+ </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm">
4215
4249
 
4216
- </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths">
4217
- <xsl:copy>
4218
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/>
4219
- </xsl:copy>
4220
- </xsl:template><xsl:template match="td | th" mode="determine_cell_widths">
4221
- <xsl:copy>
4222
- <xsl:copy-of select="@*"/>
4250
+ <!-- if nested 'dl' or 'table' -->
4251
+ <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/>
4252
+ <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id>
4223
4253
 
4224
- <!-- The maximum width is given by the widest line. -->
4225
- <xsl:variable name="widths_max">
4226
- <xsl:for-each select=".//*[local-name() = 'p']">
4227
- <xsl:call-template name="add_width"/>
4228
- </xsl:for-each>
4229
- <xsl:if test="not(*[local-name() = 'p'])">
4230
- <xsl:call-template name="add_width"/>
4231
- </xsl:if>
4232
- </xsl:variable>
4233
- <xsl:variable name="width_max">
4234
- <xsl:for-each select="xalan:nodeset($widths_max)//width">
4235
- <xsl:sort select="." data-type="number" order="descending"/>
4236
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4237
- </xsl:for-each>
4238
- </xsl:variable>
4239
- <xsl:attribute name="width_max">
4240
- <xsl:value-of select="$width_max"/>
4241
- </xsl:attribute>
4254
+ <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
4242
4255
 
4243
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
4244
- <!-- To do: image width -->
4245
- <xsl:variable name="td_text">
4246
- <xsl:apply-templates select="." mode="td_text"/>
4247
- </xsl:variable>
4248
- <xsl:variable name="words">
4249
- <xsl:variable name="string_with_added_zerospaces">
4250
- <xsl:call-template name="add-zero-spaces-java">
4251
- <xsl:with-param name="text" select="$td_text"/>
4252
- </xsl:call-template>
4256
+ <xsl:variable name="parent_table_page-width_">
4257
+ <xsl:if test="$parent_table_id != ''">
4258
+ <!-- determine column number in the parent table -->
4259
+ <xsl:variable name="parent_table_column_number">
4260
+ <xsl:choose>
4261
+ <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
4262
+ <xsl:otherwise> <!-- parent is table -->
4263
+ <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
4264
+ </xsl:otherwise>
4265
+ </xsl:choose>
4253
4266
  </xsl:variable>
4254
- <xsl:call-template name="tokenize">
4255
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
4256
- </xsl:call-template>
4257
- </xsl:variable>
4258
-
4259
- <xsl:variable name="max_word_length">
4260
- <xsl:call-template name="max_length">
4261
- <xsl:with-param name="words" select="xalan:nodeset($words)"/>
4262
- </xsl:call-template>
4263
- </xsl:variable>
4264
- <xsl:variable name="width_min">
4265
- <xsl:value-of select="$max_word_length"/>
4266
- </xsl:variable>
4267
- <xsl:attribute name="width_min">
4268
- <xsl:value-of select="$width_min"/>
4269
- </xsl:attribute>
4270
- <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals -->
4271
- <xsl:if test="$width_min &gt; $width_max">
4272
- <xsl:attribute name="width_max">
4273
- <xsl:value-of select="$width_min"/>
4274
- </xsl:attribute>
4275
- </xsl:if>
4276
- <xsl:if test="$width_min = 0">
4277
- <xsl:attribute name="width_min">1</xsl:attribute>
4267
+ <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
4268
+ <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
4278
4269
  </xsl:if>
4279
-
4280
- <xsl:apply-templates select="node()" mode="determine_cell_widths"/>
4281
-
4282
- </xsl:copy>
4283
- </xsl:template><xsl:template name="add_width">
4284
- <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable>
4285
- <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/>
4286
-
4287
- <xsl:variable name="p_text_len">
4288
- <xsl:choose>
4289
- <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters -->
4290
- <xsl:value-of select="$p_text_len_ * 1.5"/>
4291
- </xsl:when>
4292
- <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise>
4293
- </xsl:choose>
4294
4270
  </xsl:variable>
4271
+ <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
4295
4272
 
4296
- <xsl:variable name="math_addon_text">
4297
- <xsl:for-each select=".//*[local-name() = 'math']">
4298
- <xsl:apply-templates mode="td_text"/>
4299
- </xsl:for-each>
4300
- </xsl:variable>
4301
- <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% -->
4273
+ <!-- get current table id -->
4274
+ <xsl:variable name="table_id" select="@id"/>
4275
+
4276
+ <xsl:choose>
4277
+ <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''">
4278
+ <!-- find table by id in the file 'table_widths' and get all `<column>...</column> -->
4279
+ <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/>
4280
+ </xsl:when>
4281
+ <xsl:otherwise>
4282
+ <!-- recalculate columns width based on parent table width -->
4283
+ <xsl:for-each select="$table_widths_from_if//table[@id = $table_id]">
4284
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm">
4285
+ <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000-->
4286
+ </xsl:call-template>
4287
+ </xsl:for-each>
4288
+ </xsl:otherwise>
4289
+ </xsl:choose>
4302
4290
 
4303
- <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width>
4304
4291
  </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
4305
4292
  <xsl:copy>
4306
4293
  <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
@@ -5140,11 +5127,19 @@
5140
5127
 
5141
5128
 
5142
5129
 
5130
+
5131
+ <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
5132
+ <xsl:attribute name="margin-top">0</xsl:attribute>
5133
+ </xsl:if>
5134
+
5143
5135
  <fo:block>
5144
5136
 
5145
5137
 
5146
5138
 
5147
5139
 
5140
+ <xsl:apply-templates select="*[local-name() = 'name']">
5141
+ <xsl:with-param name="process">true</xsl:with-param>
5142
+ </xsl:apply-templates>
5148
5143
 
5149
5144
  <xsl:if test="$isGenerateTableIF = 'true'">
5150
5145
  <!-- to determine start of table -->
@@ -5167,6 +5162,7 @@
5167
5162
  </xsl:choose>
5168
5163
 
5169
5164
 
5165
+
5170
5166
  <xsl:choose>
5171
5167
  <xsl:when test="$isGenerateTableIF = 'true'">
5172
5168
  <!-- generate IF for table widths -->
@@ -5295,6 +5291,18 @@
5295
5291
  </xsl:if> <!-- END: a few components -->
5296
5292
  </fo:block-container>
5297
5293
  </fo:block-container>
5294
+
5295
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' -->
5296
+ <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/>
5297
+ </xsl:if>
5298
+
5299
+ </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
5300
+ <xsl:param name="process">false</xsl:param>
5301
+ <xsl:if test="$process = 'true'">
5302
+ <fo:block xsl:use-attribute-sets="dl-name-style">
5303
+ <xsl:apply-templates/>
5304
+ </fo:block>
5305
+ </xsl:if>
5298
5306
  </xsl:template><xsl:template name="setColumnWidth_dl">
5299
5307
  <xsl:param name="colwidths"/>
5300
5308
  <xsl:param name="maxlength_dt"/>
@@ -5303,6 +5311,11 @@
5303
5311
  <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
5304
5312
 
5305
5313
  <xsl:choose>
5314
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
5315
+ <xsl:call-template name="insertTableColumnWidth">
5316
+ <xsl:with-param name="colwidths" select="$colwidths"/>
5317
+ </xsl:call-template>
5318
+ </xsl:when>
5306
5319
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
5307
5320
  <fo:table-column column-width="50%"/>
5308
5321
  <fo:table-column column-width="50%"/>
@@ -5565,12 +5578,24 @@
5565
5578
  </td>
5566
5579
  <td>
5567
5580
 
5568
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/>
5581
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5582
+
5583
+ <!-- get paragraphs from nested 'dl' -->
5584
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5585
+
5569
5586
 
5570
5587
  </td>
5571
5588
  </tr>
5572
5589
 
5573
- </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']">
5590
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
5591
+ <xsl:for-each select="*[local-name() = 'dt']">
5592
+ <p>
5593
+ <xsl:copy-of select="node()"/>
5594
+ <xsl:text> </xsl:text>
5595
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/>
5596
+ </p>
5597
+ </xsl:for-each>
5598
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']">
5574
5599
  <fo:inline font-style="italic">
5575
5600
  <xsl:apply-templates/>
5576
5601
  </fo:inline>
@@ -5601,7 +5626,7 @@
5601
5626
 
5602
5627
 
5603
5628
 
5604
-
5629
+ <!-- 10 -->
5605
5630
 
5606
5631
 
5607
5632
 
@@ -7629,7 +7654,7 @@
7629
7654
 
7630
7655
 
7631
7656
 
7632
-
7657
+ <!-- 9 -->
7633
7658
 
7634
7659
 
7635
7660
  10
@@ -7713,7 +7738,7 @@
7713
7738
  <xsl:for-each select="xalan:nodeset($text_step4)/node()">
7714
7739
  <xsl:choose>
7715
7740
  <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
7716
- <xsl:call-template name="interspers">
7741
+ <xsl:call-template name="interspers-java">
7717
7742
  <xsl:with-param name="str" select="."/>
7718
7743
  </xsl:call-template>
7719
7744
  </xsl:when>
@@ -7763,6 +7788,10 @@
7763
7788
  <xsl:with-param name="char" select="$char"/>
7764
7789
  </xsl:call-template>
7765
7790
  </xsl:if>
7791
+ </xsl:template><xsl:template name="interspers-java">
7792
+ <xsl:param name="str"/>
7793
+ <xsl:param name="char" select="$zero_width_space"/>
7794
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. -->
7766
7795
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
7767
7796
  <xsl:apply-templates mode="syntax_highlight"/>
7768
7797
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -8722,6 +8751,11 @@
8722
8751
  </xsl:otherwise>
8723
8752
  </xsl:choose>
8724
8753
  </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
8754
+
8755
+ <xsl:apply-templates select="*[local-name() = 'name']">
8756
+ <xsl:with-param name="process">true</xsl:with-param>
8757
+ </xsl:apply-templates>
8758
+
8725
8759
  <fo:list-block xsl:use-attribute-sets="list-style">
8726
8760
 
8727
8761
 
@@ -8732,12 +8766,23 @@
8732
8766
 
8733
8767
 
8734
8768
 
8769
+ <xsl:if test="*[local-name() = 'name']">
8770
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8771
+ </xsl:if>
8772
+
8735
8773
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
8736
8774
  </fo:list-block>
8737
8775
  <!-- <xsl:for-each select="./iho:note">
8738
8776
  <xsl:call-template name="note"/>
8739
8777
  </xsl:for-each> -->
8740
8778
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
8779
+ </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
8780
+ <xsl:param name="process">false</xsl:param>
8781
+ <xsl:if test="$process = 'true'">
8782
+ <fo:block xsl:use-attribute-sets="list-name-style">
8783
+ <xsl:apply-templates/>
8784
+ </fo:block>
8785
+ </xsl:if>
8741
8786
  </xsl:template><xsl:template match="*[local-name()='li']">
8742
8787
  <fo:list-item xsl:use-attribute-sets="list-item-style">
8743
8788
  <xsl:copy-of select="@id"/>
@@ -9017,7 +9062,7 @@
9017
9062
  </xsl:template><xsl:template name="processBibitem">
9018
9063
 
9019
9064
 
9020
-
9065
+
9021
9066
  <!-- Example: [ITU-T A.23] ITU-T A.23, Recommendation ITU-T A.23, Annex A (2014), Guide for ITU-T and ISO/IEC JTC 1 cooperation. -->
9022
9067
  <xsl:if test="$doctype = 'implementers-guide'">
9023
9068
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -9025,46 +9070,26 @@
9025
9070
  </xsl:if>
9026
9071
 
9027
9072
  <xsl:variable name="bibitem_label">
9028
- <xsl:choose>
9029
- <xsl:when test="itu:docidentifier[@type = 'metanorma']">
9030
- <xsl:value-of select="itu:docidentifier[@type = 'metanorma']"/>
9031
- </xsl:when>
9032
- <xsl:otherwise>
9033
- <fo:inline padding-right="5mm">
9034
- <xsl:text>[</xsl:text>
9035
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9036
- <xsl:text>] </xsl:text>
9037
- </fo:inline>
9038
- </xsl:otherwise>
9039
- </xsl:choose>
9073
+ <xsl:value-of select="itu:docidentifier[@type = 'metanorma']"/>
9074
+ <xsl:if test="not(itu:docidentifier[@type = 'metanorma'])">
9075
+ <fo:inline padding-right="5mm">
9076
+ <xsl:text>[</xsl:text>
9077
+ <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9078
+ <xsl:text>] </xsl:text>
9079
+ </fo:inline>
9080
+ </xsl:if>
9040
9081
  </xsl:variable>
9041
9082
 
9042
9083
  <xsl:variable name="bibitem_body">
9043
9084
  <xsl:text> </xsl:text>
9044
9085
  <xsl:choose>
9045
9086
  <xsl:when test="itu:docidentifier[@type = 'metanorma']">
9046
- <xsl:if test="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]">
9047
- <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
9048
- <xsl:text>, </xsl:text>
9049
- </xsl:if>
9087
+ <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
9050
9088
  </xsl:when>
9051
9089
  <xsl:otherwise>
9052
9090
  <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9053
- <xsl:if test="itu:title">
9054
- <xsl:text>, </xsl:text>
9055
- </xsl:if>
9056
9091
  </xsl:otherwise>
9057
9092
  </xsl:choose>
9058
- <xsl:if test="itu:title">
9059
- <xsl:choose>
9060
- <xsl:when test="itu:title[@type = 'main' and @language = 'en']">
9061
- <xsl:apply-templates select="itu:title[@type = 'main' and @language = 'en']"/>
9062
- </xsl:when>
9063
- <xsl:otherwise>
9064
- <xsl:apply-templates select="itu:title"/>
9065
- </xsl:otherwise>
9066
- </xsl:choose>
9067
- </xsl:if>
9068
9093
  <xsl:if test="itu:formattedref and not(itu:docidentifier[@type = 'metanorma'])">, </xsl:if>
9069
9094
  <xsl:apply-templates select="itu:formattedref"/>
9070
9095
  </xsl:variable>
@@ -9081,7 +9106,7 @@
9081
9106
  </fo:table-row>
9082
9107
  </fo:table-body>
9083
9108
  </fo:table>
9084
- </xsl:when>
9109
+ </xsl:when> <!-- $doctype = 'implementers-guide' -->
9085
9110
  <xsl:otherwise>
9086
9111
  <xsl:copy-of select="$bibitem_label"/>
9087
9112
  <xsl:copy-of select="$bibitem_body"/>
@@ -9406,25 +9431,32 @@
9406
9431
  </fo:block-container>
9407
9432
 
9408
9433
  </xsl:template><xsl:template name="displayAdmonitionName">
9409
-
9434
+ <xsl:param name="sep"/> <!-- Example: ' - ' -->
9435
+ <!-- <xsl:choose>
9436
+ <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
9437
+ <xsl:choose>
9438
+ <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when>
9439
+ <xsl:otherwise>
9440
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
9441
+ </xsl:otherwise>
9442
+ </xsl:choose>
9443
+ </xsl:when>
9444
+ <xsl:otherwise>
9410
9445
  <xsl:apply-templates select="*[local-name() = 'name']"/>
9411
9446
  <xsl:if test="not(*[local-name() = 'name'])">
9412
9447
  <xsl:apply-templates select="@type"/>
9413
9448
  </xsl:if>
9414
-
9415
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
9416
- <xsl:apply-templates/>
9417
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
9418
- <xsl:variable name="admonition_type_">
9419
- <xsl:call-template name="getLocalizedString">
9420
- <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
9421
- </xsl:call-template>
9449
+ </xsl:otherwise>
9450
+ </xsl:choose> -->
9451
+ <xsl:variable name="name">
9452
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
9422
9453
  </xsl:variable>
9423
- <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
9424
- <xsl:value-of select="$admonition_type"/>
9425
- <xsl:if test="$admonition_type = ''">
9426
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
9454
+ <xsl:copy-of select="$name"/>
9455
+ <xsl:if test="normalize-space($name) != ''">
9456
+ <xsl:value-of select="$sep"/>
9427
9457
  </xsl:if>
9458
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
9459
+ <xsl:apply-templates/>
9428
9460
  </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
9429
9461
 
9430
9462
  <fo:block xsl:use-attribute-sets="admonition-p-style">