metanorma-iso 2.0.8.1 → 2.1.0

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +37 -0
  3. data/lib/isodoc/iso/html/html_iso_titlepage.html +5 -0
  4. data/lib/isodoc/iso/html/isodoc-dis.css +196 -156
  5. data/lib/isodoc/iso/html/isodoc-dis.scss +193 -156
  6. data/lib/isodoc/iso/html/word_iso_intro-dis.html +7 -0
  7. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +2 -0
  8. data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -0
  9. data/lib/isodoc/iso/html/wordstyle-dis.css +204 -34
  10. data/lib/isodoc/iso/html/wordstyle-dis.scss +198 -34
  11. data/lib/isodoc/iso/i18n-en.yaml +1 -0
  12. data/lib/isodoc/iso/i18n-fr.yaml +1 -0
  13. data/lib/isodoc/iso/i18n-ru.yaml +1 -0
  14. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
  15. data/lib/isodoc/iso/init.rb +17 -1
  16. data/lib/isodoc/iso/iso.amendment.xsl +470 -201
  17. data/lib/isodoc/iso/iso.international-standard.xsl +470 -201
  18. data/lib/isodoc/iso/metadata.rb +5 -11
  19. data/lib/isodoc/iso/presentation_inline.rb +90 -0
  20. data/lib/isodoc/iso/presentation_xml_convert.rb +39 -98
  21. data/lib/isodoc/iso/presentation_xref.rb +126 -0
  22. data/lib/isodoc/iso/word_cleanup.rb +14 -0
  23. data/lib/isodoc/iso/word_convert.rb +27 -10
  24. data/lib/isodoc/iso/word_dis_convert.rb +174 -0
  25. data/lib/isodoc/iso/xref.rb +46 -25
  26. data/lib/metanorma/iso/biblio.rng +37 -8
  27. data/lib/metanorma/iso/boilerplate-fr.xml +1 -1
  28. data/lib/metanorma/iso/boilerplate-ru.xml +1 -3
  29. data/lib/metanorma/iso/boilerplate.xml +1 -3
  30. data/lib/metanorma/iso/cleanup.rb +2 -1
  31. data/lib/metanorma/iso/isodoc.rng +56 -0
  32. data/lib/metanorma/iso/version.rb +1 -1
  33. data/lib/metanorma-iso.rb +1 -0
  34. data/lib/relaton/render/config.yml +4 -0
  35. data/lib/relaton/render/general.rb +13 -0
  36. data/metanorma-iso.gemspec +1 -1
  37. data/spec/isodoc/amd_spec.rb +15 -14
  38. data/spec/isodoc/blocks_spec.rb +286 -179
  39. data/spec/isodoc/i18n_spec.rb +187 -21
  40. data/spec/isodoc/inline_spec.rb +35 -42
  41. data/spec/isodoc/iso_spec.rb +1 -1
  42. data/spec/isodoc/postproc_spec.rb +25 -0
  43. data/spec/isodoc/ref_spec.rb +66 -69
  44. data/spec/isodoc/section_spec.rb +78 -76
  45. data/spec/isodoc/table_spec.rb +2 -2
  46. data/spec/isodoc/terms_spec.rb +2 -2
  47. data/spec/isodoc/word_dis_spec.rb +760 -0
  48. data/spec/isodoc/xref_spec.rb +51 -51
  49. data/spec/metanorma/base_spec.rb +10 -10
  50. data/spec/spec_helper.rb +4 -1
  51. data/spec/vcr_cassettes/withdrawn_iso.yml +26 -26
  52. metadata +11 -5
  53. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -194,6 +194,47 @@
194
194
  </xsl:for-each>
195
195
  </xsl:variable>
196
196
 
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>
204
+ </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
+ </xsl:variable>
211
+ <xsl:if test="normalize-space($data) != ''">
212
+ <xsl:text>ISO</xsl:text><xsl:copy-of select="$data"/>
213
+ </xsl:if>
214
+ </xsl:variable>
215
+ <xsl:variable name="editorialgroup" select="xalan:nodeset($editorialgroup_)"/>
216
+
217
+ <xsl:variable name="secretariat_">
218
+ <xsl:variable name="value" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:secretariat)"/>
219
+ <xsl:if test="$value != ''">
220
+ <xsl:call-template name="getLocalizedString">
221
+ <xsl:with-param name="key">secretariat</xsl:with-param>
222
+ </xsl:call-template>
223
+ <xsl:text>: </xsl:text>
224
+ <fo:inline font-weight="bold"><xsl:value-of select="$value"/></fo:inline>
225
+ </xsl:if>
226
+ </xsl:variable>
227
+ <xsl:variable name="secretariat" select="xalan:nodeset($secretariat_)"/>
228
+
229
+ <xsl:variable name="ics_">
230
+ <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:ics/iso:code">
231
+ <xsl:if test="position() = 1"><fo:inline>ICS: </fo:inline></xsl:if>
232
+ <xsl:value-of select="."/>
233
+ <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
234
+ </xsl:for-each>
235
+ </xsl:variable>
236
+ <xsl:variable name="ics" select="xalan:nodeset($ics_)"/>
237
+
197
238
  <xsl:variable name="XML" select="/"/>
198
239
 
199
240
  <xsl:template match="/">
@@ -256,17 +297,17 @@
256
297
  <!-- contents pages -->
257
298
  <!-- odd pages -->
258
299
  <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
259
- <fo:region-body margin-top="27.4mm" margin-bottom="13mm" margin-left="19mm" margin-right="19mm"/>
300
+ <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom + 2}mm" margin-left="19mm" margin-right="19mm"/>
260
301
  <fo:region-before region-name="header-odd" extent="27.4mm"/> <!-- display-align="center" -->
261
- <fo:region-after region-name="footer-odd" extent="13mm"/>
302
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
262
303
  <fo:region-start region-name="left-region" extent="19mm"/>
263
304
  <fo:region-end region-name="right-region" extent="19mm"/>
264
305
  </fo:simple-page-master>
265
306
  <!-- even pages -->
266
307
  <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
267
- <fo:region-body margin-top="27.4mm" margin-bottom="13mm" margin-left="19mm" margin-right="19mm"/>
308
+ <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom + 2}mm" margin-left="19mm" margin-right="19mm"/>
268
309
  <fo:region-before region-name="header-even" extent="27.4mm"/> <!-- display-align="center" -->
269
- <fo:region-after region-name="footer-even" extent="13mm"/>
310
+ <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
270
311
  <fo:region-start region-name="left-region" extent="19mm"/>
271
312
  <fo:region-end region-name="right-region" extent="19mm"/>
272
313
  </fo:simple-page-master>
@@ -286,7 +327,7 @@
286
327
 
287
328
  <!-- first page -->
288
329
  <fo:simple-page-master master-name="first-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
289
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
330
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
290
331
  <fo:region-before region-name="header-first" extent="{$marginTop}mm"/> <!-- display-align="center" -->
291
332
  <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
292
333
  <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
@@ -294,7 +335,7 @@
294
335
  </fo:simple-page-master>
295
336
  <!-- odd pages -->
296
337
  <fo:simple-page-master master-name="odd-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
297
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
338
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
298
339
  <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/> <!-- display-align="center" -->
299
340
  <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
300
341
  <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
@@ -302,14 +343,14 @@
302
343
  </fo:simple-page-master>
303
344
  <!-- even pages -->
