metanorma-m3aawg 2.0.6 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,13 @@
28
28
 
29
29
  <xsl:template match="/">
30
30
  <xsl:call-template name="namespaceCheck"/>
31
- <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
31
+ <fo:root xml:lang="{$lang}">
32
+ <xsl:variable name="root-style">
33
+ <root-style xsl:use-attribute-sets="root-style"/>
34
+ </xsl:variable>
35
+ <xsl:call-template name="insertRootStyle">
36
+ <xsl:with-param name="root-style" select="$root-style"/>
37
+ </xsl:call-template>
32
38
  <fo:layout-master-set>
33
39
 
34
40
  <!-- cover page -->
@@ -167,21 +173,18 @@
167
173
  </fo:block>
168
174
  <!-- Version 1.0 -->
169
175
  <fo:block font-size="12pt" margin-bottom="6pt">
170
- <xsl:variable name="title-edition">
171
- <xsl:call-template name="getTitle">
172
- <xsl:with-param name="name" select="'title-edition'"/>
176
+ <xsl:variable name="edition" select="normalize-space(/m3d:m3d-standard/m3d:bibdata/m3d:edition[normalize-space(@language) = ''])"/>
177
+ <xsl:if test="$edition != ''">
178
+ <xsl:call-template name="capitalize">
179
+ <xsl:with-param name="str">
180
+ <xsl:call-template name="getLocalizedString">
181
+ <xsl:with-param name="key">version</xsl:with-param>
182
+ </xsl:call-template>
183
+ </xsl:with-param>
173
184
  </xsl:call-template>
174
- </xsl:variable>
175
- <xsl:value-of select="$title-edition"/><xsl:text>: </xsl:text>
176
- <xsl:variable name="edition" select="/m3d:m3d-standard/m3d:bibdata/m3d:edition"/>
177
- <xsl:choose>
178
- <xsl:when test="contains($edition, '.')">
179
- <xsl:value-of select="$edition"/>
180
- </xsl:when>
181
- <xsl:otherwise>
182
- <xsl:value-of select="$edition"/><xsl:text>.0</xsl:text>
183
- </xsl:otherwise>
184
- </xsl:choose>
185
+ <xsl:text>: </xsl:text>
186
+ <xsl:value-of select="$edition"/><xsl:if test="not(contains($edition, '.'))"><xsl:text>.0</xsl:text></xsl:if>
187
+ </xsl:if>
185
188
  </fo:block>
186
189
  <fo:block font-size="12pt" margin-bottom="12pt">
187
190
  <xsl:call-template name="convertDate">
@@ -642,25 +645,11 @@
642
645
  </xsl:template>
643
646
 
644
647
 
645
-
646
- <xsl:template match="mathml:math" priority="2">
647
- <fo:inline font-family="Cambria Math">
648
- <xsl:variable name="mathml">
649
- <xsl:apply-templates select="." mode="mathml"/>
650
- </xsl:variable>
651
- <fo:instream-foreign-object fox:alt-text="Math">
652
- <!-- <xsl:copy-of select="."/> -->
653
- <xsl:copy-of select="xalan:nodeset($mathml)"/>
654
- </fo:instream-foreign-object>
655
- </fo:inline>
656
- </xsl:template>
657
-
658
-
659
648
  <xsl:variable name="Image-M3AAWG-Logo">
660
649
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAjUAAAA8CAYAAACehUt5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA99pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLz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UyCwhX43GS4fKHV6wfDcXkTDOsI4byfPzq2B9pQqc9C9gVKnGxOWF24nYu5cUs1twmr59sCl/WjzU1MAHYIQWw2XqsLZRoRpOjVnMND+1qKFmae8wFgtsG2gHDly5KgAVF5e/pvffrJtf4yoCUBDsrlDD0jZnqdqAtAEtE9GzVJS12NpxxuqwnCspk7vvSewQplRk4CGffKrpLu4WsU2xFMqfgTkuIS+hrErAGQ7eV+RpBtsgMaRI0eOqpNswmSFMlscf1yDdZ5rqVfsk3NFkMJL4HkmbZYabCMMUYsM4wNDz3VFkKzUrNShVr7FUOZ9NShw35f64SwWk60P1I2fJiwW9gDQlGR1cGTSNv0gbYKhLrYvh9WWD5peZ3C5fFLqB3dI7HfDm2YPzqkkhzFChQ+bC2gOAdpwAOpSxzYdOXJUW8m8/VQPKGr7yVHdJbgdKy+GwcowwKvGOsCgFnZZy2jfUtv7DMAXtgDYy4dHFM5Yakzw/AsXBTBqhR3AXAaFzOI7nKfc9pMjR44KTNh+cmc/OaqTRBCxpIbrgO2dVXWoz6DF+ZLJkSNHjuodOZduR44cOXLkyJEDNY4cOXLkyJEjR7WF/O2nDbnvXd9oIzfEjhw5cuTI0W8L1CAA0DauOxw5clQA6khe84PrCkeOHBWS/l+AAQACYD7v73Ou8wAAAABJRU5ErkJggg==</xsl:text>
661
650
  </xsl:variable>
662
651
 
663
- <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:variable name="lang">
652
+ <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">
664
653
  <xsl:call-template name="getLang"/>
665
654
  </xsl:variable><xsl:variable name="pageWidth_">
666
655
  215.9
@@ -675,20 +664,7 @@
675
664
  </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
676
665
  23
677
666
  </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
678
-
679
- <title-edition lang="en">
680
-
681
- <xsl:text>Version</xsl:text>
682
-
683
- </title-edition>
684
667
 
685
- <title-edition lang="fr">
686
- <xsl:text>Édition </xsl:text>
687
- </title-edition>
688
-
689
- <title-edition lang="ru">
690
- <xsl:text>Издание </xsl:text>
691
- </title-edition>
692
668
 
693
669
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
694
670
  <title-toc lang="en">
@@ -769,7 +745,7 @@
769
745
  </xsl:variable><xsl:variable name="bibdata">
770
746
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
771
747
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
772
- </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">
748
+ </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">
773
749
  <xsl:param name="name"/>
774
750
  <xsl:param name="lang"/>
775
751
  <xsl:variable name="lang_">
@@ -812,7 +788,30 @@
812
788
 
813
789
 
814
790
 
815
- </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
791
+ </xsl:attribute-set><xsl:template name="insertRootStyle">
792
+ <xsl:param name="root-style"/>
793
+ <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
794
+
795
+ <xsl:variable name="additional_fonts_">
796
+ <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']">
797
+ <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
798
+ </xsl:for-each>
799
+ </xsl:variable>
800
+ <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
801
+
802
+ <xsl:for-each select="$root-style_/root-style/@*">
803
+ <xsl:choose>
804
+ <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
805
+ <xsl:attribute name="{local-name()}">
806
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
807
+ </xsl:attribute>
808
+ </xsl:when>
809
+ <xsl:otherwise>
810
+ <xsl:copy-of select="."/>
811
+ </xsl:otherwise>
812
+ </xsl:choose>
813
+ </xsl:for-each>
814
+ </xsl:template><xsl:attribute-set name="copyright-statement-style">
816
815
 
