metanorma-iso 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +142 -10
  3. data/lib/isodoc/iso/base_convert.rb +10 -0
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +170 -252
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +170 -245
  7. data/lib/isodoc/iso/html/isodoc.css +38 -13
  8. data/lib/isodoc/iso/html/isodoc.scss +38 -12
  9. data/lib/isodoc/iso/html/style-human.css +14 -1
  10. data/lib/isodoc/iso/html/style-human.scss +10 -1
  11. data/lib/isodoc/iso/html/style-iso.css +35 -23
  12. data/lib/isodoc/iso/html/style-iso.scss +31 -23
  13. data/lib/isodoc/iso/html/word_iso_intro-dis.html +1 -6
  14. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +24 -13
  15. data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -2
  17. data/lib/isodoc/iso/html_convert.rb +5 -0
  18. data/lib/isodoc/iso/i18n-en.yaml +32 -4
  19. data/lib/isodoc/iso/i18n-fr.yaml +29 -3
  20. data/lib/isodoc/iso/i18n-ru.yaml +32 -4
  21. data/lib/isodoc/iso/i18n-zh-Hans.yaml +32 -3
  22. data/lib/isodoc/iso/i18n.rb +1 -1
  23. data/lib/isodoc/iso/iso.amendment.xsl +332 -187
  24. data/lib/isodoc/iso/iso.international-standard.xsl +332 -187
  25. data/lib/isodoc/iso/metadata.rb +63 -63
  26. data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
  27. data/lib/isodoc/iso/presentation_xml_convert.rb +14 -3
  28. data/lib/isodoc/iso/presentation_xref.rb +8 -2
  29. data/lib/isodoc/iso/sections.rb +1 -1
  30. data/lib/isodoc/iso/word_cleanup.rb +3 -0
  31. data/lib/isodoc/iso/word_convert.rb +6 -3
  32. data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
  33. data/lib/isodoc/iso/word_dis_convert.rb +47 -108
  34. data/lib/isodoc/iso/xref.rb +34 -6
  35. data/lib/metanorma/iso/base.rb +20 -1
  36. data/lib/metanorma/iso/biblio.rng +32 -34
  37. data/lib/metanorma/iso/boilerplate-fr.xml +3 -0
  38. data/lib/metanorma/iso/boilerplate-ru.xml +3 -0
  39. data/lib/metanorma/iso/boilerplate.xml +3 -0
  40. data/lib/metanorma/iso/cleanup.rb +28 -1
  41. data/lib/metanorma/iso/front.rb +31 -6
  42. data/lib/metanorma/iso/front_id.rb +2 -0
  43. data/lib/metanorma/iso/isodoc.rng +9 -0
  44. data/lib/metanorma/iso/isostandard.rng +30 -12
  45. data/lib/metanorma/iso/macros.rb +29 -0
  46. data/lib/metanorma/iso/version.rb +1 -1
  47. data/spec/isodoc/amd_spec.rb +4 -30
  48. data/spec/isodoc/blocks_spec.rb +499 -2
  49. data/spec/isodoc/i18n_spec.rb +145 -80
  50. data/spec/isodoc/iso_spec.rb +50 -169
  51. data/spec/isodoc/metadata_spec.rb +224 -83
  52. data/spec/isodoc/postproc_spec.rb +41 -5
  53. data/spec/isodoc/section_spec.rb +12 -6
  54. data/spec/isodoc/word_dis_spec.rb +1273 -147
  55. data/spec/isodoc/xref_spec.rb +87 -13
  56. data/spec/metanorma/amd_spec.rb +53 -1
  57. data/spec/metanorma/base_spec.rb +185 -10
  58. data/spec/metanorma/blocks_spec.rb +54 -0
  59. data/spec/metanorma/lists_spec.rb +2 -2
  60. data/spec/metanorma/section_spec.rb +2 -2
  61. data/spec/spec_helper.rb +13 -4
  62. data/spec/vcr_cassettes/withdrawn_iso.yml +27 -27
  63. metadata +7 -8
  64. data/docs/asciiiso-syntax.adoc +0 -307
  65. data/docs/guidance.adoc +0 -487
  66. data/docs/navigation.adoc +0 -23
  67. data/docs/quickstart.adoc +0 -179
  68. data/lib/isodoc/iso/presentation_inline.rb +0 -90
@@ -195,22 +195,48 @@
195
195
  </xsl:variable>
196
196
 
197
197
  <xsl:variable name="editorialgroup_">
198
- <xsl:variable name="data">
199
- <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee[normalize-space(@number) != '']">
200
- <xsl:text>/TC </xsl:text><fo:inline font-weight="bold"><xsl:value-of select="@number"/></fo:inline>
201
- </xsl:for-each>
202
- <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:subcommittee[normalize-space(@number) != '']">
203
- <xsl:text>/SC </xsl:text><fo:inline font-weight="bold"><xsl:value-of select="@number"/></fo:inline>
198
+ <!-- Example: ISO/TC 46/SC 2 -->
199
+ <!-- ISO/SG SMART/SG TS/AG 1 -->
200
+ <xsl:variable name="approvalgroup" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:approvalgroup/@identifier)"/>
201
+ <xsl:variable name="parts_by_slash">
202
+ <xsl:call-template name="split">
203
+ <xsl:with-param name="pText" select="$approvalgroup"/>
204
+ <xsl:with-param name="sep" select="'/'"/>
205
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
206
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
207
+ </xsl:call-template>
208
+ </xsl:variable>
209
+ <xsl:variable name="parts_with_subparts">
210
+ <xsl:for-each select="xalan:nodeset($parts_by_slash)//item">
211
+ <subitem>
212
+ <xsl:call-template name="split">
213
+ <xsl:with-param name="pText" select="."/>
214
+ <xsl:with-param name="sep" select="' '"/>
215
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
216
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
217
+ </xsl:call-template>
218
+ </subitem>
204
219
  </xsl:for-each>