304
345
  <fo:simple-page-master master-name="even-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
305
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
346
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
306
347
  <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
307
348
  <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
308
349
  <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
309
350
  <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
310
351
  </fo:simple-page-master>
311
352
  <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
312
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
353
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
313
354
  <fo:region-before region-name="header" extent="{$marginTop}mm"/>
314
355
  <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
315
356
  <fo:region-start region-name="left" extent="{$marginLeftRight2}mm"/>
@@ -503,16 +544,14 @@
503
544
  <fo:block> </fo:block>
504
545
  </fo:table-cell>
505
546
  <fo:table-cell>
506
- <fo:block margin-bottom="3mm">ISO/TC <fo:inline font-weight="bold"><xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee/@number"/></fo:inline>
547
+ <fo:block margin-bottom="3mm">
548
+ <xsl:copy-of select="$editorialgroup"/>
507
549
  </fo:block>
508
550
  </fo:table-cell>
509
551
  <fo:table-cell>
510
552
  <fo:block>
511
- <xsl:call-template name="getLocalizedString">
512
- <xsl:with-param name="key">secretariat</xsl:with-param>
513
- </xsl:call-template>
514
- <xsl:text>: </xsl:text>
515
- Secretariat: <fo:inline font-weight="bold"><xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:secretariat"/></fo:inline></fo:block>
553
+ <xsl:copy-of select="$secretariat"/>
554
+ </fo:block>
516
555
  </fo:table-cell>
517
556
  </fo:table-row>
518
557
  <fo:table-row>
@@ -598,11 +637,7 @@
598
637
  </fo:block>
599
638
 
600
639
  <fo:block margin-top="10mm">
601
- <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:ics/iso:code">
602
- <xsl:if test="position() = 1"><fo:inline>ICS: </fo:inline></xsl:if>
603
- <xsl:value-of select="."/>
604
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
605
- </xsl:for-each>
640
+ <xsl:copy-of select="$ics"/>
606
641
  </fo:block>
607
642
 
608
643
  </fo:block-container>
@@ -611,7 +646,7 @@
611
646
  </fo:block-container>
612
647
  </fo:flow>
613
648
 
614
- </xsl:when>
649
+ </xsl:when> <!-- END: $stage-abbreviation = 'DIS' -->
615
650
  <xsl:otherwise>
616
651
 
617
652
  <!-- COVER PAGE for all documents except DIS -->
@@ -671,13 +706,17 @@
671
706
  </fo:block>
672
707
  </fo:table-cell>
673
708
  </fo:table-row>
674
- <fo:table-row height="42mm">
709
+ <fo:table-row height="25mm">
675
710
  <fo:table-cell number-columns-spanned="3" font-size="10pt" line-height="1.2">
676
711
  <fo:block text-align="right">
677
712
  <xsl:if test="$stage-abbreviation = 'PRF' or $stage-abbreviation = 'IS' or $stage-abbreviation = 'D' or $stage-abbreviation = 'published'">
678
713
  <xsl:call-template name="printEdition"/>
679
714
  </xsl:if>
680
715
  <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">
717
+ <xsl:value-of select="$linebreak"/>
718
+ <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/>
719
+ </xsl:when>
681
720
  <xsl:when test="$stage-abbreviation = 'IS' and /iso:iso-standard/iso:bibdata/iso:date[@type = 'published']">
682
721
  <xsl:value-of select="$linebreak"/>
683
722
  <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'published']"/>
@@ -706,13 +745,40 @@
706
745
  </fo:block>
707
746
  <fo:block>
708
747
  <xsl:if test="/iso:iso-standard/iso:bibdata/iso:date[@type = 'updated']">
709
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'updated']"/>
748
+ <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'updated']"/>
710
749
  </xsl:if>
711
750
  </fo:block>
712
751
  </fo:block>
713
752
  </xsl:if>
714
753
  </fo:table-cell>
715
754
  </fo:table-row>
755
+ <fo:table-row height="17mm">
756
+ <fo:table-cell><fo:block/></fo:table-cell>
757
+ <fo:table-cell number-columns-spanned="2" font-size="10pt" line-height="1.2" display-align="center">
758
+ <fo:block>
759
+ <xsl:if test="$stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
760
+ <fo:table table-layout="fixed" width="100%">
761
+ <fo:table-column column-width="50%"/>
762
+ <fo:table-column column-width="50%"/>
763
+ <fo:table-body>
764
+ <fo:table-row>
765
+ <fo:table-cell>
766
+ <fo:block>
767
+ <xsl:copy-of select="$editorialgroup"/>
768
+ </fo:block>
769
+ </fo:table-cell>
770
+ <fo:table-cell>
771
+ <fo:block>
772
+ <xsl:copy-of select="$secretariat"/>
773
+ </fo:block>
774
+ </fo:table-cell>
775
+ </fo:table-row>
776
+ </fo:table-body>
777
+ </fo:table>
778
+ </xsl:if>
779
+ </fo:block>
780
+ </fo:table-cell>
781
+ </fo:table-row>
716
782
 
717
783
  </fo:table-body>
718
784
  </fo:table>
@@ -729,8 +795,8 @@
729
795
  <xsl:if test="$stage-abbreviation = 'FDIS'">
730
796
  <fo:block-container border="0.5mm solid black" width="51mm">
731
797
  <fo:block margin="2mm">
732
- <fo:block margin-bottom="8pt">ISO/TC <fo:inline font-weight="bold"><xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee/@number"/></fo:inline></fo:block>
733
- <fo:block margin-bottom="6pt">Secretariat: <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:secretariat"/></fo:block>
798
+ <fo:block margin-bottom="8pt"><xsl:copy-of select="$editorialgroup"/></fo:block>
799
+ <fo:block margin-bottom="6pt"><xsl:value-of select="$secretariat"/></fo:block>
734
800
  <fo:block margin-bottom="6pt">Voting begins on:<xsl:value-of select="$linebreak"/>
735
801
  <fo:inline font-weight="bold">
736
802
  <xsl:choose>
@@ -802,6 +868,12 @@
802
868
  </fo:block>
803
869
  </xsl:for-each>
804
870
 
871
+ <xsl:if test="$stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
872
+ <fo:block margin-top="10mm">
873
+ <xsl:copy-of select="$ics"/>
874
+ </fo:block>
875
+ </xsl:if>
876
+
805
877
  </fo:block>
806
878
  </fo:block-container>
807
879
  </fo:table-cell>
@@ -958,41 +1030,21 @@
958
1030
  </xsl:otherwise>
959
1031
  </xsl:choose>
960
1032
 
961
- <!-- ISO/TC 46/WG 3 -->
962
- <!-- <fo:block margin-bottom="12pt">
963
- <xsl:value-of select="concat('ISO/', /iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee/@type, ' ',
964
- /iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee/@number, '/',
965
- /iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup/@type, ' ',
966
- /iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup/@number)"/>
967
- -->
968
1033
 
969
- <xsl:if test="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee[normalize-space(@number) != ''] or /iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:subcommittee[normalize-space(@number) != ''] or /iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup[normalize-space(@number) != '']">
1034
+ <xsl:if test="normalize-space($editorialgroup) != ''">
970
1035
  <!-- ISO/TC 34/SC 4/WG 3 -->
971
1036
  <fo:block margin-bottom="12pt">
