metanorma-iho 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b56165b5e08727c7f6330a2735c03055bb1163ca9a430f9583ebe690c65b8937
4
- data.tar.gz: 5d05b8aa31ad47e8d1fe70e2a5cb0d77c115288f63082ce1e44309e2c17a2de6
3
+ metadata.gz: d7ee6cc2c4053df809afa29e68df0126fc4fe063c6e3456d77125c930d76cc1f
4
+ data.tar.gz: 1cc4d342b63022f48ee17959db4dcab0de125a72aa0d1b5bc77f285c2194f6d4
5
5
  SHA512:
6
- metadata.gz: 70708bbb275aba3a1048b3fc4a5e9b10ef320e9e69f2918bc34ff18183ea8422ad820f95a1fa382daf49712dde8f955bfbff7c095c1ad379bdaad970a45c991c
7
- data.tar.gz: 1220d214df2aae98c3d037c327b433d109379954b7a9d9a838ee8c14fdc3c118a949fa3e69c451ecc11d54767bdb48dcc979718b8e6792cb6ed98597ca28d00d
6
+ metadata.gz: dd20b9873b57c704bd78957c00486f7c7a0d21baf37fec7aedaac4ebbb11246331f01fb119fc879d994f7bf97d0e267f9e9e48d6ce426bf01cf69578406000d9
7
+ data.tar.gz: 64140a484a3e95b371e8f00163811c3160dd0bcc80395b8ae216caf870ff3b97455ac190a64a66e4fe2a151e957f26cd733f4d8bdcea3041e7970d95efe19b14
@@ -227,7 +227,7 @@
227
227
 
228
228
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
229
229
 
230
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//image or .//svg]">
230
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
231
231
 
232
232
  <!-- Preface Pages -->
233
233
  <fo:page-sequence master-reference="preface" format="i">
@@ -273,7 +273,7 @@
273
273
  <!-- =========================== -->
274
274
  </xsl:for-each>
275
275
 
276
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//image or .//svg]">
276
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
277
277
 
278
278
  <fo:page-sequence master-reference="document" format="1" force-page-count="no-force">
279
279
 
@@ -4167,7 +4167,9 @@
4167
4167
  <fo:block role="SKIP">
4168
4168
 
4169
4169
  <xsl:if test="$isGenerateTableIF = 'true'">
4170
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4170
+
4171
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4172
+
4171
4173
  </xsl:if>
4172
4174
 
4173
4175
  <xsl:apply-templates/>
@@ -5192,7 +5194,17 @@
5192
5194
  <xsl:call-template name="refine_dt-cell-style"/>
5193
5195
 
5194
5196
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
5195
- <xsl:copy-of select="@id"/>
5197
+
5198
+ <xsl:choose>
5199
+ <xsl:when test="$isGenerateTableIF = 'true'">
5200
+
5201
+ <xsl:copy-of select="@id"/>
5202
+
5203
+ </xsl:when>
5204
+ <xsl:otherwise>
5205
+ <xsl:copy-of select="@id"/>
5206
+ </xsl:otherwise>
5207
+ </xsl:choose>
5196
5208
 
5197
5209
  <xsl:if test="normalize-space($key_iso) = 'true'">
5198
5210
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -5224,7 +5236,9 @@
5224
5236
  <fo:block role="SKIP">
5225
5237
 
5226
5238
  <xsl:if test="$isGenerateTableIF = 'true'">
5227
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5239
+
5240
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5241
+
5228
5242
  </xsl:if>
5229
5243
 
5230
5244
  <xsl:choose>
@@ -6534,6 +6548,14 @@
6534
6548
  </xsl:for-each>
6535
6549
  </xsl:variable>
6536
6550
 
6551
+ <!-- <xsl:if test="$debug = 'true'">
6552
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
6553
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
6554
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
6555
+ <xsl:copy-of select="$words_with_width_sorted"/>
6556
+ </redirect:write>
6557
+ </xsl:if> -->
6558
+
6537
6559
  <xsl:variable name="words">
6538
6560
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
6539
6561
  <word>
@@ -6659,6 +6681,7 @@
6659
6681
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
6660
6682
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
6661
6683
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
6684
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
6662
6685
  </tags>
6663
6686
  </xsl:template>