205
- <xsl:if test="not($stage-abbreviation = 'DIS' or $stage-abbreviation = 'FDIS')">
206
- <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup[normalize-space(@number) != '']">
207
- <xsl:text>/WG </xsl:text><fo:inline font-weight="bold"><xsl:value-of select="@number"/></fo:inline>
208
- </xsl:for-each>
209
- </xsl:if>
210
220
  </xsl:variable>
211
- <xsl:if test="normalize-space($data) != ''">
212
- <xsl:text>ISO</xsl:text><xsl:copy-of select="$data"/>
213
- </xsl:if>
221
+ <xsl:for-each select="xalan:nodeset($parts_with_subparts)//subitem">
222
+ <xsl:choose>
223
+ <xsl:when test="position() = 1">
224
+ <xsl:value-of select="."/>
225
+ </xsl:when>
226
+ <xsl:otherwise>
227
+ <xsl:for-each select="item">
228
+ <xsl:choose>
229
+ <xsl:when test="position() = last()">
230
+ <fo:inline font-weight="bold"><xsl:value-of select="."/></fo:inline>
231
+ </xsl:when>
232
+ <xsl:otherwise>
233
+ <xsl:value-of select="."/>
234
+ </xsl:otherwise>
235
+ </xsl:choose>
236
+ </xsl:for-each>
237
+ </xsl:otherwise>
238
+ </xsl:choose>
239
+ </xsl:for-each>
214
240
  </xsl:variable>
215
241
  <xsl:variable name="editorialgroup" select="xalan:nodeset($editorialgroup_)"/>
216
242
 
@@ -264,25 +290,25 @@
264
290
  </fo:simple-page-master>
265
291
 
266
292
  <fo:simple-page-master master-name="cover-page-published" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
267
- <fo:region-body margin-top="12.7mm" margin-bottom="40mm" margin-left="78mm" margin-right="18.5mm"/>
293
+ <fo:region-body margin-top="12.7mm" margin-bottom="75mm" margin-left="78mm" margin-right="18.5mm"/>
268
294
  <fo:region-before region-name="cover-page-header" extent="12.7mm"/>
269
- <fo:region-after region-name="cover-page-footer" extent="40mm" display-align="after"/>
295
+ <fo:region-after region-name="cover-page-footer" extent="75mm" display-align="after"/>
270
296
  <fo:region-start region-name="cover-left-region" extent="78mm"/>
271
297
  <fo:region-end region-name="cover-right-region" extent="18.5mm"/>
272
298
  </fo:simple-page-master>
273
299
 
274
300
 
275
301
  <fo:simple-page-master master-name="cover-page-publishedISO-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
276
- <fo:region-body margin-top="12.7mm" margin-bottom="40mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
302
+ <fo:region-body margin-top="12.7mm" margin-bottom="75mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
277
303
  <fo:region-before region-name="cover-page-header" extent="12.7mm"/>
278
- <fo:region-after region-name="cover-page-footer" extent="40mm" display-align="after"/>
304
+ <fo:region-after region-name="cover-page-footer" extent="75mm" display-align="after"/>
279
305
  <fo:region-start region-name="cover-left-region" extent="{$marginLeftRight1}mm"/>
280
306
  <fo:region-end region-name="cover-right-region" extent="{$marginLeftRight2}mm"/>
281
307
  </fo:simple-page-master>
282
308
  <fo:simple-page-master master-name="cover-page-publishedISO-even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
283
- <fo:region-body margin-top="12.7mm" margin-bottom="40mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
309
+ <fo:region-body margin-top="12.7mm" margin-bottom="75mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
284
310
  <fo:region-before region-name="cover-page-header" extent="12.7mm"/>
285
- <fo:region-after region-name="cover-page-footer" extent="40mm" display-align="after"/>
311
+ <fo:region-after region-name="cover-page-footer" extent="75mm" display-align="after"/>
286
312
  <fo:region-start region-name="cover-left-region" extent="{$marginLeftRight2}mm"/>
287
313
  <fo:region-end region-name="cover-right-region" extent="{$marginLeftRight1}mm"/>
288
314
  </fo:simple-page-master>
@@ -431,9 +457,9 @@
431
457
  <fo:table-column column-width="112.5mm"/>
432
458
  <fo:table-body>
433
459
  <fo:table-row>
434
- <fo:table-cell font-size="6.5pt" text-align="justify" display-align="after" padding-bottom="8mm"><!-- before -->
460
+ <fo:table-cell font-size="6.5pt" text-align="justify" display-align="after" padding-bottom="8mm">
435
461
  <!-- margin-top="-30mm" -->