972
- <xsl:text>ISO</xsl:text>
973
- <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee[normalize-space(@number) != '']">
974
- <xsl:text>/TC </xsl:text><xsl:value-of select="@number"/>
975
- </xsl:for-each>
976
- <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:subcommittee[normalize-space(@number) != '']">
977
- <xsl:text>/SC </xsl:text>
978
- <xsl:value-of select="@number"/>
979
- </xsl:for-each>
980
- <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup[normalize-space(@number) != '']">
981
- <xsl:text>/WG </xsl:text>
982
- <xsl:value-of select="@number"/>
983
- </xsl:for-each>
1037
+ <xsl:copy-of select="$editorialgroup"/>
984
1038
  </fo:block>
985
1039
  </xsl:if>
986
- <!-- Secretariat: AFNOR -->
987
1040
 
1041
+ <!-- Secretariat: AFNOR -->
988
1042
  <fo:block margin-bottom="100pt">
989
- <xsl:text>Secretariat: </xsl:text>
990
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:secretariat"/>
1043
+ <xsl:value-of select="$secretariat"/>
991
1044
  <xsl:text> </xsl:text>
992
1045
  </fo:block>
993
-
994
-
995
-
1046
+
1047
+
996
1048
  </fo:block-container>
997
1049
  <fo:block-container font-size="16pt">
998
1050
  <!-- Information and documentation — Codes for transcription systems -->
@@ -1065,7 +1117,12 @@
1065
1117
  </xsl:variable>
1066
1118
  <!-- DEBUG: updated_xml_step2=<xsl:copy-of select="$updated_xml_step2"/> -->
1067
1119
 
1068
- <xsl:for-each select="xalan:nodeset($updated_xml_step2)">
1120
+ <xsl:variable name="updated_xml_step3">
1121
+ <xsl:apply-templates select="xalan:nodeset($updated_xml_step2)" mode="update_xml_enclose_keep-together_within-line"/>
1122
+ </xsl:variable>
1123
+ <!-- DEBUG: updated_xml_step3=<xsl:copy-of select="$updated_xml_step3"/> -->
1124
+
1125
+ <xsl:for-each select="xalan:nodeset($updated_xml_step3)">
1069
1126
 
1070
1127
  <fo:page-sequence master-reference="preface{$document-master-reference}" format="i" force-page-count="{$force-page-count-preface}">
1071
1128
  <xsl:call-template name="insertHeaderFooter">
@@ -1159,7 +1216,12 @@
1159
1216
 
1160
1217
  <fo:inline keep-together.within-line="always">
1161
1218
  <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
1162
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1219
+ <fo:inline>
1220
+ <xsl:if test="@level = 1 and @type = 'annex'">
1221
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1222
+ </xsl:if>
1223
+ <fo:page-number-citation ref-id="{@id}"/>
1224
+ </fo:inline>
1163
1225
  </fo:inline>
1164
1226
  </fo:basic-link>
1165
1227
  </fo:block>
@@ -1377,6 +1439,7 @@
1377
1439
  </fo:block>
1378
1440
  </xsl:template>
1379
1441
 
1442
+
1380
1443
  <!-- ==================== -->
1381
1444
  <!-- display titles -->
1382
1445
  <!-- ==================== -->
@@ -1951,28 +2014,6 @@
1951
2014
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAFEAAABHCAIAAADwYjznAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA66SURBVHhezZt5sM/VG8fNVH7JruxkSZKQ3TAYS7aGajKpFBnRxBjjkhrLrRgmYwm59hrGjC0miSmmIgoVZYu00GJtxkyMkV2/1+fzPh7nfr7fe33v/X6/9/d7/3HmOc/nLM/7PM95zjnfS6F//xc4f/786dOnXaXAUdCcjx071rt373vvvbdChQrNmzdfuXKl+1CAKFDOR44cqVWrVqFChf4T4vbbb7/zzjsnT57sPhcUCo7ztWvX2rRpc9tttxUtWvSuEAgwp/z0009dowJBwXGeM2dO4cKFRZWySJEikvF2o0aNrly54tqlHwXE+cyZM9WrV4czJMW5WLFixv+OO+6YPn26a5p+FBDnjIwM/Ak9AHMcm5mZyWY2TeXKlf/66y/XOs0oCM4HDhwoU6aMMSSqs7Kyfv75Z5jjYXmeff7yyy+7DmlGQXB+7LHHcLKFcdu2bXft2vXtt9/Onz9fS8AnVqRkyZLff/+965NOpJ3zhg0bIsQ4k7/55psvv/xy9+7dnTp1MlezLp07d3bd0on0cr569WqTJk18VlxI9uzZs3XrVjhv37597dq199xzD2vBV9aFo2vVqlWuc9qQXs6zZs2CcLCJ77oLPlWqVOEohqo4U8L/hRdesEVBeOihhy5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GUrfZjeBCsFk4MWubYJPnswvSFSFVBu3ryZJ5fj+e+//wVuVmgt0lkFPgAAAABJRU5ErkJggg==</xsl:text>
1952
2015
  </xsl:variable>
1953
2016
 
1954
- <xsl:template name="printEdition">
1955
- <xsl:variable name="edition" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:edition)"/>
1956
- <xsl:text> </xsl:text>
1957
- <xsl:choose>
1958
- <xsl:when test="number($edition) = $edition">
1959
- <xsl:call-template name="number-to-words">
1960
- <xsl:with-param name="number" select="$edition"/>
1961
- </xsl:call-template>
1962
- </xsl:when>
1963
- <xsl:when test="$edition != ''">
1964
- <xsl:value-of select="$edition"/>
1965
- </xsl:when>
1966
- </xsl:choose>
1967
- <xsl:variable name="title-edition">
1968
- <xsl:call-template name="getLocalizedString">
1969
- <xsl:with-param name="key">edition</xsl:with-param>
1970
- </xsl:call-template>
1971
- </xsl:variable>
1972
- <xsl:if test="$edition != ''"><xsl:text> </xsl:text><xsl:value-of select="java:toLowerCase(java:java.lang.String.new($title-edition))"/></xsl:if>
1973
- </xsl:template>
1974
-
1975
-
1976
2017
  <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:variable name="lang">
1977
2018
  <xsl:call-template name="getLang"/>
1978
2019
  </xsl:variable><xsl:variable name="pageWidth_">
@@ -1988,20 +2029,7 @@
1988
2029
  </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
1989
2030
  13
1990
2031
  </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
1991
-
1992
- <title-edition lang="en">
1993
-
1994
- <xsl:text>Edition </xsl:text>
1995
-
1996
- </title-edition>
1997
-
1998
- <title-edition lang="fr">
1999
- <xsl:text>Édition </xsl:text>
2000
- </title-edition>
2001
2032
 
2002
- <title-edition lang="ru">
2003
- <xsl:text>Издание </xsl:text>
2004
- </title-edition>
2005
2033
 
2006
2034
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
2007
2035
  <title-toc lang="en">
@@ -2086,7 +2114,7 @@
2086
2114
  </xsl:variable><xsl:variable name="bibdata">
2087
2115
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2088
2116
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2089
- </xsl:variable><xsl:variable name="linebreak">&#8232;</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space">​</xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
2117
+ </xsl:variable><xsl:variable name="linebreak">&#8232;</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space">​</xsl:variable><xsl:variable name="hair_space"> </xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
2090
2118
  <xsl:param name="name"/>
2091
2119
  <xsl:param name="lang"/>