817
816
  </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
818
817
 
@@ -869,7 +868,6 @@
869
868
 
870
869
 
871
870
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style">
872
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
873
871
 
874
872
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
875
873
  <xsl:attribute name="white-space">pre</xsl:attribute>
@@ -955,6 +953,7 @@
955
953
 
956
954
 
957
955
 
956
+
958
957
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
959
958
 
960
959
 
@@ -1321,7 +1320,7 @@
1321
1320
 
1322
1321
 
1323
1322
 
1324
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1323
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1325
1324
 
1326
1325
 
1327
1326
 
@@ -1508,6 +1507,8 @@
1508
1507
  </xsl:attribute-set><xsl:attribute-set name="mathml-style">
1509
1508
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1510
1509
 
1510
+ <xsl:attribute name="font-family">Cambria Math</xsl:attribute>
1511
+
1511
1512
 
1512
1513
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1513
1514
 
@@ -2021,10 +2022,41 @@
2021
2022
  <xsl:sort select="@displayorder" data-type="number"/>
2022
2023
  <xsl:apply-templates select="."/>
2023
2024
  </xsl:for-each>
2024
- </xsl:template><xsl:template match="text()">
2025
- <xsl:value-of select="."/>
2025
+ </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">
2026
+
2027
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2028
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/>
2029
+ <xsl:call-template name="replace_fo_inline_tags">
2030
+ <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
2031
+ <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
2032
+ <xsl:with-param name="text" select="$text"/>
2033
+ </xsl:call-template>
2034
+
2035
+ </xsl:template><xsl:template name="replace_fo_inline_tags">
2036
+ <xsl:param name="tag_open"/>
2037
+ <xsl:param name="tag_close"/>
2038
+ <xsl:param name="text"/>
2039
+ <xsl:choose>
2040
+ <xsl:when test="contains($text, $tag_open)">
2041
+ <xsl:value-of select="substring-before($text, $tag_open)"/>
2042
+ <!-- <xsl:text disable-output-escaping="yes">&lt;fo:inline keep-together.within-line="always"&gt;</xsl:text> -->
2043
+ <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
2044
+ <fo:inline keep-together.within-line="always">
2045
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
2046
+ </fo:inline>
2047
+ <!-- <xsl:text disable-output-escaping="yes">&lt;/fo:inline&gt;</xsl:text> -->
2048
+ <xsl:call-template name="replace_fo_inline_tags">
2049
+ <xsl:with-param name="tag_open" select="$tag_open"/>
2050
+ <xsl:with-param name="tag_close" select="$tag_close"/>
2051
+ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
2052
+ </xsl:call-template>
2053
+ </xsl:when>
2054
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
2055
+ </xsl:choose>
2026
2056
  </xsl:template><xsl:template match="*[local-name()='br']">
2027
2057
  <xsl:value-of select="$linebreak"/>
2058
+ </xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']">
2059
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2028
2060
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
2029
2061
  <fo:block xsl:use-attribute-sets="copyright-statement-style">
2030
2062
  <xsl:apply-templates/>
@@ -2090,8 +2122,23 @@
2090
2122
  </xsl:call-template>
2091
2123
 
2092
2124
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2093
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
2094
- <xsl:call-template name="add-zero-spaces-java"/>
2125
+ <xsl:choose>
2126
+ <xsl:when test="parent::*[local-name() = 'keep-together_within-line']">
2127
+ <xsl:value-of select="."/>
2128
+ </xsl:when>
2129
+ <xsl:otherwise>
2130
+ <xsl:call-template name="addZeroWidthSpacesToTextNodes"/>
2131
+ </xsl:otherwise>
2132
+ </xsl:choose>
2133
+ </xsl:template><xsl:template name="addZeroWidthSpacesToTextNodes">
2134
+ <xsl:variable name="text"><text><xsl:call-template name="text"/></text></xsl:variable>
2135
+ <!-- <xsl:copy-of select="$text"/> -->
2136
+ <xsl:for-each select="xalan:nodeset($text)/text/node()">
2137
+ <xsl:choose>
2138
+ <xsl:when test="self::text()"><xsl:call-template name="add-zero-spaces-java"/></xsl:when>
2139
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
2140
+ </xsl:choose>
2141
+ </xsl:for-each>
2095
2142
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2096
2143
 
2097
2144
  <xsl:variable name="table-preamble">
@@ -2215,16 +2262,9 @@
2215
2262
  </xsl:for-each>
2216
2263
  </xsl:when>
2217
2264
  <xsl:otherwise>
2218
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2219
- <xsl:choose>
2220
- <xsl:when test=". = 1 or . = 0">
2221
- <fo:table-column column-width="proportional-column-width(2)"/>
2222
- </xsl:when>
2223
- <xsl:otherwise>
2224
- <fo:table-column column-width="proportional-column-width({.})"/>
2225
- </xsl:otherwise>
2226
- </xsl:choose>
2227
- </xsl:for-each>
2265
+ <xsl:call-template name="insertTableColumnWidth">
2266
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2267
+ </xsl:call-template>
2228
2268
  </xsl:otherwise>
2229
2269
  </xsl:choose>
2230
2270
 
@@ -2388,6 +2428,7 @@
2388
2428
  <xsl:with-param name="text" select="$td_text"/>
2389
2429
  </xsl:call-template>
2390
2430
  </xsl:variable>
2431
+ <!-- <xsl:message>string_with_added_zerospaces=<xsl:value-of select="$string_with_added_zerospaces"/></xsl:message> -->
2391
2432
  <xsl:call-template name="tokenize">
2392
2433
  <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
2393
2434
  <!-- 2009 thinspace -->
@@ -2400,6 +2441,7 @@
2400
2441
  <xsl:with-param name="words" select="xalan:nodeset($words)"/>
2401
2442
  </xsl:call-template>
2402
2443
  </xsl:variable>
2444
+ <!-- <xsl:message>max_length=<xsl:value-of select="$max_length"/></xsl:message> -->
2403
2445
  <width>
2404
2446
  <xsl:variable name="divider">
2405
2447
  <xsl:choose>
@@ -2432,6 +2474,10 @@
2432
2474
  <xsl:with-param name="table" select="$table"/>
2433
2475
  </xsl:call-template>
2434
2476
  </xsl:if>
2477
+ </xsl:template><xsl:template match="*[@keep-together.within-line]/text()" priority="2" mode="td_text">
2478
+ <!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message>
2479
+ <xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> -->
2480
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/>
2435
2481
  </xsl:template><xsl:template match="text()" mode="td_text">