436
- <fo:block margin-top="-100mm">
462
+ <fo:block> <!-- margin-top="-100mm" -->
437
463
  <xsl:if test="$stage-abbreviation = 'DIS' or $stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
438
464
  <fo:block margin-bottom="1.5mm">
439
465
  <xsl:text>THIS DOCUMENT IS A DRAFT CIRCULATED FOR COMMENT AND APPROVAL. IT IS THEREFORE SUBJECT TO CHANGE AND MAY NOT BE REFERRED TO AS AN INTERNATIONAL STANDARD UNTIL PUBLISHED AS SUCH.</xsl:text>
@@ -463,17 +489,50 @@
463
489
  <fo:table-cell>
464
490
  <fo:block> </fo:block>
465
491
  </fo:table-cell>
466
- <fo:table-cell>
467
- <xsl:if test="$stage-abbreviation = 'DIS'">
468
- <fo:block-container margin-top="-15mm" margin-bottom="7mm" margin-left="1mm">
469
- <fo:block font-size="9pt" border="0.5pt solid black" fox:border-radius="5pt" padding-left="2mm" padding-top="2mm" padding-bottom="2mm">
470
- <xsl:text>This document is circulated as received from the committee secretariat.</xsl:text>
471
- </fo:block>
472
- </fo:block-container>
473
- </xsl:if>
492
+ <fo:table-cell display-align="after" padding-bottom="3mm">
493
+ <fo:block-container height="22.5mm" display-align="center">
494
+
495
+ <xsl:variable name="iso-fast-track">false</xsl:variable>
496
+
497
+ <xsl:if test="normalize-space($iso-fast-track) = 'true'">
498
+ <xsl:attribute name="height">28mm</xsl:attribute>
499
+ </xsl:if>
500
+
501
+ <fo:block>
502
+ <xsl:if test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'DIS' or $stage-abbreviation = 'FDIS'">
503
+ <xsl:variable name="text">
504
+ <xsl:for-each select="/iso:iso-standard/iso:preface/iso:note[@coverpage='true']/iso:p">
505
+ <fo:block>
506
+ <xsl:apply-templates/>
507
+ </fo:block>
508
+ </xsl:for-each>
509
+ </xsl:variable>
510
+ <xsl:if test="normalize-space($text) != ''">
511
+ <fo:block-container margin-left="1mm"> <!-- margin-bottom="7mm" margin-top="-15mm" -->
512
+ <fo:block font-size="9pt" border="0.5pt solid black" fox:border-radius="5pt" padding-left="2mm" padding-top="2mm" padding-bottom="2mm">
513
+ <!-- <xsl:text>This document is circulated as received from the committee secretariat.</xsl:text> -->
514
+ <xsl:copy-of select="xalan:nodeset($text)/node()"/>
515
+ </fo:block>
516
+ </fo:block-container>
517
+ </xsl:if>
518
+
519
+ <xsl:if test="normalize-space($iso-fast-track) = 'true'">
520
+ <fo:block-container space-before="2mm">
521
+ <fo:block background-color="rgb(77,77,77)" color="white" fox:border-radius="5pt" text-align="center" display-align="center" font-size="19pt" font-weight="bold">
522
+ <fo:block-container height="13.2mm">
523
+ <fo:block>
524
+ <xsl:text>FAST TRACK PROCEDURE</xsl:text>
525
+ </fo:block>
526
+ </fo:block-container>
527
+ </fo:block>
528
+ </fo:block-container>
529
+ </xsl:if>
530
+ </xsl:if>
531
+ </fo:block>
532
+ </fo:block-container>
474
533
  <fo:block>
475
534
  <xsl:call-template name="insertTripleLine"/>
476
- <fo:table table-layout="fixed" width="100%" margin-bottom="3mm">
535
+ <fo:table table-layout="fixed" width="100%"> <!-- margin-bottom="3mm" -->
477
536
  <fo:table-column column-width="50%"/>
478
537
  <fo:table-column column-width="50%"/>
479
538
  <fo:table-body>
@@ -713,7 +772,7 @@
713
772
  <xsl:call-template name="printEdition"/>
714
773
  </xsl:if>
715
774
  <xsl:choose>
716
- <xsl:when test="($stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD') and /iso:iso-standard/iso:bibdata/iso:version/iso:revision-date">
775
+ <xsl:when test="($stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'FDIS') and /iso:iso-standard/iso:bibdata/iso:version/iso:revision-date">
717
776
  <xsl:value-of select="$linebreak"/>
718
777
  <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/>
719
778
  </xsl:when>
@@ -756,7 +815,7 @@
756
815
  <fo:table-cell><fo:block/></fo:table-cell>
757
816
  <fo:table-cell number-columns-spanned="2" font-size="10pt" line-height="1.2" display-align="center">
758
817
  <fo:block>
759
- <xsl:if test="$stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
818
+ <xsl:if test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'FDIS'">
760
819
  <fo:table table-layout="fixed" width="100%">
761
820
  <fo:table-column column-width="50%"/>
762
821
  <fo:table-column column-width="50%"/>