2092
2120
  <xsl:variable name="lang_">
@@ -2134,7 +2162,7 @@
2134
2162
  <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
2135
2163
 
2136
2164
  <xsl:variable name="additional_fonts_">
2137
- <xsl:for-each select="//*[local-name() = 'misc-container'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
2165
+ <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
2138
2166
  <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
2139
2167
  </xsl:for-each>
2140
2168
  </xsl:variable>
@@ -2214,7 +2242,6 @@
2214
2242
 
2215
2243
 
2216
2244
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style">
2217
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2218
2245
 
2219
2246
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2220
2247
  <xsl:attribute name="white-space">pre</xsl:attribute>
@@ -2301,6 +2328,10 @@
2301
2328
 
2302
2329
 
2303
2330
 
2331
+
2332
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
2333
+ <xsl:attribute name="margin-right">7mm</xsl:attribute>
2334
+
2304
2335
 
2305
2336
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
2306
2337
 
@@ -2309,6 +2340,7 @@
2309
2340
 
2310
2341
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2311
2342
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
2343
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2312
2344
 
2313
2345
 
2314
2346
 
@@ -3404,22 +3436,24 @@
3404
3436
  <xsl:sort select="@displayorder" data-type="number"/>
3405
3437
  <xsl:apply-templates select="."/>
3406
3438
  </xsl:for-each>
3407
- </xsl:template><xsl:variable name="tag_open">###fo:inline###</xsl:variable><xsl:variable name="tag_close">###/fo:inline###</xsl:variable><xsl:template match="text()" name="text">
3408
- <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
3409
- <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_open,'$1',$tag_close))"/>
3410
- <xsl:call-template name="replace_fo_inline">
3411
- <xsl:with-param name="text" select="$text"/>
3412
- </xsl:call-template>
3413
- </xsl:template><xsl:template name="replace_fo_inline">
3439
+ </xsl:template><xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable><xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable><xsl:template match="text()" name="text">
3440
+ <xsl:value-of select="."/>
3441
+ </xsl:template><xsl:template name="replace_fo_inline_tags">
3442
+ <xsl:param name="tag_open"/>
3443
+ <xsl:param name="tag_close"/>
3414
3444
  <xsl:param name="text"/>
3415
3445
  <xsl:choose>
3416
3446
  <xsl:when test="contains($text, $tag_open)">
3417
3447
  <xsl:value-of select="substring-before($text, $tag_open)"/>
3418
- <xsl:text disable-output-escaping="yes">&lt;fo:inline keep-together.within-line="always"&gt;</xsl:text>
3448
+ <!-- <xsl:text disable-output-escaping="yes">&lt;fo:inline keep-together.within-line="always"&gt;</xsl:text> -->
3419
3449
  <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
3420
- <xsl:value-of select="substring-before($text_after, $tag_close)"/>
3421
- <xsl:text disable-output-escaping="yes">&lt;/fo:inline&gt;</xsl:text>
3422
- <xsl:call-template name="replace_fo_inline">
3450
+ <fo:inline keep-together.within-line="always">
3451
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
3452
+ </fo:inline>
3453
+ <!-- <xsl:text disable-output-escaping="yes">&lt;/fo:inline&gt;</xsl:text> -->
3454
+ <xsl:call-template name="replace_fo_inline_tags">
3455
+ <xsl:with-param name="tag_open" select="$tag_open"/>
3456
+ <xsl:with-param name="tag_close" select="$tag_close"/>
3423
3457
  <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
3424
3458
  </xsl:call-template>
3425
3459
  </xsl:when>
@@ -3427,6 +3461,8 @@
3427
3461
  </xsl:choose>
3428
3462
  </xsl:template><xsl:template match="*[local-name()='br']">
3429
3463
  <xsl:value-of select="$linebreak"/>
3464
+ </xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']">
3465
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
3430
3466
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
3431
3467
  <fo:block xsl:use-attribute-sets="copyright-statement-style">
3432
3468
  <xsl:apply-templates/>
@@ -3506,19 +3542,24 @@
3506
3542
  <xsl:with-param name="margin" select="$margin"/>
3507
3543
  </xsl:call-template>
3508
3544
 
3509
- </xsl:template><xsl:variable name="express_reference_separators">_.\</xsl:variable><xsl:variable name="express_reference_characters" select="concat($upper,$lower,'1234567890',$express_reference_separators)"/><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3510
-
3511
- <xsl:choose>
3512
- <!-- if EXPRESS reference -->
3513
- <xsl:when test="parent::*[local-name()='strong'] and translate(., $express_reference_characters, '') = ''">
3514
- <xsl:value-of select="."/>
3515
- </xsl:when>
3516
- <xsl:otherwise>
3517
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
3518
- <xsl:call-template name="add-zero-spaces-java"/>
3519
- </xsl:otherwise>
3520
- </xsl:choose>
3521
-
3545
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3546
+ <xsl:choose>
3547
+ <xsl:when test="parent::*[local-name() = 'keep-together_within-line']">
3548
+ <xsl:value-of select="."/>
3549
+ </xsl:when>
3550
+ <xsl:otherwise>
3551
+ <xsl:call-template name="addZeroWidthSpacesToTextNodes"/>
3552
+ </xsl:otherwise>
3553
+ </xsl:choose>
3554
+ </xsl:template><xsl:template name="addZeroWidthSpacesToTextNodes">
3555
+ <xsl:variable name="text"><text><xsl:call-template name="text"/></text></xsl:variable>
3556
+ <!-- <xsl:copy-of select="$text"/> -->
3557
+ <xsl:for-each select="xalan:nodeset($text)/text/node()">
3558
+ <xsl:choose>
3559
+ <xsl:when test="self::text()"><xsl:call-template name="add-zero-spaces-java"/></xsl:when>
3560
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
3561
+ </xsl:choose>
3562
+ </xsl:for-each>
3522
3563
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
3523
3564
 
3524
3565
  <xsl:variable name="table-preamble">
@@ -3808,6 +3849,7 @@
3808
3849
  <xsl:with-param name="text" select="$td_text"/>
3809
3850
  </xsl:call-template>
3810
3851
  </xsl:variable>
3852
+ <!-- <xsl:message>string_with_added_zerospaces=<xsl:value-of select="$string_with_added_zerospaces"/></xsl:message> -->
3811
3853
  <xsl:call-template name="tokenize">
3812
3854
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
3813
3855
  <!-- 2009 thinspace -->
@@ -3820,6 +3862,7 @@
3820
3862
  <xsl:with-param name="words" select="xalan:nodeset($words)"/>
3821
3863
  </xsl:call-template>
3822
3864
  </xsl:variable>
3865
+ <!-- <xsl:message>max_length=<xsl:value-of select="$max_length"/></xsl:message> -->
3823
3866
  <width>
3824
3867
  <xsl:variable name="divider">
3825
3868
  <xsl:choose>
@@ -3852,13 +3895,10 @@
3852
3895
  <xsl:with-param name="table" select="$table"/>
3853
3896
  </xsl:call-template>
3854
3897
  </xsl:if>