2436
2482
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2437
2483
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
@@ -2533,16 +2579,9 @@
2533
2579
  </xsl:for-each>
2534
2580
  </xsl:when>
2535
2581
  <xsl:otherwise>
2536
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2537
- <xsl:choose>
2538
- <xsl:when test=". = 1 or . = 0">
2539
- <fo:table-column column-width="proportional-column-width(2)"/>
2540
- </xsl:when>
2541
- <xsl:otherwise>
2542
- <fo:table-column column-width="proportional-column-width({.})"/>
2543
- </xsl:otherwise>
2544
- </xsl:choose>
2545
- </xsl:for-each>
2582
+ <xsl:call-template name="insertTableColumnWidth">
2583
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2584
+ </xsl:call-template>
2546
2585
  </xsl:otherwise>
2547
2586
  </xsl:choose>
2548
2587
 
@@ -3083,8 +3122,10 @@
3083
3122
  <!-- and (not(../@class) or ../@class !='pseudocode') -->
3084
3123
  </xsl:variable>
3085
3124
 
3125
+ <xsl:variable name="onlyOneComponent" select="normalize-space($parent = 'formula' and count(*[local-name()='dt']) = 1)"/>
3126
+
3086
3127
  <xsl:choose>
3087
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
3128
+ <xsl:when test="$onlyOneComponent = 'true'"> <!-- only one component -->
3088
3129
 
3089
3130
  <fo:block margin-bottom="12pt" text-align="left">
3090
3131
 
@@ -3099,7 +3140,7 @@
3099
3140
  <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
3100
3141
  </fo:block>
3101
3142
 
3102
- </xsl:when>
3143
+ </xsl:when> <!-- END: only one component -->
3103
3144
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3104
3145
  <fo:block margin-bottom="12pt" text-align="left">
3105
3146
 
@@ -3113,8 +3154,8 @@
3113
3154
  </xsl:variable>
3114
3155
  <xsl:value-of select="$title-where"/>
3115
3156
  </fo:block>
3116
- </xsl:when>
3117
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
3157
+ </xsl:when> <!-- END: a few components -->
3158
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
3118
3159
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3119
3160
 
3120
3161
 
@@ -3127,11 +3168,11 @@
3127
3168
  </xsl:variable>
3128
3169
  <xsl:value-of select="$title-key"/>
3129
3170
  </fo:block>
3130
- </xsl:when>
3171
+ </xsl:when> <!-- END: definition list in a figure -->
3131
3172
  </xsl:choose>
3132
3173
 
3133
3174
  <!-- a few components -->
3134
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
3175
+ <xsl:if test="$onlyOneComponent = 'false'">
3135
3176
  <fo:block>
3136
3177
 
3137
3178
 
@@ -3170,21 +3211,28 @@
3170
3211
  <xsl:apply-templates mode="dl"/>
3171
3212
  </tbody>
3172
3213
  </xsl:variable>
3173
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
3214
+ <!-- DEBUG: html-table<xsl:copy-of select="$html-table"/> -->
3174
3215
  <xsl:variable name="colwidths">
3175
3216
  <xsl:call-template name="calculate-column-widths">
3176
3217
  <xsl:with-param name="cols-count" select="2"/>
3177
3218
  <xsl:with-param name="table" select="$html-table"/>
3178
3219
  </xsl:call-template>
3179
3220
  </xsl:variable>
3180
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3221
+ <!-- DEBUG: colwidths=<xsl:copy-of select="$colwidths"/> -->
3181
3222
  <xsl:variable name="maxlength_dt">
3182
3223
  <xsl:call-template name="getMaxLength_dt"/>
3183
3224
  </xsl:variable>
3225
+ <xsl:variable name="isContainsKeepTogetherTag_">
3226
+ false
3227
+ </xsl:variable>
3228
+ <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3229
+ <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3184
3230
  <xsl:call-template name="setColumnWidth_dl">
3185
3231
  <xsl:with-param name="colwidths" select="$colwidths"/>
3186
3232
  <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3233
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3187
3234
  </xsl:call-template>
3235
+
3188
3236
  <fo:table-body>
3189
3237
  <xsl:apply-templates>
3190
3238
  <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
@@ -3193,12 +3241,13 @@
3193
3241
  </fo:table>
3194
3242
  </fo:block>
3195
3243
  </fo:block>
3196
- </xsl:if>
3244
+ </xsl:if> <!-- END: a few components -->
3197
3245
  </fo:block-container>
3198
3246
  </fo:block-container>
3199
3247
  </xsl:template><xsl:template name="setColumnWidth_dl">
3200
3248
  <xsl:param name="colwidths"/>
3201
3249
  <xsl:param name="maxlength_dt"/>
3250
+ <xsl:param name="isContainsKeepTogetherTag"/>
3202
3251
  <xsl:choose>
3203
3252
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3204
3253
  <fo:table-column column-width="50%"/>
@@ -3206,6 +3255,11 @@
3206
3255
  </xsl:when>
3207
3256
  <xsl:otherwise>
3208
3257
  <xsl:choose>
3258
+ <xsl:when test="$isContainsKeepTogetherTag">
3259
+ <xsl:call-template name="insertTableColumnWidth">
3260
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3261
+ </xsl:call-template>
3262
+ </xsl:when>
3209
3263
  <!-- to set width check most wide chars like `W` -->
3210
3264
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
3211
3265
  <fo:table-column column-width="7%"/>
@@ -3236,20 +3290,25 @@
3236
3290
  <fo:table-column column-width="60%"/>
3237
3291
  </xsl:when>
3238
3292
  <xsl:otherwise>
3239
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3240
- <xsl:choose>
3241
- <xsl:when test=". = 1 or . = 0">
3242
- <fo:table-column column-width="proportional-column-width(2)"/>
3243
- </xsl:when>
3244
- <xsl:otherwise>
3245
- <fo:table-column column-width="proportional-column-width({.})"/>
3246
- </xsl:otherwise>
3247
- </xsl:choose>
3248
- </xsl:for-each>
3293
+ <xsl:call-template name="insertTableColumnWidth">
3294
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3295
+ </xsl:call-template>
3249
3296
  </xsl:otherwise>
3250
3297
  </xsl:choose>
3251
3298
  </xsl:otherwise>
3252
3299
  </xsl:choose>
3300
+ </xsl:template><xsl:template name="insertTableColumnWidth">
3301
+ <xsl:param name="colwidths"/>
3302
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3303
+ <xsl:choose>
3304
+ <xsl:when test=". = 1 or . = 0">
3305
+ <fo:table-column column-width="proportional-column-width(2)"/>
3306
+ </xsl:when>
3307
+ <xsl:otherwise>
3308
+ <fo:table-column column-width="proportional-column-width({.})"/>
3309
+ </xsl:otherwise>
3310
+ </xsl:choose>
3311
+ </xsl:for-each>
3253
3312
  </xsl:template><xsl:template name="getMaxLength_dt">
3254
3313
  <xsl:variable name="lengths">
3255
3314
  <xsl:for-each select="*[local-name()='dt']">
@@ -3273,7 +3332,6 @@
3273
3332
  <xsl:value-of select="$maxLength"/>
3274
3333
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3275
3334
  <xsl:param name="key_iso"/>
3276
-
3277
3335
  <!-- <tr>
3278
3336
  <td>NOTE</td>
3279
3337
  <td>
@@ -3281,18 +3339,30 @@
3281
3339
  </td>
3282
3340
  </tr>
3283
3341
  -->
3284
- <fo:table-row>
3342
+ <!-- OLD Variant -->
3343
+ <!-- <fo:table-row>
3285
3344
  <fo:table-cell>
3286
3345
  <fo:block margin-top="6pt">
3287
3346
  <xsl:if test="normalize-space($key_iso) = 'true'">
3288
3347
  <xsl:attribute name="margin-top">0</xsl:attribute>
3289
3348
  </xsl:if>
3290
- <xsl:apply-templates select="*[local-name() = 'name']"/>
3349
+ <xsl:apply-templates select="*[local-name() = 'name']" />
3291
3350
  </fo:block>
3292
3351
  </fo:table-cell>
3293
3352
  <fo:table-cell>
3294
3353
  <fo:block>
3295
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3354
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]" />
3355
+ </fo:block>
3356
+ </fo:table-cell>
3357
+ </fo:table-row> -->
3358
+ <!-- <tr>
3359
+ <td number-columns-spanned="2">NOTE <xsl:apply-templates /> </td>
3360
+ </tr>
3361
+ -->
3362
+ <fo:table-row>
3363
+ <fo:table-cell number-columns-spanned="2">
3364
+ <fo:block>
3365
+ <xsl:call-template name="note"/>
3296
3366
  </fo:block>
3297
3367
  </fo:table-cell>
3298
3368
  </fo:table-row>
@@ -3399,13 +3469,15 @@
3399
3469
  <xsl:choose>
3400
3470
  <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3401
3471
  <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3402
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3472
+ <xsl:when test="ancestor::*[local-name()='note'] or ancestor::*[local-name()='example']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3403
3473
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3404
3474
  </xsl:choose>
3405
3475
  </xsl:attribute>
3406
3476
  </xsl:if>
3407
3477
  <xsl:apply-templates/>
3408
3478
  </fo:inline>
3479
+ </xsl:template><xsl:template match="*[local-name()='tt']/text()" priority="2">
3480
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
3409
3481
  </xsl:template><xsl:template match="*[local-name()='underline']">
3410
3482
  <fo:inline text-decoration="underline">
3411
3483
  <xsl:apply-templates/>
@@ -3553,41 +3625,50 @@
3553
3625
  <fo:block break-after="page"/>
3554
3626
  <fo:block> </fo:block>
3555
3627
  <fo:block break-after="page"/>
3628
+ </xsl:template><xsl:template match="*[local-name() = 'span']">
3629
+ <xsl:apply-templates/>
3556
3630
  </xsl:template><xsl:template name="tokenize">
3557
3631
  <xsl:param name="text"/>
3558
3632
  <xsl:param name="separator" select="' '"/>
3559
3633
  <xsl:choose>
3560
3634
  <xsl:when test="not(contains($text, $separator))">
3561
3635
  <word>
3562
- <xsl:variable name="str_no_en_chars" select="normalize-space(translate($text, $en_chars, ''))"/>
3563
- <xsl:variable name="len_str_no_en_chars" select="string-length($str_no_en_chars)"/>
3564
3636
  <xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
3565
- <xsl:variable name="len_str">
3566
- <xsl:choose>
3567
- <xsl:when test="normalize-space(translate($text, $upper, '')) = ''"> <!-- english word in CAPITAL letters -->
3568
- <xsl:value-of select="$len_str_tmp * 1.5"/>
3569
- </xsl:when>
3570
- <xsl:otherwise>
3571
- <xsl:value-of select="$len_str_tmp"/>
3572
- </xsl:otherwise>
3573
- </xsl:choose>
3574
- </xsl:variable>
3575
-
3576
- <!-- <xsl:if test="$len_str_no_en_chars div $len_str &gt; 0.8">
3577
- <xsl:message>
3578
- div=<xsl:value-of select="$len_str_no_en_chars div $len_str"/>
3579
- len_str=<xsl:value-of select="$len_str"/>
3580
- len_str_no_en_chars=<xsl:value-of select="$len_str_no_en_chars"/>
3581
- </xsl:message>
3582
- </xsl:if> -->
3583
- <!-- <len_str_no_en_chars><xsl:value-of select="$len_str_no_en_chars"/></len_str_no_en_chars>
3584
- <len_str><xsl:value-of select="$len_str"/></len_str> -->
3585
3637
  <xsl:choose>
3586
- <xsl:when test="$len_str_no_en_chars div $len_str &gt; 0.8"> <!-- means non-english string -->
3587
- <xsl:value-of select="$len_str - $len_str_no_en_chars"/>
3638
+ <xsl:when test="normalize-space(translate($text, 'X', '')) = ''"> <!-- special case for keep-together.within-line -->
3639
+ <xsl:value-of select="$len_str_tmp"/>
3588
3640
  </xsl:when>
3589
3641
  <xsl:otherwise>
3590
- <xsl:value-of select="$len_str"/>
3642
+ <xsl:variable name="str_no_en_chars" select="normalize-space(translate($text, $en_chars, ''))"/>
3643
+ <xsl:variable name="len_str_no_en_chars" select="string-length($str_no_en_chars)"/>
3644
+ <xsl:variable name="len_str">
3645
+ <xsl:choose>
3646
+ <xsl:when test="normalize-space(translate($text, $upper, '')) = ''"> <!-- english word in CAPITAL letters -->
3647
+ <xsl:value-of select="$len_str_tmp * 1.5"/>
3648
+ </xsl:when>
3649
+ <xsl:otherwise>
3650
+ <xsl:value-of select="$len_str_tmp"/>
3651
+ </xsl:otherwise>
3652
+ </xsl:choose>
3653
+ </xsl:variable>
3654
+
3655
+ <!-- <xsl:if test="$len_str_no_en_chars div $len_str &gt; 0.8">
3656
+ <xsl:message>
3657
+ div=<xsl:value-of select="$len_str_no_en_chars div $len_str"/>
3658
+ len_str=<xsl:value-of select="$len_str"/>
3659
+ len_str_no_en_chars=<xsl:value-of select="$len_str_no_en_chars"/>
3660
+ </xsl:message>
3661
+ </xsl:if> -->
3662
+ <!-- <len_str_no_en_chars><xsl:value-of select="$len_str_no_en_chars"/></len_str_no_en_chars>
3663
+ <len_str><xsl:value-of select="$len_str"/></len_str> -->
3664
+ <xsl:choose>
3665
+ <xsl:when test="$len_str_no_en_chars div $len_str &gt; 0.8"> <!-- means non-english string -->
3666
+ <xsl:value-of select="$len_str - $len_str_no_en_chars"/>
3667
+ </xsl:when>
3668
+ <xsl:otherwise>
3669
+ <xsl:value-of select="$len_str"/>
3670
+ </xsl:otherwise>
3671
+ </xsl:choose>
3591
3672
  </xsl:otherwise>
3592
3673
  </xsl:choose>
3593
3674
  </word>
@@ -3673,24 +3754,28 @@
3673
3754
  </xsl:template><xsl:template name="add-zero-spaces-equal">
3674
3755
  <xsl:param name="text" select="."/>
3675
3756
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
3757
+ <xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
3676
3758
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
3759
+ <xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
3677
3760
  <xsl:variable name="zero-space">​</xsl:variable>
3678
3761
  <xsl:choose>
3679
3762
  <xsl:when test="contains($text, $zero-space-after-equals)">
3680
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
3763
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
3681
3764
  <xsl:value-of select="$zero-space-after-equals"/>
3682
3765
  <xsl:value-of select="$zero-space"/>
3683
3766
  <xsl:call-template name="add-zero-spaces-equal">
3684
3767
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
3685
- </xsl:call-template>
3768
+ </xsl:call-template> -->
3769
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
3686
3770
  </xsl:when>
3687
3771
  <xsl:when test="contains($text, $zero-space-after-equal)">
3688
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
3772
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
3689
3773
  <xsl:value-of select="$zero-space-after-equal"/>
3690
3774
  <xsl:value-of select="$zero-space"/>
3691
3775
  <xsl:call-template name="add-zero-spaces-equal">
3692
3776
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
3693
- </xsl:call-template>
3777
+ </xsl:call-template> -->
3778
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
3694
3779
  </xsl:when>
3695
3780
  <xsl:otherwise>
3696
3781
  <xsl:value-of select="$text"/>
@@ -3858,6 +3943,9 @@
3858
3943
  <xsl:variable name="isDeleted" select="@deleted"/>
3859
3944
 
3860
3945
  <fo:inline xsl:use-attribute-sets="mathml-style">
3946
+
3947
+
3948
+
3861
3949
 
3862
3950
 
3863
3951
  <xsl:call-template name="setTrackChangesStyles">
@@ -3865,48 +3953,80 @@
3865
3953
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3866
3954
  </xsl:call-template>
3867
3955
 
3956
+ <xsl:if test="$add_math_as_text = 'true'">
3957
+ <!-- insert helper tag -->
3958
+ <!-- set unique font-size (fiction) -->
3959
+ <xsl:variable name="font-size_sfx"><xsl:number level="any"/></xsl:variable>
3960
+ <fo:inline color="white" font-size="1.{$font-size_sfx}pt" font-style="normal" font-weight="normal"><xsl:value-of select="$zero_width_space"/></fo:inline> <!-- zero width space -->
3961
+ </xsl:if>
3868
3962
 
3869
-
3870
- <xsl:variable name="mathml">
3871
- <xsl:apply-templates select="." mode="mathml"/>
3963
+ <xsl:variable name="mathml_content">
3964
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3872
3965
  </xsl:variable>
3873
- <fo:instream-foreign-object fox:alt-text="Math">
3874
3966
 
3967
+
3968
+ <xsl:call-template name="mathml_instream_object">
3969
+ <xsl:with-param name="mathml_content" select="$mathml_content"/>
3970
+ </xsl:call-template>
3875
3971
 
3876
-
3877
- <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3878
- <xsl:variable name="comment_text_">
3879
- <xsl:choose>
3880
- <xsl:when test="normalize-space($comment_text_following) != ''">
3881
- <xsl:value-of select="$comment_text_following"/>
3882
- </xsl:when>
3883
- <xsl:otherwise>
3884
- <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3885
- </xsl:otherwise>
3886
- </xsl:choose>
3887
- </xsl:variable>
3888
- <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3889
-
3890
- <xsl:if test="normalize-space($comment_text) != ''">
3891
- <!-- put Mathin Alternate Text -->
3892
- <xsl:attribute name="fox:alt-text">
3893
- <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3894
- </xsl:attribute>
3895
- </xsl:if>
3896
-
3897
- <xsl:variable name="mathml_content">
3898
- <xsl:apply-templates select="." mode="mathml_actual_text"/>
3899
- </xsl:variable>
3900
- <!-- put MathML in Actual Text -->
3901
- <xsl:attribute name="fox:actual-text">
3902
- <xsl:value-of select="$mathml_content"/>
3903
- </xsl:attribute>
3904
-
3905
-
3906
-
3907
- <xsl:copy-of select="xalan:nodeset($mathml)"/>
3908
- </fo:instream-foreign-object>
3972
+
3909
3973
  </fo:inline>
3974
+ </xsl:template><xsl:template name="getMathml_comment_text">
3975
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3976
+ <xsl:variable name="comment_text_">
3977
+ <xsl:choose>
3978
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3979
+ <xsl:value-of select="$comment_text_following"/>
3980
+ </xsl:when>
3981
+ <xsl:otherwise>
3982
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3983
+ </xsl:otherwise>
3984
+ </xsl:choose>
3985
+ </xsl:variable>
3986
+ <xsl:variable name="comment_text_2" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3987
+ <xsl:variable name="comment_text" select="java:trim(java:java.lang.String.new($comment_text_2))"/>
3988
+ <xsl:value-of select="$comment_text"/>
3989
+ </xsl:template><xsl:template name="mathml_instream_object">
3990
+ <xsl:param name="comment_text"/>
3991
+ <xsl:param name="mathml_content"/>
3992
+
3993
+ <xsl:variable name="comment_text_">
3994
+ <xsl:choose>
3995
+ <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
3996
+ <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
3997
+ </xsl:choose>
3998
+ </xsl:variable>
3999
+
4000
+ <xsl:variable name="mathml">
4001
+ <xsl:apply-templates select="." mode="mathml"/>
4002
+ </xsl:variable>
4003
+
4004
+ <fo:instream-foreign-object fox:alt-text="Math">
4005
+
4006
+
4007
+
4008
+
4009
+
4010
+
4011
+
4012
+ <!-- put MathML in Actual Text -->
4013
+ <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
4014
+ <xsl:attribute name="fox:actual-text">
4015
+ <xsl:value-of select="$mathml_content"/>
4016
+ </xsl:attribute>
4017
+
4018
+ <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
4019
+ <xsl:if test="normalize-space($comment_text_) != ''">
4020
+ <!-- put Mathin Alternate Text -->
4021
+ <xsl:attribute name="fox:alt-text">
4022
+ <xsl:value-of select="$comment_text_"/>
4023
+ </xsl:attribute>
4024
+ </xsl:if>
4025
+ <!-- </xsl:if> -->
4026
+
4027
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
4028
+
4029
+ </fo:instream-foreign-object>
3910
4030
  </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3911
4031
  <!-- <xsl:text>a+b</xsl:text> -->
3912
4032
  <xsl:text>&lt;</xsl:text>
@@ -3937,7 +4057,9 @@
3937
4057
  <!-- replace start and end spaces to non-break space -->
3938
4058
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3939
4059
  </xsl:copy>
3940
- </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">
4060
+ </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">
4061
+ <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
4062
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3941
4063
  <xsl:variable name="target">
3942
4064
  <xsl:choose>
3943
4065
  <xsl:when test="@updatetype = 'true'">
@@ -4166,7 +4288,12 @@
4166
4288
 
4167
4289
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
4168
4290
 
4291
+ <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
4292
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
4293
+ </xsl:if>
4294
+
4169
4295
 
4296
+
4170
4297
 
4171
4298
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4172
4299
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
@@ -4529,18 +4656,33 @@
4529
4656
  </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
4530
4657
  <xsl:copy>
4531
4658
  <xsl:apply-templates select="@*" mode="svg_update"/>
4532
- <xsl:variable name="viewbox">
4659
+ <xsl:variable name="viewbox_">
4533
4660
  <xsl:call-template name="split">
4534
4661
  <xsl:with-param name="pText" select="@viewBox"/>
4535
4662
  <xsl:with-param name="sep" select="' '"/>
4536
4663
  </xsl:call-template>
4537
4664
  </xsl:variable>
4665
+ <xsl:variable name="viewbox" select="xalan:nodeset($viewbox_)"/>
4666
+ <xsl:variable name="width" select="normalize-space($viewbox//item[3])"/>
4667
+ <xsl:variable name="height" select="normalize-space($viewbox//item[4])"/>
4668
+
4538
4669
  <xsl:attribute name="width">
4539
- <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
4670
+ <xsl:choose>
4671
+ <xsl:when test="$width != ''">
4672
+ <xsl:value-of select="round($width)"/>
4673
+ </xsl:when>
4674
+ <xsl:otherwise>400</xsl:otherwise> <!-- default width -->
4675
+ </xsl:choose>
4540
4676
  </xsl:attribute>
4541
4677
  <xsl:attribute name="height">
4542
- <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
4678
+ <xsl:choose>
4679
+ <xsl:when test="$height != ''">
4680
+ <xsl:value-of select="round($height)"/>
4681
+ </xsl:when>
4682
+ <xsl:otherwise>400</xsl:otherwise> <!-- default height -->
4683
+ </xsl:choose>
4543
4684
  </xsl:attribute>
4685
+
4544
4686
  <xsl:apply-templates mode="svg_update"/>
4545
4687
  </xsl:copy>
4546
4688
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
@@ -4735,7 +4877,11 @@
4735
4877
  <xsl:apply-templates mode="bookmarks"/>
4736
4878
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4737
4879
  <xsl:apply-templates select="."/>
4738
- </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">
4880
+ </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">
4881
+ <xsl:apply-templates mode="contents"/>
4882
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4883
+ <xsl:apply-templates mode="bookmarks"/>
4884
+ </xsl:template><xsl:template match="*[local-name() = 'span']" mode="bookmarks">
4739
4885
  <xsl:apply-templates mode="bookmarks"/>
4740
4886
  </xsl:template><xsl:template name="addBookmarks">
4741
4887
  <xsl:param name="contents"/>
@@ -5017,7 +5163,9 @@
5017
5163
  <xsl:apply-templates/>
5018
5164
  </xsl:otherwise>
5019
5165
  </xsl:choose>
5020
- </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">
5166
+ </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">
5167
+ <xsl:value-of select="."/>
5168
+ </xsl:template><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
5021
5169
  <xsl:text> </xsl:text>
5022
5170
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
5023
5171
  <xsl:copy>
@@ -5048,9 +5196,22 @@
5048
5196
  </xsl:when>
5049
5197
  <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise>
5050
5198
  </xsl:choose>
5199
+ </xsl:template><xsl:template match="text()" mode="contents_item">
5200
+ <xsl:call-template name="keep_together_standard_number"/>
5201
+ </xsl:template><xsl:template match="*[local-name() = 'span']" mode="contents_item">
5202
+ <xsl:apply-templates mode="contents_item"/>
5051
5203
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
5052
5204
 
5053
5205
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
5206
+
5207
+ <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
5208
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
5209
+ </xsl:if>
5210
+
5211
+ <xsl:if test="ancestor::*[local-name() = 'example']">
5212
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
5213
+ </xsl:if>
5214
+
5054
5215
  <xsl:copy-of select="@id"/>
5055
5216
 
5056
5217
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -5150,17 +5311,15 @@
5150
5311
 
5151
5312
  <!-- split text by zero-width space -->
5152
5313
  <xsl:variable name="text_step4">
5153
- <xsl:call-template name="split">
5314
+ <xsl:call-template name="split_for_interspers">
5154
5315
  <xsl:with-param name="pText" select="$text_step3"/>
5155
5316
  <xsl:with-param name="sep" select="$zero_width_space"/>
5156
- <xsl:with-param name="normalize-space">false</xsl:with-param>
5157
- <xsl:with-param name="keep_sep">true</xsl:with-param>
5158
5317
  </xsl:call-template>
5159
5318
  </xsl:variable>
5160
5319
 
5161
- <xsl:for-each select="xalan:nodeset($text_step4)/item">
5320
+ <xsl:for-each select="xalan:nodeset($text_step4)/node()">
5162
5321
  <xsl:choose>
5163
- <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5322
+ <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5164
5323
  <xsl:call-template name="interspers">
5165
5324
  <xsl:with-param name="str" select="."/>
5166
5325
  </xsl:call-template>
@@ -5171,6 +5330,30 @@
5171
5330
  </xsl:choose>
5172
5331
  </xsl:for-each>
5173
5332
 
5333
+ </xsl:template><xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable><xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable><xsl:template name="split_for_interspers">
5334
+ <xsl:param name="pText" select="."/>
5335
+ <xsl:param name="sep" select="','"/>
5336
+ <!-- word with length more than 30 will be interspersed with zero-width space -->
5337
+ <xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
5338
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
5339
+ <xsl:call-template name="replace_tag_interspers">
5340
+ <xsl:with-param name="text" select="$text"/>
5341
+ </xsl:call-template>
5342
+ </xsl:template><xsl:template name="replace_tag_interspers">
5343
+ <xsl:param name="text"/>
5344
+ <xsl:choose>
5345
+ <xsl:when test="contains($text, $interspers_tag_open)">
5346
+ <xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
5347
+ <xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
5348
+ <interspers>
5349
+ <xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
5350
+ </interspers>
5351
+ <xsl:call-template name="replace_tag_interspers">
5352
+ <xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
5353
+ </xsl:call-template>
5354
+ </xsl:when>
5355
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
5356
+ </xsl:choose>
5174
5357
  </xsl:template><xsl:template name="interspers">
5175
5358
  <xsl:param name="str"/>
5176
5359
  <xsl:param name="char" select="$zero_width_space"/>
@@ -5506,39 +5689,67 @@
5506
5689
  </xsl:otherwise>
5507
5690
  </xsl:choose>
5508
5691
  </xsl:template><xsl:template match="*[local-name() = 'example']">
5509
- <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
5510
-
5692
+
5693
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
5694
+
5511
5695
 
5696
+
5512
5697
  <xsl:variable name="fo_element">
5513
- <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
5698
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
5514
5699
  inline
5515
5700
  </xsl:variable>
5516
5701
 
5517
- <!-- display 'EXAMPLE' -->
5518
- <xsl:apply-templates select="*[local-name()='name']">
5519
- <xsl:with-param name="fo_element" select="$fo_element"/>
5520
- </xsl:apply-templates>
5702
+ <fo:block-container margin-left="0mm">
5521
5703
 
5522
- <xsl:choose>
5523
- <xsl:when test="contains(normalize-space($fo_element), 'block')">
5524
- <fo:block-container xsl:use-attribute-sets="example-body-style">
5525
- <fo:block-container margin-left="0mm" margin-right="0mm">
5526
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5704
+ <xsl:choose>
5705
+
5706
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
5707
+
5708
+ <!-- display name 'EXAMPLE' in a separate block -->
5709
+ <fo:block>
5710
+ <xsl:apply-templates select="*[local-name()='name']">
5527
5711
  <xsl:with-param name="fo_element" select="$fo_element"/>
5528
5712
  </xsl:apply-templates>
5713
+ </fo:block>
5714
+
5715
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
5716
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5717
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5718
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5719
+ </xsl:apply-templates>
5720
+ </fo:block-container>
5529
5721
  </fo:block-container>
5530
- </fo:block-container>
5531
- </xsl:when>
5532
- <xsl:otherwise>
5533
- <fo:inline>
5534
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
5535
- <xsl:with-param name="fo_element" select="$fo_element"/>
5536
- </xsl:apply-templates>
5537
- </fo:inline>
5538
- </xsl:otherwise>
5539
- </xsl:choose>
5540
-
5541
- </fo:block>
5722
+ </xsl:when> <!-- end block -->
5723
+
5724
+ <xsl:otherwise> <!-- inline -->
5725
+
5726
+ <!-- display 'EXAMPLE' and first element in the same line -->
5727
+ <fo:block>
5728
+ <xsl:apply-templates select="*[local-name()='name']">
5729
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5730
+ </xsl:apply-templates>
5731
+ <fo:inline>
5732
+ <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
5733
+ <xsl:with-param name="fo_element" select="$fo_element"/>
5734
+ </xsl:apply-templates>
5735
+ </fo:inline>
5736
+ </fo:block>
5737
+
5738
+ <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
5739
+ <!-- display further elements in blocks -->
5740
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
5741
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5742
+ <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
5743
+ <xsl:with-param name="fo_element" select="'block'"/>
5744
+ </xsl:apply-templates>
5745
+ </fo:block-container>
5746
+ </fo:block-container>
5747
+ </xsl:if>
5748
+ </xsl:otherwise> <!-- end inline -->
5749
+
5750
+ </xsl:choose>
5751
+ </fo:block-container>
5752
+ </fo:block-container>
5542
5753
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
5543
5754
  <xsl:param name="fo_element">block</xsl:param>
5544
5755
 
@@ -5570,10 +5781,16 @@
5570
5781
  </xsl:variable>
5571
5782
  <xsl:choose>
5572
5783
  <xsl:when test="starts-with(normalize-space($element), 'block')">
5573
- <fo:block xsl:use-attribute-sets="example-p-style">
5574
-
5575
- <xsl:apply-templates/>
5576
- </fo:block>
5784
+ <fo:block-container>
5785
+ <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
5786
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
5787
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
5788
+ </xsl:if>
5789
+ <fo:block xsl:use-attribute-sets="example-p-style">
5790
+
5791
+ <xsl:apply-templates/>
5792
+ </fo:block>
5793
+ </fo:block-container>
5577
5794
  </xsl:when>
5578
5795
  <xsl:otherwise>
5579
5796
  <fo:inline xsl:use-attribute-sets="example-p-style">
@@ -5618,7 +5835,7 @@
5618
5835
  </xsl:otherwise>
5619
5836
  </xsl:choose> -->
5620
5837
  </fo:block>
5621
- </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
5838
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
5622
5839
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
5623
5840
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
5624
5841
  <xsl:if test="normalize-space() != ''">
@@ -5654,7 +5871,8 @@
5654
5871
  <fo:inline><xsl:apply-templates/></fo:inline>
5655
5872
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
5656
5873
  <xsl:if test="normalize-space() != ''">
5657
- <xsl:value-of select="."/>
5874
+ <!-- <xsl:value-of select="."/> -->
5875
+ <xsl:call-template name="text"/>
5658
5876
  </xsl:if>
5659
5877
  </xsl:template><xsl:template match="*[local-name() = 'quote']">
5660
5878
  <fo:block-container margin-left="0mm">
@@ -5753,7 +5971,16 @@
5753
5971
  </fo:inline>
5754
5972
  </xsl:when>
5755
5973
  <xsl:otherwise> <!-- if there is key('bibitems_hidden', $current_bibitemid) -->
5756
- <fo:inline><xsl:apply-templates/></fo:inline>
5974
+
5975
+ <!-- if in bibitem[@hidden='true'] there is url[@type='src'], then create hyperlink -->
5976
+ <xsl:variable name="uri_src" select="normalize-space($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'src'])"/>
5977
+ <xsl:choose>
5978
+ <xsl:when test="$uri_src != ''">
5979
+ <fo:basic-link external-destination="{$uri_src}" fox:alt-text="{$uri_src}"><xsl:apply-templates/></fo:basic-link>
5980
+ </xsl:when>
5981
+ <xsl:otherwise><fo:inline><xsl:apply-templates/></fo:inline></xsl:otherwise>
5982
+ </xsl:choose>
5983
+
5757
5984
  </xsl:otherwise>
5758
5985
  </xsl:choose>
5759
5986
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
@@ -5934,10 +6161,24 @@
5934
6161
 
5935
6162
  </fo:block>
5936
6163
  <xsl:apply-templates/>
5937
- </xsl:template><xsl:template match="*[local-name() = 'review']">
6164
+ </xsl:template><xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
5938
6165
  <!-- comment 2019-11-29 -->
5939
6166
  <!-- <fo:block font-weight="bold">Review:</fo:block>
5940
6167
  <xsl:apply-templates /> -->
6168
+
6169
+ <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
6170
+
6171
+ <xsl:choose>
6172
+ <!-- if there isn't the attribute '@from', then -->
6173
+ <xsl:when test="$id_from = ''">
6174
+ <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
6175
+ </xsl:when>
6176
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
6177
+ <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
6178
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
6179
+ </xsl:when>
6180
+ </xsl:choose>
6181
+
5941
6182
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
5942
6183
  <!-- 0xA0 to space replacement -->
5943
6184
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -6298,7 +6539,10 @@
6298
6539
  <!-- to split by '_' and other chars -->
6299
6540
  <xsl:call-template name="add-zero-spaces-java"/>
6300
6541
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
6301
- <fo:inline id="{@id}" font-size="1pt"/>
6542
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
6543
+ <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
6544
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
6545
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"> </xsl:if>
6302
6546
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
6303
6547
  <!-- <row>
6304
6548
  <date>05-07-2013</date>
@@ -6845,6 +7089,120 @@
6845
7089
  <xsl:apply-templates select="." mode="update_xml_step1"/>
6846
7090
  </xsl:for-each>
6847
7091
  </xsl:copy>
7092
+ </xsl:template><xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
7093
+ <xsl:apply-templates mode="update_xml_step1"/>
7094
+ </xsl:template><xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
7095
+ <xsl:copy>
7096
+ <xsl:apply-templates select="@*|node()" mode="update_xml_enclose_keep-together_within-line"/>
7097
+ </xsl:copy>
7098
+ </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">
7099
+
7100
+ <!-- enclose standard's number into tag 'keep-together_within-line' -->
7101
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
7102
+ <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
7103
+ <xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
7104
+ <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))"/>
7105
+ <xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
7106
+ <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
7107
+ <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
7108
+ <xsl:with-param name="text" select="$text_"/>
7109
+ </xsl:call-template></text></xsl:variable>
7110
+
7111
+ <xsl:variable name="parent" select="local-name(..)"/>
7112
+
7113
+ <xsl:variable name="text2">
7114
+ <text><xsl:for-each select="xalan:nodeset($text)/text/node()">
7115
+ <xsl:copy-of select="."/>
7116
+ </xsl:for-each></text>
7117
+ </xsl:variable>
7118
+
7119
+ <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
7120
+ <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable>
7121
+ <xsl:variable name="text3">
7122
+ <text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
7123
+ <xsl:choose>
7124
+ <xsl:when test="self::text()">
7125
+ <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))"/>
7126
+ <xsl:variable name="text_units"><text><xsl:call-template name="replace_text_tags">
7127
+ <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
7128
+ <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
7129
+ <xsl:with-param name="text" select="$text_units_"/>
7130
+ </xsl:call-template></text></xsl:variable>
7131
+ <xsl:copy-of select="xalan:nodeset($text_units)/text/node()"/>
7132
+ </xsl:when>
7133
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
7134
+ </xsl:choose>
7135
+ </xsl:for-each></text>
7136
+ </xsl:variable>
7137
+
7138
+ <xsl:choose>
7139
+ <xsl:when test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
7140
+ <!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
7141
+ <xsl:variable name="regex_dots_units">((\b((\S{1,3}\.\S+)|(\S+\.\S{1,3}))\b)|(\.\S{1,3})\b)</xsl:variable>
7142
+ <xsl:for-each select="xalan:nodeset($text3)/text/node()">
7143
+ <xsl:choose>
7144
+ <xsl:when test="self::text()">
7145
+ <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))"/>
7146
+ <xsl:variable name="text_dots"><text><xsl:call-template name="replace_text_tags">
7147
+ <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
7148
+ <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
7149
+ <xsl:with-param name="text" select="$text_dots_"/>
7150
+ </xsl:call-template></text></xsl:variable>
7151
+ <xsl:copy-of select="xalan:nodeset($text_dots)/text/node()"/>
7152
+ </xsl:when>
7153
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
7154
+ </xsl:choose>
7155
+ </xsl:for-each>
7156
+ </xsl:when>
7157
+ <xsl:otherwise><xsl:copy-of select="xalan:nodeset($text3)/text/node()"/></xsl:otherwise>
7158
+ </xsl:choose>
7159
+
7160
+ </xsl:template><xsl:template name="replace_text_tags">
7161
+ <xsl:param name="tag_open"/>
7162
+ <xsl:param name="tag_close"/>
7163
+ <xsl:param name="text"/>
7164
+ <xsl:choose>
7165
+ <xsl:when test="contains($text, $tag_open)">
7166
+ <xsl:value-of select="substring-before($text, $tag_open)"/>
7167
+ <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
7168
+
7169
+ <xsl:element name="{substring-before(substring-after($tag_open, '###'),'###')}">
7170
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
7171
+ </xsl:element>
7172
+
7173
+ <xsl:call-template name="replace_text_tags">
7174
+ <xsl:with-param name="tag_open" select="$tag_open"/>
7175
+ <xsl:with-param name="tag_close" select="$tag_close"/>
7176
+ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
7177
+ </xsl:call-template>
7178
+ </xsl:when>
7179
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
7180
+ </xsl:choose>
7181
+ </xsl:template><xsl:template name="printEdition">
7182
+ <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
7183
+ <xsl:text> </xsl:text>
7184
+ <xsl:choose>
7185
+ <xsl:when test="$edition_i18n != ''">
7186
+ <!-- Example: <edition language="fr">deuxième édition</edition> -->
7187
+ <xsl:call-template name="capitalize">
7188
+ <xsl:with-param name="str" select="$edition_i18n"/>
7189
+ </xsl:call-template>
7190
+ </xsl:when>
7191
+ <xsl:otherwise>
7192
+ <xsl:variable name="edition" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
7193
+ <xsl:if test="$edition != ''"> <!-- Example: 1.3 -->
7194
+ <xsl:call-template name="capitalize">
7195
+ <xsl:with-param name="str">
7196
+ <xsl:call-template name="getLocalizedString">
7197
+ <xsl:with-param name="key">edition</xsl:with-param>
7198
+ </xsl:call-template>
7199
+ </xsl:with-param>
7200
+ </xsl:call-template>
7201
+ <xsl:text> </xsl:text>
7202
+ <xsl:value-of select="$edition"/>
7203
+ </xsl:if>
7204
+ </xsl:otherwise>
7205
+ </xsl:choose>
6848
7206
  </xsl:template><xsl:template name="convertDate">
6849
7207
  <xsl:param name="date"/>
6850
7208
  <xsl:param name="format" select="'short'"/>