@@ -868,7 +927,7 @@
868
927
  </fo:block>
869
928
  </xsl:for-each>
870
929
 
871
- <xsl:if test="$stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
930
+ <xsl:if test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'FDIS'">
872
931
  <fo:block margin-top="10mm">
873
932
  <xsl:copy-of select="$ics"/>
874
933
  </fo:block>
@@ -2017,16 +2076,43 @@
2017
2076
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAFEAAABHCAIAAADwYjznAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA66SURBVHhezZt5sM/VG8fNVH7JruxkSZKQ3TAYS7aGaj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zXauDDevmQMhwm2/gG01CySfXH+sDRoau7d+8upsBx5v3EB9gCFoa3OAbFXkIEvyqZ0hBRxrbh2CN8IE8covc/GUyZiwAislX1mwzuVTLD4eDDDz8U2YDzyZMnK1WqpA1AC4SxY8fiZGhrFL/0BYCsqimlMfjKWBlEZFX9UjA5aJH9qzQRYH/fvn3hAiN4Ebncfy5duuQ4Dx48mLyibzRq0aLFDz/8QAIE7I28Ik+9btk4fzYAOO/bt6927dpyNYA299OAM3ncfySTvXiOjh49msvw8OHDrYxUTekj0tLgV5FVNcFgelV9+J/iNrOqfR02bNibb77JrhY1uZN3yPnz5wsdOHDA/uYmQJvPNAUSIlXBlw1xlSBux5wa+6CN38yqEoD0Bl+JAC/YQUruROYxV+jPP//UHzhDN7vbguQIctJHELdZrDIRDUhwUpBTS/T6BP8SJUrwjA32M9cj/d/zILuFV3MTBKua0qomhOoAvtJgn0yQbBogpcFpQ5jG9BEhUvpVARmO7dq141QOOF++fJk0Vq5cOb5pVf5PoLBMHvDiFtShQwf9EuzOZ3D06NFNmzbpfKI0KPUDyVZK8GUrfZjeBCsFk4MWubYJPnswvSFSFVBu3ryZJ5fj+e+//wVuVmgt0lkFPgAAAABJRU5ErkJggg==</xsl:text>
2018
2077
  </xsl:variable>
2019
2078
 
2020
- <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_">
2079
+ <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_">
2080
+ <xsl:for-each select="$table_widths_from_if//table">
2081
+ <xsl:copy>
2082
+ <xsl:copy-of select="@*"/>
2083
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/>
2084
+ </xsl:copy>
2085
+ </xsl:for-each>
2086
+ </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_">
2021
2087
 
2022
2088
  <xsl:value-of select="normalize-space($table_if) = 'true'"/>
2023
2089
 
2024
2090
  </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
2025
2091
  <xsl:call-template name="getLang"/>
2026
- </xsl:variable><xsl:variable name="pageWidth_">
2027
- 210
2092
+ </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_">
2093
+ <xsl:choose>
2094
+ <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
2095
+ <xsl:when test="$papersize = 'a4'">210</xsl:when>
2096
+ </xsl:choose>
2097
+ </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_">
2098
+ <xsl:choose>
2099
+ <xsl:when test="$papersize = 'letter'">279.4</xsl:when>
2100
+ <xsl:when test="$papersize = 'a4'">297</xsl:when>
2101
+ </xsl:choose>
2102
+ </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_">
2103
+ <xsl:choose>
2104
+ <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when>
2105
+ <xsl:otherwise>
2106
+ 210
2107
+ </xsl:otherwise>
2108
+ </xsl:choose>
2028
2109
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
2029
- 297
2110
+ <xsl:choose>
2111
+ <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when>
2112
+ <xsl:otherwise>
2113
+ 297
2114
+ </xsl:otherwise>
2115
+ </xsl:choose>
2030
2116
  </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
2031
2117
  25
2032
2118
  </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
@@ -2636,6 +2722,25 @@
2636
2722
 
2637
2723
 
2638
2724
 
2725
+ </xsl:attribute-set><xsl:attribute-set name="dl-name-style">
2726
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2727
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2728
+
2729
+
2730
+
2731
+
2732
+
2733
+
2734
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2735
+
2736
+
2737
+
2738
+
2739
+
2740
+
2741
+
2742
+
2743
+
2639
2744
  </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
2640
2745
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
2641
2746
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
@@ -2962,6 +3067,25 @@
2962
3067
 
2963
3068
 
2964
3069
 
3070
+ </xsl:attribute-set><xsl:attribute-set name="list-name-style">
3071
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3072
+
3073
+
3074
+
3075
+
3076
+
3077
+
3078
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
3079
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3080
+
3081
+
3082
+
3083
+
3084
+
3085
+
3086
+
3087
+
3088
+
2965
3089
  </xsl:attribute-set><xsl:attribute-set name="list-item-style">
2966
3090
 
2967
3091
 
@@ -3356,13 +3480,13 @@
3356
3480
 
3357
3481
  </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">
3358
3482
  <xsl:variable name="nodes_preface_">
3359
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3483
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3360
3484
  <node id="{@id}"/>
3361
3485
  </xsl:for-each>
3362
3486
  </xsl:variable>
3363
3487
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
3364
3488
 