6664
6687
  <!-- =============================== -->
@@ -7199,7 +7222,16 @@
7199
7222
  </xsl:when>
7200
7223
  <xsl:otherwise>
7201
7224
  <!-- output text from <link>text</link> -->
7202
- <xsl:apply-templates/>
7225
+ <xsl:choose>
7226
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
7227
+ <xsl:call-template name="add-zero-spaces-link-java">
7228
+ <xsl:with-param name="text" select="."/>
7229
+ </xsl:call-template>
7230
+ </xsl:when>
7231
+ <xsl:otherwise>
7232
+ <xsl:apply-templates/>
7233
+ </xsl:otherwise>
7234
+ </xsl:choose>
7203
7235
  </xsl:otherwise>
7204
7236
  </xsl:choose>
7205
7237
  </fo:basic-link>
@@ -7838,16 +7870,29 @@
7838
7870
  <xsl:template name="getImageSrc">
7839
7871
  <xsl:choose>
7840
7872
  <xsl:when test="not(starts-with(@src, 'data:'))">
7873
+ <xsl:call-template name="getImageSrcExternal"/>
7874
+ </xsl:when>
7875
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7876
+ </xsl:choose>
7877
+ </xsl:template>
7878
+
7879
+ <xsl:template name="getImageSrcExternal">
7880
+ <xsl:choose>
7881
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7882
+ <xsl:value-of select="@src"/>
7883
+ </xsl:when>
7884
+ <xsl:otherwise>
7885
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
7886
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
7841
7887
  <xsl:choose>
7842
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7843
- <xsl:value-of select="@src"/>
7888
+ <xsl:when test="$file_exists = 'true'">
7889
+ <xsl:value-of select="$src_with_basepath"/>
7844
7890
  </xsl:when>
7845
7891
  <xsl:otherwise>
7846
- <xsl:value-of select="concat($basepath, @src)"/>
7892
+ <xsl:value-of select="@src"/>
7847
7893
  </xsl:otherwise>
7848
7894
  </xsl:choose>
7849
- </xsl:when>
7850
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7895
+ </xsl:otherwise>
7851
7896
  </xsl:choose>
7852
7897
  </xsl:template>
7853
7898
 
@@ -7895,14 +7940,8 @@
7895
7940
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
7896
7941
  </xsl:when>
7897
7942
  <xsl:when test="not(starts-with(@src, 'data:'))">
7898
- <xsl:choose>
7899
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7900
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7901
- </xsl:when>
7902
- <xsl:otherwise>
7903
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7904
- </xsl:otherwise>
7905
- </xsl:choose>
7943
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
7944
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
7906
7945
  </xsl:when>
7907
7946
  <xsl:otherwise>
7908
7947
  <xsl:value-of select="@src"/>
@@ -7923,16 +7962,8 @@
7923
7962
  </svg>
7924
7963
  </xsl:when>
7925
7964
  <xsl:when test="not(starts-with(@src, 'data:'))">
7926
- <xsl:variable name="src">
7927
- <xsl:choose>
7928
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7929
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7930
- </xsl:when>
7931
- <xsl:otherwise>
7932
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7933
- </xsl:otherwise>
7934
- </xsl:choose>
7935
- </xsl:variable>
7965
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
7966
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
7936
7967
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7937
7968
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
7938
7969
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -12049,7 +12080,9 @@
12049
12080
  <xsl:template name="add_id">
12050
12081
  <xsl:if test="not(@id)">
12051
12082
  <!-- add @id - first element with @id plus '_element_name' -->
12052
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
12083
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
12084
+ <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>
12085
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
12053
12086
  </xsl:if>
12054
12087
  </xsl:template>
12055
12088
 
@@ -13354,6 +13387,7 @@
13354
13387
  <xsl:param name="formatted">false</xsl:param>
13355
13388
  <xsl:param name="lang"/>
13356
13389
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
13390
+ <xsl:param name="bibdata_updated"/>
13357
13391
 
13358
13392
  <xsl:variable name="curr_lang">
13359
13393
  <xsl:choose>
@@ -13367,6 +13401,9 @@
13367
13401
 
13368
13402
  <xsl:variable name="data_value">
13369
13403
  <xsl:choose>
13404
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
13405
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
13406
+ </xsl:when>
13370
13407
  <xsl:when test="$formatted = 'true'">