3855
- </xsl:template><xsl:template match="*[(local-name()='strong' or (local-name()='inline' and @font-weight = 'bold'))]" mode="td_text">
3856
- <xsl:apply-templates mode="td_text"/>
3857
- </xsl:template><xsl:template match="*[(local-name()='strong' or (local-name()='inline' and @font-weight = 'bold'))]/text()[translate(., $express_reference_characters, '') = '']" mode="td_text">
3858
-
3859
- <!-- replace underscore, back slash, dot to 'x', just to skip further tokenization -->
3860
- <xsl:value-of select="translate(., $express_reference_separators, 'xxx')"/>
3861
-
3898
+ </xsl:template><xsl:template match="*[@keep-together.within-line]/text()" priority="2" mode="td_text">
3899
+ <!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message>
3900
+ <xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> -->
3901
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/>
3862
3902
  </xsl:template><xsl:template match="text()" mode="td_text">
3863
3903
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
3864
3904
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
@@ -4585,8 +4625,10 @@
4585
4625
  <!-- and (not(../@class) or ../@class !='pseudocode') -->
4586
4626
  </xsl:variable>
4587
4627
 
4628
+ <xsl:variable name="onlyOneComponent" select="normalize-space($parent = 'formula' and count(*[local-name()='dt']) = 1)"/>
4629
+
4588
4630
  <xsl:choose>
4589
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
4631
+ <xsl:when test="$onlyOneComponent = 'true'"> <!-- only one component -->
4590
4632
 
4591
4633
  <fo:block margin-bottom="12pt" text-align="left">
4592
4634
 
@@ -4603,7 +4645,7 @@
4603
4645
  <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
4604
4646
  </fo:block>
4605
4647
 
4606
- </xsl:when>
4648
+ </xsl:when> <!-- END: only one component -->
4607
4649
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
4608
4650
  <fo:block margin-bottom="12pt" text-align="left">
4609
4651
 
@@ -4619,8 +4661,8 @@
4619
4661
  </xsl:variable>
4620
4662
  <xsl:value-of select="$title-where"/>
4621
4663
  </fo:block>
4622
- </xsl:when>
4623
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
4664
+ </xsl:when> <!-- END: a few components -->
4665
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
4624
4666
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4625
4667
 
4626
4668
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -4636,11 +4678,11 @@
4636
4678
  </xsl:variable>
4637
4679
  <xsl:value-of select="$title-key"/>
4638
4680
  </fo:block>
4639
- </xsl:when>
4681
+ </xsl:when> <!-- END: definition list in a figure -->
4640
4682
  </xsl:choose>
4641
4683
 
4642
4684
  <!-- a few components -->
4643
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
4685
+ <xsl:if test="$onlyOneComponent = 'false'">
4644
4686
  <fo:block>
4645
4687
 
4646
4688
  <xsl:if test="$parent = 'formula'">
@@ -4684,29 +4726,31 @@
4684
4726
  <xsl:apply-templates mode="dl"/>
4685
4727
  </tbody>
4686
4728
  </xsl:variable>
4687
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
4729
+ <!-- DEBUG: html-table<xsl:copy-of select="$html-table"/> -->
4688
4730
  <xsl:variable name="colwidths">
4689
4731
  <xsl:call-template name="calculate-column-widths">
4690
4732
  <xsl:with-param name="cols-count" select="2"/>
4691
4733
  <xsl:with-param name="table" select="$html-table"/>
4692
4734
  </xsl:call-template>
4693
4735
  </xsl:variable>
4694
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
4736
+ <!-- DEBUG: colwidths=<xsl:copy-of select="$colwidths"/> -->
4695
4737
  <xsl:variable name="maxlength_dt">
4696
4738
  <xsl:call-template name="getMaxLength_dt"/>
4697
4739
  </xsl:variable>
4698
- <xsl:variable name="isContainsExpressReference_">
4740
+ <xsl:variable name="isContainsKeepTogetherTag_">
4699
4741
 
4700
- <xsl:value-of select="count(.//*[local-name() = 'strong'][translate(., $express_reference_characters, '') = '']) &gt; 0"/>
4742
+ <!-- <xsl:value-of select="count(.//*[local-name() = 'strong'][translate(., $express_reference_characters, '') = '']) &gt; 0"/> -->
4743
+ <xsl:value-of select="count(.//*[local-name() = $element_name_keep-together_within-line]) &gt; 0"/>
4701
4744
 
4702
4745
  </xsl:variable>
4703
- <xsl:variable name="isContainsExpressReference" select="normalize-space($isContainsExpressReference_)"/>
4746
+ <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
4704
4747
  <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
4705
4748
  <xsl:call-template name="setColumnWidth_dl">
4706
4749
  <xsl:with-param name="colwidths" select="$colwidths"/>
4707
4750
  <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
4708
- <xsl:with-param name="isContainsExpressReference" select="$isContainsExpressReference"/>
4751
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
4709
4752
  </xsl:call-template>
4753
+
4710
4754
  <fo:table-body>
4711
4755
  <xsl:apply-templates>
4712
4756
  <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
@@ -4715,13 +4759,13 @@
4715
4759
  </fo:table>
4716
4760
  </fo:block>
4717
4761
  </fo:block>
4718
- </xsl:if>
4762
+ </xsl:if> <!-- END: a few components -->
4719
4763
  </fo:block-container>
4720
4764
  </fo:block-container>
4721
4765
  </xsl:template><xsl:template name="setColumnWidth_dl">
4722
4766
  <xsl:param name="colwidths"/>
4723
4767
  <xsl:param name="maxlength_dt"/>
4724
- <xsl:param name="isContainsExpressReference"/>
4768
+ <xsl:param name="isContainsKeepTogetherTag"/>
4725
4769
  <xsl:choose>
4726
4770
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
4727
4771
  <fo:table-column column-width="50%"/>
@@ -4729,7 +4773,7 @@
4729
4773
  </xsl:when>
4730
4774
  <xsl:otherwise>
4731
4775
  <xsl:choose>
4732
- <xsl:when test="$isContainsExpressReference">
4776
+ <xsl:when test="$isContainsKeepTogetherTag">
4733
4777
  <xsl:call-template name="insertTableColumnWidth">
4734
4778
  <xsl:with-param name="colwidths" select="$colwidths"/>
4735
4779
  </xsl:call-template>
@@ -4806,7 +4850,6 @@
4806
4850
  <xsl:value-of select="$maxLength"/>
4807
4851
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
4808
4852
  <xsl:param name="key_iso"/>
4809
-
4810
4853
  <!-- <tr>
4811
4854
  <td>NOTE</td>
4812
4855
  <td>
@@ -4814,18 +4857,30 @@
4814
4857
  </td>
4815
4858
  </tr>
4816
4859
  -->
4817
- <fo:table-row>
4860
+ <!-- OLD Variant -->
4861
+ <!-- <fo:table-row>
4818
4862
  <fo:table-cell>
4819
4863
  <fo:block margin-top="6pt">
4820
4864
  <xsl:if test="normalize-space($key_iso) = 'true'">
4821
4865
  <xsl:attribute name="margin-top">0</xsl:attribute>
4822
4866
  </xsl:if>
4823
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4867
+ <xsl:apply-templates select="*[local-name() = 'name']" />
4824
4868
  </fo:block>
4825
4869
  </fo:table-cell>
4826
4870
  <fo:table-cell>
4827
4871
  <fo:block>
4828
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4872
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]" />
4873
+ </fo:block>
4874
+ </fo:table-cell>
4875
+ </fo:table-row> -->
4876
+ <!-- <tr>
4877
+ <td number-columns-spanned="2">NOTE <xsl:apply-templates /> </td>
4878
+ </tr>
4879
+ -->
4880
+ <fo:table-row>
4881
+ <fo:table-cell number-columns-spanned="2">
4882
+ <fo:block>
4883
+ <xsl:call-template name="note"/>
4829
4884
  </fo:block>