3365
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3489
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3366
3490
  <xsl:sort select="@displayorder" data-type="number"/>
3367
3491
 
3368
3492
  <!-- process Section's title -->
@@ -3428,7 +3552,7 @@
3428
3552
  </xsl:for-each>
3429
3553
  </figures>
3430
3554
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3431
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3555
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3432
3556
  <xsl:sort select="@displayorder" data-type="number"/>
3433
3557
  <xsl:apply-templates select="."/>
3434
3558
  </xsl:for-each>
@@ -3895,11 +4019,7 @@
3895
4019
  <xsl:param name="table"/>
3896
4020
  <xsl:param name="cols-count"/>
3897
4021
 
3898
- <xsl:call-template name="calculate-column-widths-autolayout-algorithm">
3899
- <xsl:with-param name="cols-count" select="$cols-count"/>
3900
- <xsl:with-param name="table" select="$table"/>
3901
- <xsl:with-param name="if">true</xsl:with-param>
3902
- </xsl:call-template>
4022
+ <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
3903
4023
 
3904
4024
  </xsl:template><xsl:template name="calculate-column-widths-proportional">
3905
4025
  <xsl:param name="table"/>
@@ -4047,8 +4167,9 @@
4047
4167
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
4048
4168
  </xsl:if>
4049
4169
  </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
4050
- <xsl:param name="table"/>
4051
- <xsl:param name="if">false</xsl:param> <!-- via intermediate format -->
4170
+ <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
4171
+
4172
+ <!-- via intermediate format -->
4052
4173
 
4053
4174
  <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
4054
4175
 
@@ -4059,9 +4180,8 @@
4059
4180
  <!-- get current table id -->
4060
4181
  <xsl:variable name="table_id" select="@id"/>
4061
4182
  <!-- find table by id in the file 'table_widths' -->
4062
- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
4063
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/>
4064
-
4183
+ <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
4184
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
4065
4185
 
4066
4186
  <!-- table='<xsl:copy-of select="$table"/>' -->
4067
4187
  <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
@@ -4069,24 +4189,13 @@
4069
4189
  <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
4070
4190
 
4071
4191
  <xsl:variable name="table_with_cell_widths_">
4072
- <xsl:choose>
4073
- <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF -->
4074
-
4075
- <!-- Example: <column>10</column>
4076
- <column>11</column>
4077
- -->
4078
- <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/>
4079
- </xsl:when>
4080
- <xsl:otherwise>
4081
- <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/>
4082
- </xsl:otherwise>
4083
- </xsl:choose>
4192
+ <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
4084
4193
  </xsl:variable>
4085
4194
  <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
4086
4195
 
4087
- <xsl:if test="$table_if_debug = 'true'">
4196
+ <!-- <xsl:if test="$table_if_debug = 'true'">
4088
4197
  <xsl:copy-of select="$table_with_cell_widths"/>
4089
- </xsl:if>
4198
+ </xsl:if> -->
4090
4199
 
4091
4200
 
4092
4201
  <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
@@ -4132,8 +4241,12 @@
4132
4241
 
4133
4242
  <xsl:variable name="page_width">
4134
4243
  <xsl:choose>
4135
- <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when>
4136
- <xsl:otherwise>75</xsl:otherwise>
4244
+ <xsl:when test="$parent_table_page-width != ''">
4245
+ <xsl:value-of select="$parent_table_page-width"/>
4246
+ </xsl:when>
4247
+ <xsl:otherwise>
4248
+ <xsl:value-of select="@page-width"/>
4249
+ </xsl:otherwise>
4137
4250
  </xsl:choose>
4138
4251
  </xsl:variable>
4139
4252
 
@@ -4141,9 +4254,6 @@
4141
4254
  <table_width>
4142
4255
  <xsl:copy-of select="$table_widths"/>
4143
4256
  </table_width>
4144
- <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug>
4145
- <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug>
4146
- -->
4147
4257
  <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
4148
4258
  </xsl:if>
4149
4259
 
@@ -4154,11 +4264,11 @@
4154
4264
  <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
4155
4265
  <!-- call old algorithm -->
4156
4266
  <case1/>
4157
- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
4267
+ <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
4158
4268
  <xsl:call-template name="calculate-column-widths-proportional">
4159
4269
  <xsl:with-param name="cols-count" select="$cols-count"/>
4160
4270
  <xsl:with-param name="table" select="$table"/>
4161
- </xsl:call-template>
4271
+ </xsl:call-template> -->
4162
4272
  </xsl:when>
4163
4273
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
4164
4274
  <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
@@ -4202,95 +4312,49 @@
4202
4312
  <xsl:otherwise><unknown_case/></xsl:otherwise>
4203
4313
  </xsl:choose>
4204
4314
 
4315
+ </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm">
4205
4316
 
4206
- </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths">
4207
- <xsl:copy>
4208
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/>
4209
- </xsl:copy>
4210
- </xsl:template><xsl:template match="td | th" mode="determine_cell_widths">
4211
- <xsl:copy>
4212
- <xsl:copy-of select="@*"/>
4317
+ <!-- if nested 'dl' or 'table' -->
4318
+ <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/>
4319
+ <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id>
4213
4320
 
4214
- <!-- The maximum width is given by the widest line. -->
4215
- <xsl:variable name="widths_max">
4216
- <xsl:for-each select=".//*[local-name() = 'p']">
4217
- <xsl:call-template name="add_width"/>
4218
- </xsl:for-each>
4219
- <xsl:if test="not(*[local-name() = 'p'])">
4220
- <xsl:call-template name="add_width"/>
4221
- </xsl:if>
4222
- </xsl:variable>
4223
- <xsl:variable name="width_max">
4224
- <xsl:for-each select="xalan:nodeset($widths_max)//width">
4225
- <xsl:sort select="." data-type="number" order="descending"/>
4226
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4227
- </xsl:for-each>
4228
- </xsl:variable>
4229
- <xsl:attribute name="width_max">
4230
- <xsl:value-of select="$width_max"/>
4231
- </xsl:attribute>
4321
+ <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
4232
4322
 
4233
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
4234
- <!-- To do: image width -->
4235
- <xsl:variable name="td_text">
4236
- <xsl:apply-templates select="." mode="td_text"/>
4237
- </xsl:variable>
4238
- <xsl:variable name="words">
4239
- <xsl:variable name="string_with_added_zerospaces">
4240
- <xsl:call-template name="add-zero-spaces-java">
4241
- <xsl:with-param name="text" select="$td_text"/>
4242
- </xsl:call-template>
4323
+ <xsl:variable name="parent_table_page-width_">
4324
+ <xsl:if test="$parent_table_id != ''">
4325
+ <!-- determine column number in the parent table -->
4326
+ <xsl:variable name="parent_table_column_number">
4327
+ <xsl:choose>
4328
+ <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
4329
+ <xsl:otherwise> <!-- parent is table -->
4330
+ <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
4331
+ </xsl:otherwise>
4332
+ </xsl:choose>
4243
4333
  </xsl:variable>
4244
- <xsl:call-template name="tokenize">
4245
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
4246
- </xsl:call-template>
4247
- </xsl:variable>
4248
-
4249
- <xsl:variable name="max_word_length">
4250
- <xsl:call-template name="max_length">
4251
- <xsl:with-param name="words" select="xalan:nodeset($words)"/>
4252
- </xsl:call-template>
4253
- </xsl:variable>
4254
- <xsl:variable name="width_min">
4255
- <xsl:value-of select="$max_word_length"/>
4256
- </xsl:variable>
4257
- <xsl:attribute name="width_min">
4258
- <xsl:value-of select="$width_min"/>
4259
- </xsl:attribute>
4260
- <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals -->
4261
- <xsl:if test="$width_min &gt; $width_max">
4262
- <xsl:attribute name="width_max">
4263
- <xsl:value-of select="$width_min"/>
4264
- </xsl:attribute>
4265
- </xsl:if>
4266
- <xsl:if test="$width_min = 0">
4267
- <xsl:attribute name="width_min">1</xsl:attribute>
4334
+ <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
4335
+ <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
4268
4336
  </xsl:if>
4269
-
4270
- <xsl:apply-templates select="node()" mode="determine_cell_widths"/>
4271
-
4272
- </xsl:copy>
4273
- </xsl:template><xsl:template name="add_width">
4274
- <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable>
4275
- <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/>
4276
-
4277
- <xsl:variable name="p_text_len">
4278
- <xsl:choose>
4279
- <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters -->
4280
- <xsl:value-of select="$p_text_len_ * 1.5"/>
4281
- </xsl:when>
4282
- <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise>
4283
- </xsl:choose>
4284
4337
  </xsl:variable>
4338
+ <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
4285
4339
 
4286
- <xsl:variable name="math_addon_text">
4287
- <xsl:for-each select=".//*[local-name() = 'math']">
4288
- <xsl:apply-templates mode="td_text"/>
4289
- </xsl:for-each>
4290
- </xsl:variable>
4291
- <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% -->
4340
+ <!-- get current table id -->
4341
+ <xsl:variable name="table_id" select="@id"/>
4342
+
4343
+ <xsl:choose>
4344
+ <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''">
4345
+ <!-- find table by id in the file 'table_widths' and get all `<column>...</column> -->
4346
+ <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/>
4347
+ </xsl:when>
4348
+ <xsl:otherwise>
4349
+ <!-- recalculate columns width based on parent table width -->
4350
+ <xsl:for-each select="$table_widths_from_if//table[@id = $table_id]">
4351
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm">
4352
+ <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000-->
4353
+ </xsl:call-template>
4354
+ </xsl:for-each>
4355
+ </xsl:otherwise>
4356
+ </xsl:choose>
4292
4357
 
4293
- <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width>
4294
4358
  </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
4295
4359
  <xsl:copy>
4296
4360
  <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
@@ -5162,11 +5226,19 @@
5162
5226
 
5163
5227
 
5164
5228
 
5229
+
5230
+ <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
5231
+ <xsl:attribute name="margin-top">0</xsl:attribute>
5232
+ </xsl:if>
5233
+
5165
5234
  <fo:block>
5166
5235
 
5167
5236
 
5168
5237
 
5169
5238
 
5239
+ <xsl:apply-templates select="*[local-name() = 'name']">
5240
+ <xsl:with-param name="process">true</xsl:with-param>
5241
+ </xsl:apply-templates>
5170
5242
 
5171
5243
  <xsl:if test="$isGenerateTableIF = 'true'">
5172
5244
  <!-- to determine start of table -->
@@ -5189,6 +5261,9 @@
5189
5261
  </xsl:choose>
5190
5262
 
5191
5263
 
5264
+ <xsl:attribute name="width">100%</xsl:attribute>
5265
+
5266
+
5192
5267
  <xsl:choose>
5193
5268
  <xsl:when test="$isGenerateTableIF = 'true'">
5194
5269
  <!-- generate IF for table widths -->
@@ -5319,6 +5394,18 @@
5319
5394
  </xsl:if> <!-- END: a few components -->
5320
5395
  </fo:block-container>
5321
5396
  </fo:block-container>
5397
+
5398
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' -->
5399
+ <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/>
5400
+ </xsl:if>
5401
+
5402
+ </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
5403
+ <xsl:param name="process">false</xsl:param>
5404
+ <xsl:if test="$process = 'true'">
5405
+ <fo:block xsl:use-attribute-sets="dl-name-style">
5406
+ <xsl:apply-templates/>
5407
+ </fo:block>
5408
+ </xsl:if>
5322
5409
  </xsl:template><xsl:template name="setColumnWidth_dl">
5323
5410
  <xsl:param name="colwidths"/>
5324
5411
  <xsl:param name="maxlength_dt"/>
@@ -5327,6 +5414,11 @@
5327
5414
  <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
5328
5415
 
5329
5416
  <xsl:choose>
5417
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
5418
+ <xsl:call-template name="insertTableColumnWidth">
5419
+ <xsl:with-param name="colwidths" select="$colwidths"/>
5420
+ </xsl:call-template>
5421
+ </xsl:when>
5330
5422
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
5331
5423
  <fo:table-column column-width="50%"/>
5332
5424
  <fo:table-column column-width="50%"/>
@@ -5579,12 +5671,24 @@
5579
5671
  </td>
5580
5672
  <td>
5581
5673
 
5582
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/>
5674
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5675
+
5676
+ <!-- get paragraphs from nested 'dl' -->
5677
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5678
+
5583
5679
 
5584
5680
  </td>
5585
5681
  </tr>
5586
5682
 
5587
- </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']">
5683
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
5684
+ <xsl:for-each select="*[local-name() = 'dt']">
5685
+ <p>
5686
+ <xsl:copy-of select="node()"/>
5687
+ <xsl:text> </xsl:text>
5688
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/>
5689
+ </p>
5690
+ </xsl:for-each>
5691
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']">
5588
5692
  <fo:inline font-style="italic">
5589
5693
  <xsl:apply-templates/>
5590
5694
  </fo:inline>
@@ -5615,7 +5719,7 @@
5615
5719
 
5616
5720
 
5617
5721
 
5618
- 10
5722
+ inherit <!-- 10 -->
5619
5723
 
5620
5724
 
5621
5725
 
@@ -7646,7 +7750,7 @@
7646
7750
 
7647
7751
 
7648
7752
 
7649
- 9
7753
+ inherit<!-- 9 -->
7650
7754
 
7651
7755
 
7652
7756
 
@@ -7730,7 +7834,7 @@
7730
7834
  <xsl:for-each select="xalan:nodeset($text_step4)/node()">
7731
7835
  <xsl:choose>
7732
7836
  <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
7733
- <xsl:call-template name="interspers">
7837
+ <xsl:call-template name="interspers-java">
7734
7838
  <xsl:with-param name="str" select="."/>
7735
7839
  </xsl:call-template>
7736
7840
  </xsl:when>
@@ -7780,6 +7884,10 @@
7780
7884
  <xsl:with-param name="char" select="$char"/>
7781
7885
  </xsl:call-template>
7782
7886
  </xsl:if>
7887
+ </xsl:template><xsl:template name="interspers-java">
7888
+ <xsl:param name="str"/>
7889
+ <xsl:param name="char" select="$zero_width_space"/>
7890
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. -->
7783
7891
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
7784
7892
  <xsl:apply-templates mode="syntax_highlight"/>
7785
7893
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -8686,7 +8794,7 @@
8686
8794
  <xsl:variable name="format">
8687
8795
  <xsl:choose>
8688
8796
  <xsl:when test="$type = 'arabic'">
8689
- 1.
8797
+ 1)
8690
8798
  </xsl:when>
8691
8799
  <xsl:when test="$type = 'alphabet'">
8692
8800
  a)
@@ -8733,6 +8841,11 @@
8733
8841
  </xsl:otherwise>
8734
8842
  </xsl:choose>
8735
8843
  </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
8844
+
8845
+ <xsl:apply-templates select="*[local-name() = 'name']">
8846
+ <xsl:with-param name="process">true</xsl:with-param>
8847
+ </xsl:apply-templates>
8848
+
8736
8849
  <fo:list-block xsl:use-attribute-sets="list-style">
8737
8850
 
8738
8851
 
@@ -8743,12 +8856,23 @@
8743
8856
 
8744
8857
 
8745
8858
 
8859
+ <xsl:if test="*[local-name() = 'name']">
8860
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8861
+ </xsl:if>
8862
+
8746
8863
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
8747
8864
  </fo:list-block>
8748
8865
  <!-- <xsl:for-each select="./iho:note">
8749
8866
  <xsl:call-template name="note"/>
8750
8867
  </xsl:for-each> -->
8751
8868
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
8869
+ </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
8870
+ <xsl:param name="process">false</xsl:param>
8871
+ <xsl:if test="$process = 'true'">
8872
+ <fo:block xsl:use-attribute-sets="list-name-style">
8873
+ <xsl:apply-templates/>
8874
+ </fo:block>
8875
+ </xsl:if>
8752
8876
  </xsl:template><xsl:template match="*[local-name()='li']">
8753
8877
  <fo:list-item xsl:use-attribute-sets="list-item-style">
8754
8878
  <xsl:copy-of select="@id"/>
@@ -9052,26 +9176,23 @@
9052
9176
  <xsl:if test=".//*[local-name() = 'fn']">
9053
9177
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
9054
9178
  </xsl:if>
9179
+
9180
+ <!-- display document identifier, not number [1] -->
9055
9181
  <xsl:variable name="docidentifier">
9056
9182
  <xsl:choose>
9057
9183
  <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
9058
9184
  <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
9059
9185
  </xsl:choose>
9060
9186
  </xsl:variable>
9061
- <fo:inline><xsl:value-of select="$docidentifier"/></fo:inline>
9187
+ <xsl:value-of select="$docidentifier"/>
9188
+
9062
9189
  <xsl:apply-templates select="*[local-name() = 'note']"/>
9063
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
9064
- <xsl:choose>
9065
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $lang]">
9066
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $lang]"/>
9067
- </xsl:when>
9068
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
9069
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
9070
- </xsl:when>
9071
- <xsl:otherwise>
9072
- <xsl:apply-templates select="*[local-name() = 'title']"/>
9073
- </xsl:otherwise>
9074
- </xsl:choose>
9190
+
9191
+ <xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
9192
+ <xsl:text>,</xsl:text>
9193
+ <xsl:text> </xsl:text>
9194
+ </xsl:if>
9195
+
9075
9196
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
9076
9197
  <!-- end bibitem processing -->
9077
9198
 
@@ -9378,36 +9499,60 @@
9378
9499
 
9379
9500
 
9380
9501
 
9502
+ <xsl:if test="@type = 'editorial'">
9503
+ <xsl:attribute name="color">green</xsl:attribute>
9504
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
9505
+
9506
+ <!-- <xsl:variable name="note-style">
9507
+ <style xsl:use-attribute-sets="note-style"></style>
9508
+ </xsl:variable>
9509
+ <xsl:for-each select="xalan:nodeset($note-style)//style/@*">
9510
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
9511
+ </xsl:for-each> -->
9512
+ </xsl:if>
9513
+
9381
9514
 
9382
9515
 
9383
9516
 
9384
- <xsl:call-template name="displayAdmonitionName"/>
9385
- <xsl:text> — </xsl:text>
9517
+ <xsl:if test="@type != 'editorial'">
9518
+ <xsl:call-template name="displayAdmonitionName">
9519
+ <xsl:with-param name="sep"> — </xsl:with-param>
9520
+ </xsl:call-template>
9521
+ </xsl:if>
9522
+
9523
+
9386
9524
 
9387
9525
 
9388
9526
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
9389
9527
  </fo:block>
9390
9528
 
9391
9529
  </xsl:template><xsl:template name="displayAdmonitionName">
9392
-
9530
+ <xsl:param name="sep"/> <!-- Example: ' - ' -->
9531
+ <!-- <xsl:choose>
9532
+ <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
9533
+ <xsl:choose>
9534
+ <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when>
9535
+ <xsl:otherwise>
9536
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
9537
+ </xsl:otherwise>
9538
+ </xsl:choose>
9539
+ </xsl:when>
9540
+ <xsl:otherwise>
9393
9541
  <xsl:apply-templates select="*[local-name() = 'name']"/>
9394
9542
  <xsl:if test="not(*[local-name() = 'name'])">
9395
9543
  <xsl:apply-templates select="@type"/>
9396
9544
  </xsl:if>
9397
-
9398
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
9399
- <xsl:apply-templates/>
9400
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
9401
- <xsl:variable name="admonition_type_">
9402
- <xsl:call-template name="getLocalizedString">
9403
- <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
9404
- </xsl:call-template>
9545
+ </xsl:otherwise>
9546
+ </xsl:choose> -->
9547
+ <xsl:variable name="name">
9548
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
9405
9549
  </xsl:variable>
9406
- <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
9407
- <xsl:value-of select="$admonition_type"/>
9408
- <xsl:if test="$admonition_type = ''">
9409
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
9550
+ <xsl:copy-of select="$name"/>
9551
+ <xsl:if test="normalize-space($name) != ''">
9552
+ <xsl:value-of select="$sep"/>
9410
9553
  </xsl:if>
9554
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
9555
+ <xsl:apply-templates/>
9411
9556
  </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
9412
9557
  <!-- processing for admonition/p found in the template for 'p' -->
9413
9558
  <xsl:call-template name="paragraph"/>