metanorma-ogc 2.6.8 → 2.6.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -665,7 +665,7 @@
665
665
 
666
666
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
667
667
 
668
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//image or .//svg]">
668
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
669
669
  <!-- Copyright, Content, Foreword, etc. pages -->
670
670
  <fo:page-sequence master-reference="document" format="i" force-page-count="no-force">
671
671
 
@@ -727,7 +727,7 @@
727
727
 
728
728
  </xsl:for-each>
729
729
 
730
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'] or parent::*[local-name() = 'boilerplate'])][normalize-space() != '' or .//image or .//svg]">
730
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'] or parent::*[local-name() = 'boilerplate'])][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
731
731
 
732
732
  <!-- Document Pages -->
733
733
  <!-- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
@@ -5400,7 +5400,9 @@
5400
5400
  <fo:block role="SKIP">
5401
5401
 
5402
5402
  <xsl:if test="$isGenerateTableIF = 'true'">
5403
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5403
+
5404
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5405
+
5404
5406
  </xsl:if>
5405
5407
 
5406
5408
  <xsl:apply-templates/>
@@ -6437,7 +6439,17 @@
6437
6439
  <xsl:call-template name="refine_dt-cell-style"/>
6438
6440
 
6439
6441
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
6440
- <xsl:copy-of select="@id"/>
6442
+
6443
+ <xsl:choose>
6444
+ <xsl:when test="$isGenerateTableIF = 'true'">
6445
+
6446
+ <xsl:copy-of select="@id"/>
6447
+
6448
+ </xsl:when>
6449
+ <xsl:otherwise>
6450
+ <xsl:copy-of select="@id"/>
6451
+ </xsl:otherwise>
6452
+ </xsl:choose>
6441
6453
 
6442
6454
  <xsl:if test="normalize-space($key_iso) = 'true'">
6443
6455
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -6469,7 +6481,9 @@
6469
6481
  <fo:block role="SKIP">
6470
6482
 
6471
6483
  <xsl:if test="$isGenerateTableIF = 'true'">
6472
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
6484
+
6485
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
6486
+
6473
6487
  </xsl:if>
6474
6488
 
6475
6489
  <xsl:choose>
@@ -7712,6 +7726,14 @@
7712
7726
  </xsl:for-each>
7713
7727
  </xsl:variable>
7714
7728
 
7729
+ <!-- <xsl:if test="$debug = 'true'">
7730
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
7731
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
7732
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
7733
+ <xsl:copy-of select="$words_with_width_sorted"/>
7734
+ </redirect:write>
7735
+ </xsl:if> -->
7736
+
7715
7737
  <xsl:variable name="words">
7716
7738
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
7717
7739
  <word>
@@ -7837,6 +7859,7 @@
7837
7859
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
7838
7860
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
7839
7861
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
7862
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
7840
7863
  </tags>
7841
7864
  </xsl:template>
7842
7865
  <!-- =============================== -->
@@ -8377,7 +8400,16 @@
8377
8400
  </xsl:when>
8378
8401
  <xsl:otherwise>
8379
8402
  <!-- output text from <link>text</link> -->
8380
- <xsl:apply-templates/>
8403
+ <xsl:choose>
8404
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
8405
+ <xsl:call-template name="add-zero-spaces-link-java">
8406
+ <xsl:with-param name="text" select="."/>
8407
+ </xsl:call-template>
8408
+ </xsl:when>
8409
+ <xsl:otherwise>
8410
+ <xsl:apply-templates/>
8411
+ </xsl:otherwise>
8412
+ </xsl:choose>
8381
8413
  </xsl:otherwise>
8382
8414
  </xsl:choose>
8383
8415
  </fo:basic-link>
@@ -9022,16 +9054,29 @@
9022
9054
  <xsl:template name="getImageSrc">
9023
9055
  <xsl:choose>
9024
9056
  <xsl:when test="not(starts-with(@src, 'data:'))">
9057
+ <xsl:call-template name="getImageSrcExternal"/>
9058
+ </xsl:when>
9059
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
9060
+ </xsl:choose>
9061
+ </xsl:template>
9062
+
9063
+ <xsl:template name="getImageSrcExternal">
9064
+ <xsl:choose>
9065
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
9066
+ <xsl:value-of select="@src"/>
9067
+ </xsl:when>
9068
+ <xsl:otherwise>
9069
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
9070
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
9025
9071
  <xsl:choose>
9026
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
9027
- <xsl:value-of select="@src"/>
9072
+ <xsl:when test="$file_exists = 'true'">
9073
+ <xsl:value-of select="$src_with_basepath"/>
9028
9074
  </xsl:when>
9029
9075
  <xsl:otherwise>
9030
- <xsl:value-of select="concat($basepath, @src)"/>
9076
+ <xsl:value-of select="@src"/>
9031
9077
  </xsl:otherwise>
9032
9078
  </xsl:choose>
9033
- </xsl:when>
9034
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
9079
+ </xsl:otherwise>
9035
9080
  </xsl:choose>
9036
9081
  </xsl:template>
9037
9082
 
@@ -9079,14 +9124,8 @@
9079
9124
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
9080
9125
  </xsl:when>
9081
9126
  <xsl:when test="not(starts-with(@src, 'data:'))">
9082
- <xsl:choose>
9083
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
9084
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
9085
- </xsl:when>
9086
- <xsl:otherwise>
9087
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
9088
- </xsl:otherwise>
9089
- </xsl:choose>
9127
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
9128
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
9090
9129
  </xsl:when>
9091
9130
  <xsl:otherwise>
9092
9131
  <xsl:value-of select="@src"/>
@@ -9107,16 +9146,8 @@
9107
9146
  </svg>
9108
9147
  </xsl:when>
9109
9148
  <xsl:when test="not(starts-with(@src, 'data:'))">
9110
- <xsl:variable name="src">
9111
- <xsl:choose>
9112
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
9113
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
9114
- </xsl:when>
9115
- <xsl:otherwise>
9116
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
9117
- </xsl:otherwise>
9118
- </xsl:choose>
9119
- </xsl:variable>
9149
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
9150
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
9120
9151
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
9121
9152
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
9122
9153
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -13234,7 +13265,9 @@
13234
13265
  <xsl:template name="add_id">
13235
13266
  <xsl:if test="not(@id)">
13236
13267
  <!-- add @id - first element with @id plus '_element_name' -->
13237
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
13268
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
13269
+ <xsl:variable name="prefix_id"><xsl:value-of select="$prefix_id_"/><xsl:if test="normalize-space($prefix_id_) = ''"><xsl:value-of select="generate-id()"/></xsl:if></xsl:variable>
13270
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
13238
13271
  </xsl:if>
13239
13272
  </xsl:template>
13240
13273
 
@@ -14539,6 +14572,7 @@
14539
14572
  <xsl:param name="formatted">false</xsl:param>
14540
14573
  <xsl:param name="lang"/>
14541
14574
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
14575
+ <xsl:param name="bibdata_updated"/>
14542
14576
 
14543
14577
  <xsl:variable name="curr_lang">
14544
14578
  <xsl:choose>
@@ -14552,6 +14586,9 @@
14552
14586
 
14553
14587
  <xsl:variable name="data_value">
14554
14588
  <xsl:choose>
14589
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
14590
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14591
+ </xsl:when>
14555
14592
  <xsl:when test="$formatted = 'true'">
14556
14593
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14557
14594
  </xsl:when>
@@ -14723,14 +14760,8 @@
14723
14760
  <xsl:value-of select="$src"/>
14724
14761
  </xsl:when>
14725
14762
  <xsl:otherwise>
14726
- <xsl:choose>
14727
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
14728
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
14729
- </xsl:when>
14730
- <xsl:otherwise>
14731
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
14732
- </xsl:otherwise>
14733
- </xsl:choose>
14763
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
14764
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
14734
14765
  </xsl:otherwise>
14735
14766
  </xsl:choose>
14736
14767
  </xsl:template>
@@ -14752,15 +14783,23 @@
14752
14783
  <!-- END: insert cover page image -->
14753
14784
 
14754
14785
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
14786
+ <xsl:variable name="regex_ja_spec_half_width_">
14787
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
14788
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
14789
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
14790
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
14791
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
14792
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
14793
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
14794
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
14795
+ </xsl:variable>
14796
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
14755
14797
  <xsl:variable name="regex_ja_spec_">[
14756
14798
  <!-- Rotate 90° clockwise -->
14757
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
14799
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
14758
14800
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
14759
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
14760
14801
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
14761
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
14762
14802
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
14763
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
14764
14803
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
14765
14804
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
14766
14805
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -14768,21 +14807,16 @@
14768
14807
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
14769
14808
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
14770
14809
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
14771
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
14772
14810
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
14773
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
14774
14811
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
14775
14812
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
14776
14813
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
14777
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
14778
14814
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
14779
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
14780
14815
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
14781
14816
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
14782
14817
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
14783
14818
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
14784
14819
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
14785
-
14786
14820
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
14787
14821
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
14788
14822
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -14814,6 +14848,7 @@
14814
14848
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
14815
14849
  <xsl:template name="insertVerticalChar">
14816
14850
  <xsl:param name="str"/>
14851
+ <xsl:param name="char_prev"/>
14817
14852
  <xsl:param name="writing-mode">lr-tb</xsl:param>
14818
14853
  <xsl:param name="reference-orientation">90</xsl:param>
14819
14854
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -14823,53 +14858,99 @@
14823
14858
  </xsl:when>
14824
14859
  <xsl:otherwise>
14825
14860
  <xsl:if test="string-length($str) &gt; 0">
14826
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
14861
+
14862
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
14827
14863
  <xsl:variable name="char" select="substring($str,1,1)"/>
14828
- <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14829
- <xsl:if test="normalize-space($writing-mode) != ''">
14830
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
14831
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
14832
- </xsl:if>
14833
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
14834
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
14835
- </xsl:if>
14836
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
14837
- <!-- Rotate 180°:
14838
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
14839
- U+3002 IDEOGRAPHIC FULL STOP (。)
14840
- U+FE52 SMALL FULL STOP (﹒)
14841
- U+FF0E FULLWIDTH FULL STOP ()
14842
- -->
14843
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
14844
- </xsl:if>
14845
- <fo:block-container width="1em">
14846
- <fo:block line-height="1em">
14847
- <xsl:choose>
14848
- <xsl:when test="$horizontal_mode = 'true'">
14849
- <xsl:value-of select="$str"/>
14850
- </xsl:when>
14851
- <xsl:otherwise>
14864
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
14865
+
14866
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
14867
+
14868
+ <xsl:choose>
14869
+ <xsl:when test="$char_half_width = 'true'">
14870
+ <fo:inline>
14871
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
14872
+ <xsl:value-of select="$char"/>
14873
+ </fo:inline>
14874
+ </xsl:when>
14875
+ <xsl:otherwise>
14876
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
14877
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
14878
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
14879
+ </xsl:if>
14880
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm" role="SKIP" text-align-last="center">
14881
+ <xsl:if test="normalize-space($writing-mode) != ''">
14882
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
14883
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
14884
+ </xsl:if>
14885
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
14886
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
14887
+ </xsl:if>
14888
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
14889
+ <!-- Rotate 180°:
14890
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
14891
+ U+3002 IDEOGRAPHIC FULL STOP (。)
14892
+ U+FE52 SMALL FULL STOP (﹒)
14893
+ U+FF0E FULLWIDTH FULL STOP (.)
14894
+ -->
14895
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
14896
+ </xsl:if>
14897
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
14898
+ <fo:block line-height="1em" role="SKIP">
14899
+ <!-- <xsl:choose>
14900
+ <xsl:when test="$horizontal_mode = 'true'">
14901
+ <xsl:value-of select="$str"/>
14902
+ </xsl:when>
14903
+ <xsl:otherwise>
14904
+ <xsl:value-of select="$char"/>
14905
+ </xsl:otherwise>
14906
+ </xsl:choose> -->
14852
14907
  <xsl:value-of select="$char"/>
14853
- </xsl:otherwise>
14854
- </xsl:choose>
14855
- </fo:block>
14856
- </fo:block-container>
14857
- </fo:inline-container>
14858
- <xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}')"><xsl:value-of select="$zero_width_space"/></xsl:if>
14859
-
14860
- <xsl:if test="$horizontal_mode = 'false'">
14861
- <xsl:call-template name="insertVerticalChar">
14862
- <xsl:with-param name="str" select="substring($str, 2)"/>
14863
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
14864
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
14865
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
14866
- </xsl:call-template>
14867
- </xsl:if>
14908
+ </fo:block>
14909
+ </fo:block-container>
14910
+ </fo:inline-container>
14911
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
14912
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
14913
+ </xsl:if>
14914
+ </xsl:otherwise>
14915
+ </xsl:choose>
14916
+
14917
+ <xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}' or $char = '/')"><xsl:value-of select="$zero_width_space"/></xsl:if>
14918
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
14919
+ <xsl:call-template name="insertVerticalChar">
14920
+ <xsl:with-param name="str" select="substring($str, 2)"/>
14921
+ <xsl:with-param name="char_prev" select="$char"/>
14922
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
14923
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
14924
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
14925
+ </xsl:call-template>
14926
+ <!-- </xsl:if> -->
14868
14927
  </xsl:if>
14869
14928
  </xsl:otherwise>
14870
14929
  </xsl:choose>
14871
14930
  </xsl:template>
14872
14931
 
14932
+ <xsl:template name="insertHorizontalChars">
14933
+ <xsl:param name="str"/>
14934
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
14935
+ <xsl:param name="reference-orientation">90</xsl:param>
14936
+ <xsl:param name="add_zero_width_space">false</xsl:param>
14937
+ <xsl:choose>
14938
+ <xsl:otherwise>
14939
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm" role="SKIP">
14940
+ <xsl:if test="normalize-space($writing-mode) != ''">
14941
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
14942
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
14943
+ </xsl:if>
14944
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
14945
+ <fo:block line-height="1em" role="SKIP">
14946
+ <xsl:value-of select="$str"/>
14947
+ </fo:block>
14948
+ </fo:block-container>
14949
+ </fo:inline-container>
14950
+ </xsl:otherwise>
14951
+ </xsl:choose>
14952
+ </xsl:template>
14953
+
14873
14954
  <xsl:template name="number-to-words">
14874
14955
  <xsl:param name="number"/>
14875
14956
  <xsl:param name="first"/>