4830
4885
  </fo:table-cell>
4831
4886
  </fo:table-row>
@@ -4927,13 +4982,15 @@
4927
4982
  <xsl:choose>
4928
4983
  <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4929
4984
  <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4930
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4985
+ <xsl:when test="ancestor::*[local-name()='note'] or ancestor::*[local-name()='example']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4931
4986
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4932
4987
  </xsl:choose>
4933
4988
  </xsl:attribute>
4934
4989
  </xsl:if>
4935
4990
  <xsl:apply-templates/>
4936
4991
  </fo:inline>
4992
+ </xsl:template><xsl:template match="*[local-name()='tt']/text()" priority="2">
4993
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
4937
4994
  </xsl:template><xsl:template match="*[local-name()='underline']">
4938
4995
  <fo:inline text-decoration="underline">
4939
4996
  <xsl:apply-templates/>
@@ -5081,41 +5138,50 @@
5081
5138
  <fo:block break-after="page"/>
5082
5139
  <fo:block> </fo:block>
5083
5140
  <fo:block break-after="page"/>
5141
+ </xsl:template><xsl:template match="*[local-name() = 'span']">
5142
+ <xsl:apply-templates/>
5084
5143
  </xsl:template><xsl:template name="tokenize">
5085
5144
  <xsl:param name="text"/>
5086
5145
  <xsl:param name="separator" select="' '"/>
5087
5146
  <xsl:choose>
5088
5147
  <xsl:when test="not(contains($text, $separator))">
5089
5148
  <word>
5090
- <xsl:variable name="str_no_en_chars" select="normalize-space(translate($text, $en_chars, ''))"/>
5091
- <xsl:variable name="len_str_no_en_chars" select="string-length($str_no_en_chars)"/>
5092
5149
  <xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
5093
- <xsl:variable name="len_str">
5094
- <xsl:choose>
5095
- <xsl:when test="normalize-space(translate($text, $upper, '')) = ''"> <!-- english word in CAPITAL letters -->
5096
- <xsl:value-of select="$len_str_tmp * 1.5"/>
5097
- </xsl:when>
5098
- <xsl:otherwise>
5099
- <xsl:value-of select="$len_str_tmp"/>
5100
- </xsl:otherwise>
5101
- </xsl:choose>
5102
- </xsl:variable>
5103
-
5104
- <!-- <xsl:if test="$len_str_no_en_chars div $len_str &gt; 0.8">
5105
- <xsl:message>
5106
- div=<xsl:value-of select="$len_str_no_en_chars div $len_str"/>
5107
- len_str=<xsl:value-of select="$len_str"/>
5108
- len_str_no_en_chars=<xsl:value-of select="$len_str_no_en_chars"/>
5109
- </xsl:message>
5110
- </xsl:if> -->
5111
- <!-- <len_str_no_en_chars><xsl:value-of select="$len_str_no_en_chars"/></len_str_no_en_chars>
5112
- <len_str><xsl:value-of select="$len_str"/></len_str> -->
5113
5150
  <xsl:choose>
5114
- <xsl:when test="$len_str_no_en_chars div $len_str &gt; 0.8"> <!-- means non-english string -->
5115
- <xsl:value-of select="$len_str - $len_str_no_en_chars"/>
5151
+ <xsl:when test="normalize-space(translate($text, 'X', '')) = ''"> <!-- special case for keep-together.within-line -->
5152
+ <xsl:value-of select="$len_str_tmp"/>
5116
5153
  </xsl:when>
5117
5154
  <xsl:otherwise>
5118
- <xsl:value-of select="$len_str"/>
5155
+ <xsl:variable name="str_no_en_chars" select="normalize-space(translate($text, $en_chars, ''))"/>
5156
+ <xsl:variable name="len_str_no_en_chars" select="string-length($str_no_en_chars)"/>
5157
+ <xsl:variable name="len_str">
5158
+ <xsl:choose>
5159
+ <xsl:when test="normalize-space(translate($text, $upper, '')) = ''"> <!-- english word in CAPITAL letters -->
5160
+ <xsl:value-of select="$len_str_tmp * 1.5"/>
5161
+ </xsl:when>
5162
+ <xsl:otherwise>
5163
+ <xsl:value-of select="$len_str_tmp"/>
5164
+ </xsl:otherwise>
5165
+ </xsl:choose>
5166
+ </xsl:variable>
5167
+
5168
+ <!-- <xsl:if test="$len_str_no_en_chars div $len_str &gt; 0.8">
5169
+ <xsl:message>
5170
+ div=<xsl:value-of select="$len_str_no_en_chars div $len_str"/>
5171
+ len_str=<xsl:value-of select="$len_str"/>
5172
+ len_str_no_en_chars=<xsl:value-of select="$len_str_no_en_chars"/>
5173
+ </xsl:message>
5174
+ </xsl:if> -->
5175
+ <!-- <len_str_no_en_chars><xsl:value-of select="$len_str_no_en_chars"/></len_str_no_en_chars>
5176
+ <len_str><xsl:value-of select="$len_str"/></len_str> -->
5177
+ <xsl:choose>
5178
+ <xsl:when test="$len_str_no_en_chars div $len_str &gt; 0.8"> <!-- means non-english string -->
5179
+ <xsl:value-of select="$len_str - $len_str_no_en_chars"/>
5180
+ </xsl:when>
5181
+ <xsl:otherwise>
5182
+ <xsl:value-of select="$len_str"/>
5183
+ </xsl:otherwise>
5184
+ </xsl:choose>
5119
5185
  </xsl:otherwise>
5120
5186
  </xsl:choose>
5121
5187
  </word>
@@ -5511,7 +5577,9 @@
5511
5577
  <!-- replace start and end spaces to non-break space -->
5512
5578
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
5513
5579
  </xsl:copy>
5514
- </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
5580
+ </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="mathml:mtd/mathml:mo/text()[. = '/']" mode="mathml">
5581
+ <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
5582
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
5515
5583
  <xsl:variable name="target">
5516
5584
  <xsl:choose>
5517
5585
  <xsl:when test="@updatetype = 'true'">
@@ -6327,7 +6395,11 @@
6327
6395
  <xsl:apply-templates mode="bookmarks"/>
6328
6396
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
6329
6397
  <xsl:apply-templates select="."/>
6330
- </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">
6398
+ </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() = 'span']" mode="contents">
6399
+ <xsl:apply-templates mode="contents"/>
6400
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
6401
+ <xsl:apply-templates mode="bookmarks"/>
6402
+ </xsl:template><xsl:template match="*[local-name() = 'span']" mode="bookmarks">
6331
6403
  <xsl:apply-templates mode="bookmarks"/>
6332
6404
  </xsl:template><xsl:template name="addBookmarks">
6333
6405
  <xsl:param name="contents"/>
@@ -6609,7 +6681,9 @@
6609
6681
  <xsl:apply-templates/>
6610
6682
  </xsl:otherwise>
6611
6683
  </xsl:choose>
6612
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
6684
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'xref']" mode="contents">
6685
+ <xsl:value-of select="."/>
6686
+ </xsl:template><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
6613
6687
  <xsl:text> </xsl:text>
6614
6688
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
6615
6689
  <xsl:copy>
@@ -6640,9 +6714,22 @@
6640
6714
  </xsl:when>
6641
6715
  <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise>
6642
6716
  </xsl:choose>
6717
+ </xsl:template><xsl:template match="text()" mode="contents_item">
6718
+ <xsl:call-template name="keep_together_standard_number"/>
6719
+ </xsl:template><xsl:template match="*[local-name() = 'span']" mode="contents_item">
6720
+ <xsl:apply-templates mode="contents_item"/>
6643
6721
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6644
6722
 
6645
6723
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
6724
+
6725
+ <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
6726
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
6727
+ </xsl:if>
6728
+
6729
+ <xsl:if test="ancestor::*[local-name() = 'example']">
6730
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
6731
+ </xsl:if>
6732
+
6646
6733
  <xsl:copy-of select="@id"/>
6647
6734
 
6648
6735
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -7120,39 +7207,67 @@
7120
7207
  </xsl:otherwise>
7121
7208
  </xsl:choose>
7122
7209
  </xsl:template><xsl:template match="*[local-name() = 'example']">
7123
- <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
7124
-
7210
+
7211
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
7212
+
7125
7213
 
7214
+
7126
7215
  <xsl:variable name="fo_element">
7127
- <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
7216
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
7128
7217
  inline
7129
7218
  </xsl:variable>
7130
7219
 
7131
- <!-- display 'EXAMPLE' -->
7132
- <xsl:apply-templates select="*[local-name()='name']">
7133
- <xsl:with-param name="fo_element" select="$fo_element"/>
7134
- </xsl:apply-templates>
7220
+ <fo:block-container margin-left="0mm">
7135
7221
 
7136
- <xsl:choose>
7137
- <xsl:when test="contains(normalize-space($fo_element), 'block')">
7138
- <fo:block-container xsl:use-attribute-sets="example-body-style">
7139
- <fo:block-container margin-left="0mm" margin-right="0mm">
7140
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
7222
+ <xsl:choose>
7223
+
7224
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
7225
+
7226
+ <!-- display name 'EXAMPLE' in a separate block -->
7227
+ <fo:block>
7228
+ <xsl:apply-templates select="*[local-name()='name']">
7141
7229
  <xsl:with-param name="fo_element" select="$fo_element"/>
7142
7230
  </xsl:apply-templates>
7231
+ </fo:block>
7232
+
7233
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
7234
+ <fo:block-container margin-left="0mm" margin-right="0mm">
7235
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
7236
+ <xsl:with-param name="fo_element" select="$fo_element"/>
7237
+ </xsl:apply-templates>
7238
+ </fo:block-container>
7143
7239
  </fo:block-container>
7144
- </fo:block-container>
7145
- </xsl:when>
7146
- <xsl:otherwise>
7147
- <fo:inline>
7148
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
7149
- <xsl:with-param name="fo_element" select="$fo_element"/>
7150
- </xsl:apply-templates>
7151
- </fo:inline>
7152
- </xsl:otherwise>
7153
- </xsl:choose>
7154
-
7155
- </fo:block>
7240
+ </xsl:when> <!-- end block -->
7241
+
7242
+ <xsl:otherwise> <!-- inline -->
7243
+
7244
+ <!-- display 'EXAMPLE' and first element in the same line -->
7245
+ <fo:block>
7246
+ <xsl:apply-templates select="*[local-name()='name']">
7247
+ <xsl:with-param name="fo_element" select="$fo_element"/>
7248
+ </xsl:apply-templates>
7249
+ <fo:inline>
7250
+ <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
7251
+ <xsl:with-param name="fo_element" select="$fo_element"/>
7252
+ </xsl:apply-templates>
7253
+ </fo:inline>
7254
+ </fo:block>
7255
+
7256
+ <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
7257
+ <!-- display further elements in blocks -->
7258
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
7259
+ <fo:block-container margin-left="0mm" margin-right="0mm">
7260
+ <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
7261
+ <xsl:with-param name="fo_element" select="'block'"/>
7262
+ </xsl:apply-templates>
7263
+ </fo:block-container>
7264
+ </fo:block-container>
7265
+ </xsl:if>
7266
+ </xsl:otherwise> <!-- end inline -->
7267
+
7268
+ </xsl:choose>
7269
+ </fo:block-container>
7270
+ </fo:block-container>
7156
7271
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
7157
7272
  <xsl:param name="fo_element">block</xsl:param>
7158
7273
 
@@ -7189,10 +7304,16 @@
7189
7304
  </xsl:variable>
7190
7305
  <xsl:choose>
7191
7306
  <xsl:when test="starts-with(normalize-space($element), 'block')">
7192
- <fo:block xsl:use-attribute-sets="example-p-style">
7193
-
7194
- <xsl:apply-templates/>
7195
- </fo:block>
7307
+ <fo:block-container>
7308
+ <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
7309
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
7310
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
7311
+ </xsl:if>
7312
+ <fo:block xsl:use-attribute-sets="example-p-style">
7313
+
7314
+ <xsl:apply-templates/>
7315
+ </fo:block>
7316
+ </fo:block-container>
7196
7317
  </xsl:when>
7197
7318
  <xsl:otherwise>
7198
7319
  <fo:inline xsl:use-attribute-sets="example-p-style">
@@ -7371,7 +7492,16 @@
7371
7492
  </fo:inline>
7372
7493
  </xsl:when>
7373
7494
  <xsl:otherwise> <!-- if there is key('bibitems_hidden', $current_bibitemid) -->
7374
- <fo:inline><xsl:apply-templates/></fo:inline>
7495
+
7496
+ <!-- if in bibitem[@hidden='true'] there is url[@type='src'], then create hyperlink -->
7497
+ <xsl:variable name="uri_src" select="normalize-space($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'src'])"/>
7498
+ <xsl:choose>
7499
+ <xsl:when test="$uri_src != ''">
7500
+ <fo:basic-link external-destination="{$uri_src}" fox:alt-text="{$uri_src}"><xsl:apply-templates/></fo:basic-link>
7501
+ </xsl:when>
7502
+ <xsl:otherwise><fo:inline><xsl:apply-templates/></fo:inline></xsl:otherwise>
7503
+ </xsl:choose>
7504
+
7375
7505
  </xsl:otherwise>
7376
7506
  </xsl:choose>
7377
7507
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
@@ -7547,10 +7677,24 @@
7547
7677
 
7548
7678
  </fo:block>
7549
7679
  <xsl:apply-templates/>
7550
- </xsl:template><xsl:template match="*[local-name() = 'review']">
7680
+ </xsl:template><xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
7551
7681
  <!-- comment 2019-11-29 -->
7552
7682
  <!-- <fo:block font-weight="bold">Review:</fo:block>
7553
7683
  <xsl:apply-templates /> -->
7684
+
7685
+ <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
7686
+
7687
+ <xsl:choose>
7688
+ <!-- if there isn't the attribute '@from', then -->
7689
+ <xsl:when test="$id_from = ''">
7690
+ <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
7691
+ </xsl:when>
7692
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
7693
+ <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
7694
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
7695
+ </xsl:when>
7696
+ </xsl:choose>
7697
+
7554
7698
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
7555
7699
  <!-- 0xA0 to space replacement -->
7556
7700
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -7907,7 +8051,10 @@
7907
8051
  <!-- to split by '_' and other chars -->
7908
8052
  <xsl:call-template name="add-zero-spaces-java"/>
7909
8053
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
7910
- <fo:inline id="{@id}" font-size="1pt"/>
8054
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
8055
+ <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
8056
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
8057
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"> </xsl:if>
7911
8058
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
7912
8059
  <!-- <row>
7913
8060
  <date>05-07-2013</date>
@@ -8443,6 +8590,8 @@
8443
8590
  <xsl:apply-templates select="." mode="update_xml_step1"/>
8444
8591
  </xsl:for-each>
8445
8592
  </xsl:copy>
8593
+ </xsl:template><xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
8594
+ <xsl:apply-templates mode="update_xml_step1"/>
8446
8595
  </xsl:template>
8447
8596
  <!-- STEP2: add 'fn' after 'eref' and 'origin', if referenced to bibitem with 'note' = Withdrawn.' or 'Cancelled and replaced...' -->
8448
8597
  <xsl:template match="@*|node()" mode="update_xml_step2">
@@ -8505,7 +8654,127 @@
8505
8654
  </xsl:template>
8506
8655
 
8507
8656
  <!-- END STEP2: add 'fn' after 'eref' and 'origin', if referenced to bibitem with 'note' = Withdrawn.' or 'Cancelled and replaced...' -->
8508
- <xsl:template name="convertDate">
8657
+ <xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
8658
+ <xsl:copy>
8659
+ <xsl:apply-templates select="@*|node()" mode="update_xml_enclose_keep-together_within-line"/>
8660
+ </xsl:copy>
8661
+ </xsl:template><xsl:variable name="express_reference_separators">_.\</xsl:variable><xsl:variable name="express_reference_characters" select="concat($upper,$lower,'1234567890',$express_reference_separators)"/><xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable><xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
8662
+
8663
+ <!-- enclose standard's number into tag 'keep-together_within-line' -->
8664
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
8665
+ <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
8666
+ <xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
8667
+ <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
8668
+ <xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
8669
+ <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
8670
+ <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
8671
+ <xsl:with-param name="text" select="$text_"/>
8672
+ </xsl:call-template></text></xsl:variable>
8673
+
8674
+ <xsl:variable name="parent" select="local-name(..)"/>
8675
+
8676
+ <xsl:variable name="text2">
8677
+ <text><xsl:for-each select="xalan:nodeset($text)/text/node()">
8678
+
8679
+ <xsl:choose>
8680
+ <!-- if EXPRESS reference -->
8681
+ <xsl:when test="self::text() and $parent = 'strong' and translate(., $express_reference_characters, '') = ''">
8682
+ <xsl:element name="{$element_name_keep-together_within-line}"><xsl:value-of select="."/></xsl:element>
8683
+ </xsl:when>
8684
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
8685
+ </xsl:choose>
8686
+
8687
+ </xsl:for-each></text>
8688
+ </xsl:variable>
8689
+
8690
+ <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
8691
+ <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable>
8692
+ <xsl:variable name="text3">
8693
+ <text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
8694
+ <xsl:choose>
8695
+ <xsl:when test="self::text()">
8696
+ <xsl:variable name="text_units_" select="java:replaceAll(java:java.lang.String.new(.),$regex_solidus_units,concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
8697
+ <xsl:variable name="text_units"><text><xsl:call-template name="replace_text_tags">
8698
+ <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
8699
+ <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
8700
+ <xsl:with-param name="text" select="$text_units_"/>
8701
+ </xsl:call-template></text></xsl:variable>
8702
+ <xsl:copy-of select="xalan:nodeset($text_units)/text/node()"/>
8703
+ </xsl:when>
8704
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
8705
+ </xsl:choose>
8706
+ </xsl:for-each></text>
8707
+ </xsl:variable>
8708
+
8709
+ <xsl:choose>
8710
+ <xsl:when test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
8711
+ <!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
8712
+ <xsl:variable name="regex_dots_units">((\b((\S{1,3}\.\S+)|(\S+\.\S{1,3}))\b)|(\.\S{1,3})\b)</xsl:variable>
8713
+ <xsl:for-each select="xalan:nodeset($text3)/text/node()">
8714
+ <xsl:choose>
8715
+ <xsl:when test="self::text()">
8716
+ <xsl:variable name="text_dots_" select="java:replaceAll(java:java.lang.String.new(.),$regex_dots_units,concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
8717
+ <xsl:variable name="text_dots"><text><xsl:call-template name="replace_text_tags">
8718
+ <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
8719
+ <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
8720
+ <xsl:with-param name="text" select="$text_dots_"/>
8721
+ </xsl:call-template></text></xsl:variable>
8722
+ <xsl:copy-of select="xalan:nodeset($text_dots)/text/node()"/>
8723
+ </xsl:when>
8724
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
8725
+ </xsl:choose>
8726
+ </xsl:for-each>
8727
+ </xsl:when>
8728
+ <xsl:otherwise><xsl:copy-of select="xalan:nodeset($text3)/text/node()"/></xsl:otherwise>
8729
+ </xsl:choose>
8730
+
8731
+ </xsl:template><xsl:template name="replace_text_tags">
8732
+ <xsl:param name="tag_open"/>
8733
+ <xsl:param name="tag_close"/>
8734
+ <xsl:param name="text"/>
8735
+ <xsl:choose>
8736
+ <xsl:when test="contains($text, $tag_open)">
8737
+ <xsl:value-of select="substring-before($text, $tag_open)"/>
8738
+ <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
8739
+
8740
+ <xsl:element name="{substring-before(substring-after($tag_open, '###'),'###')}">
8741
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
8742
+ </xsl:element>
8743
+
8744
+ <xsl:call-template name="replace_text_tags">
8745
+ <xsl:with-param name="tag_open" select="$tag_open"/>
8746
+ <xsl:with-param name="tag_close" select="$tag_close"/>
8747
+ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
8748
+ </xsl:call-template>
8749
+ </xsl:when>
8750
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
8751
+ </xsl:choose>
8752
+ </xsl:template><xsl:template name="printEdition">
8753
+ <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
8754
+ <xsl:text> </xsl:text>
8755
+ <xsl:choose>
8756
+ <xsl:when test="$edition_i18n != ''">
8757
+ <!-- Example: <edition language="fr">deuxième édition</edition> -->
8758
+ <xsl:call-template name="capitalize">
8759
+ <xsl:with-param name="str" select="$edition_i18n"/>
8760
+ </xsl:call-template>
8761
+ </xsl:when>
8762
+ <xsl:otherwise>
8763
+ <xsl:variable name="edition" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
8764
+ <xsl:if test="$edition != ''"> <!-- Example: 1.3 -->
8765
+ <xsl:call-template name="capitalize">
8766
+ <xsl:with-param name="str">
8767
+ <xsl:call-template name="getLocalizedString">
8768
+ <xsl:with-param name="key">edition</xsl:with-param>
8769
+ </xsl:call-template>
8770
+ </xsl:with-param>
8771
+ </xsl:call-template>
8772
+ <xsl:text> </xsl:text>
8773
+ <xsl:value-of select="$edition"/>
8774
+ </xsl:if>
8775
+ </xsl:otherwise>
8776
+ </xsl:choose>
8777
+ </xsl:template><xsl:template name="convertDate">
8509
8778
  <xsl:param name="date"/>
8510
8779
  <xsl:param name="format" select="'short'"/>
8511
8780
  <xsl:variable name="year" select="substring($date, 1, 4)"/>