13371
13408
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
13372
13409
  </xsl:when>
@@ -13538,14 +13575,8 @@
13538
13575
  <xsl:value-of select="$src"/>
13539
13576
  </xsl:when>
13540
13577
  <xsl:otherwise>
13541
- <xsl:choose>
13542
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
13543
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
13544
- </xsl:when>
13545
- <xsl:otherwise>
13546
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13547
- </xsl:otherwise>
13548
- </xsl:choose>
13578
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
13579
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
13549
13580
  </xsl:otherwise>
13550
13581
  </xsl:choose>
13551
13582
  </xsl:template>
@@ -13567,15 +13598,23 @@
13567
13598
  <!-- END: insert cover page image -->
13568
13599
 
13569
13600
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
13601
+ <xsl:variable name="regex_ja_spec_half_width_">
13602
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
13603
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
13604
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
13605
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
13606
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
13607
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
13608
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
13609
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
13610
+ </xsl:variable>
13611
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
13570
13612
  <xsl:variable name="regex_ja_spec_">[
13571
13613
  <!-- Rotate 90° clockwise -->
13572
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
13614
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
13573
13615
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
13574
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
13575
13616
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
13576
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
13577
13617
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
13578
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
13579
13618
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
13580
13619
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
13581
13620
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -13583,21 +13622,16 @@
13583
13622
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
13584
13623
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
13585
13624
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
13586
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
13587
13625
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
13588
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
13589
13626
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
13590
13627
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
13591
13628
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
13592
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
13593
13629
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
13594
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
13595
13630
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
13596
13631
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
13597
13632
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
13598
13633
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
13599
13634
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
13600
-
13601
13635
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
13602
13636
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
13603
13637
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -13629,6 +13663,7 @@
13629
13663
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
13630
13664
  <xsl:template name="insertVerticalChar">
13631
13665
  <xsl:param name="str"/>
13666
+ <xsl:param name="char_prev"/>
13632
13667
  <xsl:param name="writing-mode">lr-tb</xsl:param>
13633
13668
  <xsl:param name="reference-orientation">90</xsl:param>
13634
13669
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -13638,53 +13673,99 @@
13638
13673
  </xsl:when>
13639
13674
  <xsl:otherwise>
13640
13675
  <xsl:if test="string-length($str) &gt; 0">
13641
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
13676
+
13677
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
13642
13678
  <xsl:variable name="char" select="substring($str,1,1)"/>
13643
- <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">
13644
- <xsl:if test="normalize-space($writing-mode) != ''">
13645
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13646
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
13647
- </xsl:if>
13648
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13649
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
13650
- </xsl:if>
13651
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
13652
- <!-- Rotate 180°:
13653
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
13654
- U+3002 IDEOGRAPHIC FULL STOP (。)
13655
- U+FE52 SMALL FULL STOP (﹒)
13656
- U+FF0E FULLWIDTH FULL STOP ()
13657
- -->
13658
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
13659
- </xsl:if>
13660
- <fo:block-container width="1em">
13661
- <fo:block line-height="1em">
13662
- <xsl:choose>
13663
- <xsl:when test="$horizontal_mode = 'true'">
13664
- <xsl:value-of select="$str"/>
13665
- </xsl:when>
13666
- <xsl:otherwise>
13679
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
13680
+
13681
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
13682
+
13683
+ <xsl:choose>
13684
+ <xsl:when test="$char_half_width = 'true'">
13685
+ <fo:inline>
13686
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
13687
+ <xsl:value-of select="$char"/>
13688
+ </fo:inline>
13689
+ </xsl:when>
13690
+ <xsl:otherwise>
13691
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
13692
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
13693
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
13694
+ </xsl:if>
13695
+ <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">
13696
+ <xsl:if test="normalize-space($writing-mode) != ''">
13697
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13698
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13699
+ </xsl:if>
13700
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13701
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
13702
+ </xsl:if>
13703
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
13704
+ <!-- Rotate 180°:
13705
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
13706
+ U+3002 IDEOGRAPHIC FULL STOP (。)
13707
+ U+FE52 SMALL FULL STOP (﹒)
13708
+ U+FF0E FULLWIDTH FULL STOP (.)
13709
+ -->
13710
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
13711
+ </xsl:if>
13712
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
13713
+ <fo:block line-height="1em" role="SKIP">
13714
+ <!-- <xsl:choose>
13715
+ <xsl:when test="$horizontal_mode = 'true'">
13716
+ <xsl:value-of select="$str"/>
13717
+ </xsl:when>
13718
+ <xsl:otherwise>
13719
+ <xsl:value-of select="$char"/>
13720
+ </xsl:otherwise>
13721
+ </xsl:choose> -->
13667
13722
  <xsl:value-of select="$char"/>
13668
- </xsl:otherwise>
13669
- </xsl:choose>
13670
- </fo:block>
13671
- </fo:block-container>
13672
- </fo:inline-container>
13673
- <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>
13674
-
13675
- <xsl:if test="$horizontal_mode = 'false'">
13676
- <xsl:call-template name="insertVerticalChar">
13677
- <xsl:with-param name="str" select="substring($str, 2)"/>
13678
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
13679
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13680
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
13681
- </xsl:call-template>
13682
- </xsl:if>
13723
+ </fo:block>
13724
+ </fo:block-container>
13725
+ </fo:inline-container>
13726
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
13727
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
13728
+ </xsl:if>
13729
+ </xsl:otherwise>
13730
+ </xsl:choose>
13731
+
13732
+ <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>
13733
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
13734
+ <xsl:call-template name="insertVerticalChar">
13735
+ <xsl:with-param name="str" select="substring($str, 2)"/>
13736
+ <xsl:with-param name="char_prev" select="$char"/>
13737
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
13738
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13739
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
13740
+ </xsl:call-template>
13741
+ <!-- </xsl:if> -->
13683
13742
  </xsl:if>
13684
13743
  </xsl:otherwise>
13685
13744
  </xsl:choose>
13686
13745
  </xsl:template>
13687
13746
 
13747
+ <xsl:template name="insertHorizontalChars">
13748
+ <xsl:param name="str"/>
13749
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
13750
+ <xsl:param name="reference-orientation">90</xsl:param>
13751
+ <xsl:param name="add_zero_width_space">false</xsl:param>
13752
+ <xsl:choose>
13753
+ <xsl:otherwise>
13754
+ <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">
13755
+ <xsl:if test="normalize-space($writing-mode) != ''">
13756
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13757
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13758
+ </xsl:if>
13759
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
13760
+ <fo:block line-height="1em" role="SKIP">
13761
+ <xsl:value-of select="$str"/>
13762
+ </fo:block>
13763
+ </fo:block-container>
13764
+ </fo:inline-container>
13765
+ </xsl:otherwise>
13766
+ </xsl:choose>
13767
+ </xsl:template>
13768
+
13688
13769
  <xsl:template name="number-to-words">
13689
13770
  <xsl:param name="number"/>
13690
13771
  <xsl:param name="first"/>
@@ -227,7 +227,7 @@
227
227
 
228
228
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
229
229
 
230
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//image or .//svg]">
230
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
231
231
 
232
232
  <!-- Preface Pages -->
233
233
  <fo:page-sequence master-reference="preface" format="i">
@@ -273,7 +273,7 @@
273
273
  <!-- =========================== -->
274
274
  </xsl:for-each>
275
275
 
276
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//image or .//svg]">
276
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
277
277
 
278
278
  <fo:page-sequence master-reference="document" format="1" force-page-count="no-force">
279
279
 
@@ -4167,7 +4167,9 @@
4167
4167
  <fo:block role="SKIP">
4168
4168
 
4169
4169
  <xsl:if test="$isGenerateTableIF = 'true'">
4170
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4170
+
4171
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4172
+
4171
4173
  </xsl:if>
4172
4174
 
4173
4175
  <xsl:apply-templates/>
@@ -5192,7 +5194,17 @@
5192
5194
  <xsl:call-template name="refine_dt-cell-style"/>
5193
5195
 
5194
5196
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
5195
- <xsl:copy-of select="@id"/>
5197
+
5198
+ <xsl:choose>
5199
+ <xsl:when test="$isGenerateTableIF = 'true'">
5200
+
5201
+ <xsl:copy-of select="@id"/>
5202
+
5203
+ </xsl:when>
5204
+ <xsl:otherwise>
5205
+ <xsl:copy-of select="@id"/>
5206
+ </xsl:otherwise>
5207
+ </xsl:choose>
5196
5208
 
5197
5209
  <xsl:if test="normalize-space($key_iso) = 'true'">
5198
5210
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -5224,7 +5236,9 @@
5224
5236
  <fo:block role="SKIP">
5225
5237
 
5226
5238
  <xsl:if test="$isGenerateTableIF = 'true'">
5227
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5239
+
5240
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5241
+
5228
5242
  </xsl:if>
5229
5243
 
5230
5244
  <xsl:choose>
@@ -6534,6 +6548,14 @@
6534
6548
  </xsl:for-each>
6535
6549
  </xsl:variable>
6536
6550
 
6551
+ <!-- <xsl:if test="$debug = 'true'">
6552
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
6553
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
6554
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
6555
+ <xsl:copy-of select="$words_with_width_sorted"/>
6556
+ </redirect:write>
6557
+ </xsl:if> -->
6558
+
6537
6559
  <xsl:variable name="words">
6538
6560
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
6539
6561
  <word>
@@ -6659,6 +6681,7 @@
6659
6681
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
6660
6682
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
6661
6683
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
6684
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
6662
6685
  </tags>
6663
6686
  </xsl:template>
6664
6687
  <!-- =============================== -->
@@ -7199,7 +7222,16 @@
7199
7222
  </xsl:when>
7200
7223
  <xsl:otherwise>
7201
7224
  <!-- output text from <link>text</link> -->
7202
- <xsl:apply-templates/>
7225
+ <xsl:choose>
7226
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
7227
+ <xsl:call-template name="add-zero-spaces-link-java">
7228
+ <xsl:with-param name="text" select="."/>
7229
+ </xsl:call-template>
7230
+ </xsl:when>
7231
+ <xsl:otherwise>
7232
+ <xsl:apply-templates/>
7233
+ </xsl:otherwise>
7234
+ </xsl:choose>
7203
7235
  </xsl:otherwise>
7204
7236
  </xsl:choose>
7205
7237
  </fo:basic-link>
@@ -7838,16 +7870,29 @@
7838
7870
  <xsl:template name="getImageSrc">
7839
7871
  <xsl:choose>
7840
7872
  <xsl:when test="not(starts-with(@src, 'data:'))">
7873
+ <xsl:call-template name="getImageSrcExternal"/>
7874
+ </xsl:when>
7875
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7876
+ </xsl:choose>
7877
+ </xsl:template>
7878
+
7879
+ <xsl:template name="getImageSrcExternal">
7880
+ <xsl:choose>
7881
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7882
+ <xsl:value-of select="@src"/>
7883
+ </xsl:when>
7884
+ <xsl:otherwise>
7885
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
7886
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
7841
7887
  <xsl:choose>
7842
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7843
- <xsl:value-of select="@src"/>
7888
+ <xsl:when test="$file_exists = 'true'">
7889
+ <xsl:value-of select="$src_with_basepath"/>
7844
7890
  </xsl:when>
7845
7891
  <xsl:otherwise>
7846
- <xsl:value-of select="concat($basepath, @src)"/>
7892
+ <xsl:value-of select="@src"/>
7847
7893
  </xsl:otherwise>
7848
7894
  </xsl:choose>
7849
- </xsl:when>
7850
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7895
+ </xsl:otherwise>
7851
7896
  </xsl:choose>
7852
7897
  </xsl:template>
7853
7898
 
@@ -7895,14 +7940,8 @@
7895
7940
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
7896
7941
  </xsl:when>
7897
7942
  <xsl:when test="not(starts-with(@src, 'data:'))">
7898
- <xsl:choose>
7899
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7900
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7901
- </xsl:when>
7902
- <xsl:otherwise>
7903
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7904
- </xsl:otherwise>
7905
- </xsl:choose>
7943
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
7944
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
7906
7945
  </xsl:when>
7907
7946
  <xsl:otherwise>
7908
7947
  <xsl:value-of select="@src"/>
@@ -7923,16 +7962,8 @@
7923
7962
  </svg>
7924
7963
  </xsl:when>
7925
7964
  <xsl:when test="not(starts-with(@src, 'data:'))">
7926
- <xsl:variable name="src">
7927
- <xsl:choose>
7928
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7929
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7930
- </xsl:when>
7931
- <xsl:otherwise>
7932
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7933
- </xsl:otherwise>
7934
- </xsl:choose>
7935
- </xsl:variable>
7965
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
7966
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
7936
7967
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7937
7968
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
7938
7969
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -12049,7 +12080,9 @@
12049
12080
  <xsl:template name="add_id">
12050
12081
  <xsl:if test="not(@id)">
12051
12082
  <!-- add @id - first element with @id plus '_element_name' -->
12052
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
12083
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
12084
+ <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>
12085
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
12053
12086
  </xsl:if>
12054
12087
  </xsl:template>
12055
12088
 
@@ -13354,6 +13387,7 @@
13354
13387
  <xsl:param name="formatted">false</xsl:param>
13355
13388
  <xsl:param name="lang"/>
13356
13389
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
13390
+ <xsl:param name="bibdata_updated"/>
13357
13391
 
13358
13392
  <xsl:variable name="curr_lang">
13359
13393
  <xsl:choose>
@@ -13367,6 +13401,9 @@
13367
13401
 
13368
13402
  <xsl:variable name="data_value">
13369
13403
  <xsl:choose>
13404
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
13405
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
13406
+ </xsl:when>
13370
13407
  <xsl:when test="$formatted = 'true'">
13371
13408
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
13372
13409
  </xsl:when>
@@ -13538,14 +13575,8 @@
13538
13575
  <xsl:value-of select="$src"/>
13539
13576
  </xsl:when>
13540
13577
  <xsl:otherwise>
13541
- <xsl:choose>
13542
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
13543
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
13544
- </xsl:when>
13545
- <xsl:otherwise>
13546
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13547
- </xsl:otherwise>
13548
- </xsl:choose>
13578
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
13579
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
13549
13580
  </xsl:otherwise>
13550
13581
  </xsl:choose>
13551
13582
  </xsl:template>
@@ -13567,15 +13598,23 @@
13567
13598
  <!-- END: insert cover page image -->
13568
13599
 
13569
13600
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
13601
+ <xsl:variable name="regex_ja_spec_half_width_">
13602
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
13603
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
13604
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
13605
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
13606
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
13607
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
13608
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
13609
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
13610
+ </xsl:variable>
13611
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
13570
13612
  <xsl:variable name="regex_ja_spec_">[
13571
13613
  <!-- Rotate 90° clockwise -->
13572
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
13614
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
13573
13615
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
13574
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
13575
13616
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
13576
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
13577
13617
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
13578
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
13579
13618
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
13580
13619
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
13581
13620
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -13583,21 +13622,16 @@
13583
13622
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
13584
13623
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
13585
13624
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
13586
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
13587
13625
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
13588
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
13589
13626
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
13590
13627
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
13591
13628
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
13592
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
13593
13629
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
13594
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
13595
13630
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
13596
13631
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
13597
13632
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
13598
13633
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
13599
13634
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
13600
-
13601
13635
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
13602
13636
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
13603
13637
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -13629,6 +13663,7 @@
13629
13663
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
13630
13664
  <xsl:template name="insertVerticalChar">
13631
13665
  <xsl:param name="str"/>
13666
+ <xsl:param name="char_prev"/>
13632
13667
  <xsl:param name="writing-mode">lr-tb</xsl:param>
13633
13668
  <xsl:param name="reference-orientation">90</xsl:param>
13634
13669
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -13638,53 +13673,99 @@
13638
13673
  </xsl:when>
13639
13674
  <xsl:otherwise>
13640
13675
  <xsl:if test="string-length($str) &gt; 0">
13641
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
13676
+
13677
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
13642
13678
  <xsl:variable name="char" select="substring($str,1,1)"/>
13643
- <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">
13644
- <xsl:if test="normalize-space($writing-mode) != ''">
13645
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13646
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
13647
- </xsl:if>
13648
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13649
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
13650
- </xsl:if>
13651
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
13652
- <!-- Rotate 180°:
13653
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
13654
- U+3002 IDEOGRAPHIC FULL STOP (。)
13655
- U+FE52 SMALL FULL STOP (﹒)
13656
- U+FF0E FULLWIDTH FULL STOP ()
13657
- -->
13658
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
13659
- </xsl:if>
13660
- <fo:block-container width="1em">
13661
- <fo:block line-height="1em">
13662
- <xsl:choose>
13663
- <xsl:when test="$horizontal_mode = 'true'">
13664
- <xsl:value-of select="$str"/>
13665
- </xsl:when>
13666
- <xsl:otherwise>
13679
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
13680
+
13681
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
13682
+
13683
+ <xsl:choose>
13684
+ <xsl:when test="$char_half_width = 'true'">
13685
+ <fo:inline>
13686
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
13687
+ <xsl:value-of select="$char"/>
13688
+ </fo:inline>
13689
+ </xsl:when>
13690
+ <xsl:otherwise>
13691
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
13692
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
13693
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
13694
+ </xsl:if>
13695
+ <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">
13696
+ <xsl:if test="normalize-space($writing-mode) != ''">
13697
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13698
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13699
+ </xsl:if>
13700
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13701
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
13702
+ </xsl:if>
13703
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
13704
+ <!-- Rotate 180°:
13705
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
13706
+ U+3002 IDEOGRAPHIC FULL STOP (。)
13707
+ U+FE52 SMALL FULL STOP (﹒)
13708
+ U+FF0E FULLWIDTH FULL STOP (.)
13709
+ -->
13710
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
13711
+ </xsl:if>
13712
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
13713
+ <fo:block line-height="1em" role="SKIP">
13714
+ <!-- <xsl:choose>
13715
+ <xsl:when test="$horizontal_mode = 'true'">
13716
+ <xsl:value-of select="$str"/>
13717
+ </xsl:when>
13718
+ <xsl:otherwise>
13719
+ <xsl:value-of select="$char"/>
13720
+ </xsl:otherwise>
13721
+ </xsl:choose> -->
13667
13722
  <xsl:value-of select="$char"/>
13668
- </xsl:otherwise>
13669
- </xsl:choose>
13670
- </fo:block>
13671
- </fo:block-container>
13672
- </fo:inline-container>
13673
- <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>
13674
-
13675
- <xsl:if test="$horizontal_mode = 'false'">
13676
- <xsl:call-template name="insertVerticalChar">
13677
- <xsl:with-param name="str" select="substring($str, 2)"/>
13678
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
13679
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13680
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
13681
- </xsl:call-template>
13682
- </xsl:if>
13723
+ </fo:block>
13724
+ </fo:block-container>
13725
+ </fo:inline-container>
13726
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
13727
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
13728
+ </xsl:if>
13729
+ </xsl:otherwise>
13730
+ </xsl:choose>
13731
+
13732
+ <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>
13733
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
13734
+ <xsl:call-template name="insertVerticalChar">
13735
+ <xsl:with-param name="str" select="substring($str, 2)"/>
13736
+ <xsl:with-param name="char_prev" select="$char"/>
13737
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
13738
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13739
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
13740
+ </xsl:call-template>
13741
+ <!-- </xsl:if> -->
13683
13742
  </xsl:if>
13684
13743
  </xsl:otherwise>
13685
13744
  </xsl:choose>
13686
13745
  </xsl:template>
13687
13746
 
13747
+ <xsl:template name="insertHorizontalChars">
13748
+ <xsl:param name="str"/>
13749
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
13750
+ <xsl:param name="reference-orientation">90</xsl:param>
13751
+ <xsl:param name="add_zero_width_space">false</xsl:param>
13752
+ <xsl:choose>
13753
+ <xsl:otherwise>
13754
+ <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">
13755
+ <xsl:if test="normalize-space($writing-mode) != ''">
13756
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13757
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13758
+ </xsl:if>
13759
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
13760
+ <fo:block line-height="1em" role="SKIP">
13761
+ <xsl:value-of select="$str"/>
13762
+ </fo:block>
13763
+ </fo:block-container>
13764
+ </fo:inline-container>
13765
+ </xsl:otherwise>
13766
+ </xsl:choose>
13767
+ </xsl:template>
13768
+
13688
13769
  <xsl:template name="number-to-words">
13689
13770
  <xsl:param name="number"/>
13690
13771
  <xsl:param name="first"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.0.12".freeze
3
+ VERSION = "1.0.13".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
11
+ date: 2024-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic