metanorma-ieee 1.3.6 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bed94947472e520546144ef97abcf02e8fe7d2892ebc7e6691845223eef19a4
4
- data.tar.gz: 5eff3d3949ca61fe5e1cf4bc2585f1f21ad766c70584443b775d9c6e5da9ba28
3
+ metadata.gz: 79bf9fc27f2a671b7c06ff6ff2ad1796c774550211d73fc9c4261a8ff4980a86
4
+ data.tar.gz: 5eb7827bb6fc641eff8dbf3c6328478337a1aa09576e6055eed205183b02971e
5
5
  SHA512:
6
- metadata.gz: 234d45e36875bcbf19a3823beec80f1d1b93e86a20a43cca597a55e1c84531041c9b2040ec83d94a87b5bcb0428abe3707b59c4db832bfc3744b04cb9150be8c
7
- data.tar.gz: bc1da6f07b793cf1f7bd11f84b77fd3937c406272fa917000eea081a9a9c3b31db2b4309ea3a7a7917c90ccbb5fd9860d76462f623694eaa1e983e81a877a3a1
6
+ metadata.gz: 00f98dbecc50bd67373d991ade070d2b871fef895b2cbe0c9b9cde469bef0bff401b49d559325c6e7f39820265071ab13d245b03fdaadaff08f832e7cb2b0850
7
+ data.tar.gz: 394bcfa2d7406b5df96bce417f13837b1b68c17e52244752d84b3f5fd4ed17bbb9f2bc0daf2c696d2fa98d7f592be636b6909f1f8b1ee956153ad160ae561687
@@ -7162,7 +7162,9 @@
7162
7162
  <fo:block role="SKIP">
7163
7163
 
7164
7164
  <xsl:if test="$isGenerateTableIF = 'true'">
7165
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
7165
+
7166
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
7167
+
7166
7168
  </xsl:if>
7167
7169
 
7168
7170
  <xsl:apply-templates/>
@@ -8181,7 +8183,17 @@
8181
8183
  <xsl:call-template name="refine_dt-cell-style"/>
8182
8184
 
8183
8185
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
8184
- <xsl:copy-of select="@id"/>
8186
+
8187
+ <xsl:choose>
8188
+ <xsl:when test="$isGenerateTableIF = 'true'">
8189
+
8190
+ <xsl:copy-of select="@id"/>
8191
+
8192
+ </xsl:when>
8193
+ <xsl:otherwise>
8194
+ <xsl:copy-of select="@id"/>
8195
+ </xsl:otherwise>
8196
+ </xsl:choose>
8185
8197
 
8186
8198
  <xsl:if test="normalize-space($key_iso) = 'true'">
8187
8199
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -8213,7 +8225,9 @@
8213
8225
  <fo:block role="SKIP">
8214
8226
 
8215
8227
  <xsl:if test="$isGenerateTableIF = 'true'">
8216
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
8228
+
8229
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
8230
+
8217
8231
  </xsl:if>
8218
8232
 
8219
8233
  <xsl:choose>
@@ -9451,6 +9465,14 @@
9451
9465
  </xsl:for-each>
9452
9466
  </xsl:variable>
9453
9467
 
9468
+ <!-- <xsl:if test="$debug = 'true'">
9469
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
9470
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
9471
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
9472
+ <xsl:copy-of select="$words_with_width_sorted"/>
9473
+ </redirect:write>
9474
+ </xsl:if> -->
9475
+
9454
9476
  <xsl:variable name="words">
9455
9477
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
9456
9478
  <word>
@@ -9576,6 +9598,7 @@
9576
9598
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
9577
9599
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
9578
9600
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
9601
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
9579
9602
  </tags>
9580
9603
  </xsl:template>
9581
9604
  <!-- =============================== -->
@@ -10118,7 +10141,16 @@
10118
10141
  </xsl:when>
10119
10142
  <xsl:otherwise>
10120
10143
  <!-- output text from <link>text</link> -->
10121
- <xsl:apply-templates/>
10144
+ <xsl:choose>
10145
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
10146
+ <xsl:call-template name="add-zero-spaces-link-java">
10147
+ <xsl:with-param name="text" select="."/>
10148
+ </xsl:call-template>
10149
+ </xsl:when>
10150
+ <xsl:otherwise>
10151
+ <xsl:apply-templates/>
10152
+ </xsl:otherwise>
10153
+ </xsl:choose>
10122
10154
  </xsl:otherwise>
10123
10155
  </xsl:choose>
10124
10156
  </fo:basic-link>
@@ -10757,16 +10789,29 @@
10757
10789
  <xsl:template name="getImageSrc">
10758
10790
  <xsl:choose>
10759
10791
  <xsl:when test="not(starts-with(@src, 'data:'))">
10792
+ <xsl:call-template name="getImageSrcExternal"/>
10793
+ </xsl:when>
10794
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10795
+ </xsl:choose>
10796
+ </xsl:template>
10797
+
10798
+ <xsl:template name="getImageSrcExternal">
10799
+ <xsl:choose>
10800
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10801
+ <xsl:value-of select="@src"/>
10802
+ </xsl:when>
10803
+ <xsl:otherwise>
10804
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
10805
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
10760
10806
  <xsl:choose>
10761
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10762
- <xsl:value-of select="@src"/>
10807
+ <xsl:when test="$file_exists = 'true'">
10808
+ <xsl:value-of select="$src_with_basepath"/>
10763
10809
  </xsl:when>
10764
10810
  <xsl:otherwise>
10765
- <xsl:value-of select="concat($basepath, @src)"/>
10811
+ <xsl:value-of select="@src"/>
10766
10812
  </xsl:otherwise>
10767
10813
  </xsl:choose>
10768
- </xsl:when>
10769
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10814
+ </xsl:otherwise>
10770
10815
  </xsl:choose>
10771
10816
  </xsl:template>
10772
10817
 
@@ -10814,14 +10859,8 @@
10814
10859
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
10815
10860
  </xsl:when>
10816
10861
  <xsl:when test="not(starts-with(@src, 'data:'))">
10817
- <xsl:choose>
10818
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10819
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
10820
- </xsl:when>
10821
- <xsl:otherwise>
10822
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10823
- </xsl:otherwise>
10824
- </xsl:choose>
10862
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
10863
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
10825
10864
  </xsl:when>
10826
10865
  <xsl:otherwise>
10827
10866
  <xsl:value-of select="@src"/>
@@ -10842,16 +10881,8 @@
10842
10881
  </svg>
10843
10882
  </xsl:when>
10844
10883
  <xsl:when test="not(starts-with(@src, 'data:'))">
10845
- <xsl:variable name="src">
10846
- <xsl:choose>
10847
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10848
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
10849
- </xsl:when>
10850
- <xsl:otherwise>
10851
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10852
- </xsl:otherwise>
10853
- </xsl:choose>
10854
- </xsl:variable>
10884
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
10885
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
10855
10886
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
10856
10887
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
10857
10888
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -15018,7 +15049,9 @@
15018
15049
  <xsl:template name="add_id">
15019
15050
  <xsl:if test="not(@id)">
15020
15051
  <!-- add @id - first element with @id plus '_element_name' -->
15021
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
15052
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
15053
+ <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>
15054
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
15022
15055
  </xsl:if>
15023
15056
  </xsl:template>
15024
15057
 
@@ -16425,6 +16458,7 @@
16425
16458
  <xsl:param name="formatted">false</xsl:param>
16426
16459
  <xsl:param name="lang"/>
16427
16460
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
16461
+ <xsl:param name="bibdata_updated"/>
16428
16462
 
16429
16463
  <xsl:variable name="curr_lang">
16430
16464
  <xsl:choose>
@@ -16438,6 +16472,9 @@
16438
16472
 
16439
16473
  <xsl:variable name="data_value">
16440
16474
  <xsl:choose>
16475
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
16476
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
16477
+ </xsl:when>
16441
16478
  <xsl:when test="$formatted = 'true'">
16442
16479
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
16443
16480
  </xsl:when>
@@ -16609,14 +16646,8 @@
16609
16646
  <xsl:value-of select="$src"/>
16610
16647
  </xsl:when>
16611
16648
  <xsl:otherwise>
16612
- <xsl:choose>
16613
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
16614
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
16615
- </xsl:when>
16616
- <xsl:otherwise>
16617
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
16618
- </xsl:otherwise>
16619
- </xsl:choose>
16649
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
16650
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
16620
16651
  </xsl:otherwise>
16621
16652
  </xsl:choose>
16622
16653
  </xsl:template>
@@ -16638,15 +16669,23 @@
16638
16669
  <!-- END: insert cover page image -->
16639
16670
 
16640
16671
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
16672
+ <xsl:variable name="regex_ja_spec_half_width_">
16673
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
16674
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
16675
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
16676
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
16677
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
16678
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
16679
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
16680
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
16681
+ </xsl:variable>
16682
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
16641
16683
  <xsl:variable name="regex_ja_spec_">[
16642
16684
  <!-- Rotate 90° clockwise -->
16643
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
16685
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
16644
16686
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
16645
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
16646
16687
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
16647
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
16648
16688
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
16649
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
16650
16689
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
16651
16690
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
16652
16691
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -16654,21 +16693,16 @@
16654
16693
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
16655
16694
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
16656
16695
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
16657
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
16658
16696
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
16659
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
16660
16697
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
16661
16698
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
16662
16699
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
16663
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
16664
16700
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
16665
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
16666
16701
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
16667
16702
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
16668
16703
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
16669
16704
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
16670
16705
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
16671
-
16672
16706
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
16673
16707
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
16674
16708
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -16700,6 +16734,7 @@
16700
16734
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
16701
16735
  <xsl:template name="insertVerticalChar">
16702
16736
  <xsl:param name="str"/>
16737
+ <xsl:param name="char_prev"/>
16703
16738
  <xsl:param name="writing-mode">lr-tb</xsl:param>
16704
16739
  <xsl:param name="reference-orientation">90</xsl:param>
16705
16740
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -16709,53 +16744,99 @@
16709
16744
  </xsl:when>
16710
16745
  <xsl:otherwise>
16711
16746
  <xsl:if test="string-length($str) &gt; 0">
16712
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
16747
+
16748
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
16713
16749
  <xsl:variable name="char" select="substring($str,1,1)"/>
16714
- <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">
16715
- <xsl:if test="normalize-space($writing-mode) != ''">
16716
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
16717
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
16718
- </xsl:if>
16719
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
16720
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
16721
- </xsl:if>
16722
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
16723
- <!-- Rotate 180°:
16724
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
16725
- U+3002 IDEOGRAPHIC FULL STOP (。)
16726
- U+FE52 SMALL FULL STOP (﹒)
16727
- U+FF0E FULLWIDTH FULL STOP ()
16728
- -->
16729
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
16730
- </xsl:if>
16731
- <fo:block-container width="1em">
16732
- <fo:block line-height="1em">
16733
- <xsl:choose>
16734
- <xsl:when test="$horizontal_mode = 'true'">
16735
- <xsl:value-of select="$str"/>
16736
- </xsl:when>
16737
- <xsl:otherwise>
16750
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
16751
+
16752
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
16753
+
16754
+ <xsl:choose>
16755
+ <xsl:when test="$char_half_width = 'true'">
16756
+ <fo:inline>
16757
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
16758
+ <xsl:value-of select="$char"/>
16759
+ </fo:inline>
16760
+ </xsl:when>
16761
+ <xsl:otherwise>
16762
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
16763
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
16764
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
16765
+ </xsl:if>
16766
+ <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">
16767
+ <xsl:if test="normalize-space($writing-mode) != ''">
16768
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
16769
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
16770
+ </xsl:if>
16771
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
16772
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
16773
+ </xsl:if>
16774
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
16775
+ <!-- Rotate 180°:
16776
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
16777
+ U+3002 IDEOGRAPHIC FULL STOP (。)
16778
+ U+FE52 SMALL FULL STOP (﹒)
16779
+ U+FF0E FULLWIDTH FULL STOP (.)
16780
+ -->
16781
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
16782
+ </xsl:if>
16783
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
16784
+ <fo:block line-height="1em" role="SKIP">
16785
+ <!-- <xsl:choose>
16786
+ <xsl:when test="$horizontal_mode = 'true'">
16787
+ <xsl:value-of select="$str"/>
16788
+ </xsl:when>
16789
+ <xsl:otherwise>
16790
+ <xsl:value-of select="$char"/>
16791
+ </xsl:otherwise>
16792
+ </xsl:choose> -->
16738
16793
  <xsl:value-of select="$char"/>
16739
- </xsl:otherwise>
16740
- </xsl:choose>
16741
- </fo:block>
16742
- </fo:block-container>
16743
- </fo:inline-container>
16744
- <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>
16745
-
16746
- <xsl:if test="$horizontal_mode = 'false'">
16747
- <xsl:call-template name="insertVerticalChar">
16748
- <xsl:with-param name="str" select="substring($str, 2)"/>
16749
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
16750
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
16751
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
16752
- </xsl:call-template>
16753
- </xsl:if>
16794
+ </fo:block>
16795
+ </fo:block-container>
16796
+ </fo:inline-container>
16797
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
16798
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
16799
+ </xsl:if>
16800
+ </xsl:otherwise>
16801
+ </xsl:choose>
16802
+
16803
+ <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>
16804
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
16805
+ <xsl:call-template name="insertVerticalChar">
16806
+ <xsl:with-param name="str" select="substring($str, 2)"/>
16807
+ <xsl:with-param name="char_prev" select="$char"/>
16808
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
16809
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
16810
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
16811
+ </xsl:call-template>
16812
+ <!-- </xsl:if> -->
16754
16813
  </xsl:if>
16755
16814
  </xsl:otherwise>
16756
16815
  </xsl:choose>
16757
16816
  </xsl:template>
16758
16817
 
16818
+ <xsl:template name="insertHorizontalChars">
16819
+ <xsl:param name="str"/>
16820
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
16821
+ <xsl:param name="reference-orientation">90</xsl:param>
16822
+ <xsl:param name="add_zero_width_space">false</xsl:param>
16823
+ <xsl:choose>
16824
+ <xsl:otherwise>
16825
+ <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">
16826
+ <xsl:if test="normalize-space($writing-mode) != ''">
16827
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
16828
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
16829
+ </xsl:if>
16830
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
16831
+ <fo:block line-height="1em" role="SKIP">
16832
+ <xsl:value-of select="$str"/>
16833
+ </fo:block>
16834
+ </fo:block-container>
16835
+ </fo:inline-container>
16836
+ </xsl:otherwise>
16837
+ </xsl:choose>
16838
+ </xsl:template>
16839
+
16759
16840
  <xsl:template name="number-to-words">
16760
16841
  <xsl:param name="number"/>
16761
16842
  <xsl:param name="first"/>
@@ -7162,7 +7162,9 @@
7162
7162
  <fo:block role="SKIP">
7163
7163
 
7164
7164
  <xsl:if test="$isGenerateTableIF = 'true'">
7165
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
7165
+
7166
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
7167
+
7166
7168
  </xsl:if>
7167
7169
 
7168
7170
  <xsl:apply-templates/>
@@ -8181,7 +8183,17 @@
8181
8183
  <xsl:call-template name="refine_dt-cell-style"/>
8182
8184
 
8183
8185
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
8184
- <xsl:copy-of select="@id"/>
8186
+
8187
+ <xsl:choose>
8188
+ <xsl:when test="$isGenerateTableIF = 'true'">
8189
+
8190
+ <xsl:copy-of select="@id"/>
8191
+
8192
+ </xsl:when>
8193
+ <xsl:otherwise>
8194
+ <xsl:copy-of select="@id"/>
8195
+ </xsl:otherwise>
8196
+ </xsl:choose>
8185
8197
 
8186
8198
  <xsl:if test="normalize-space($key_iso) = 'true'">
8187
8199
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -8213,7 +8225,9 @@
8213
8225
  <fo:block role="SKIP">
8214
8226
 
8215
8227
  <xsl:if test="$isGenerateTableIF = 'true'">
8216
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
8228
+
8229
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
8230
+
8217
8231
  </xsl:if>
8218
8232
 
8219
8233
  <xsl:choose>
@@ -9451,6 +9465,14 @@
9451
9465
  </xsl:for-each>
9452
9466
  </xsl:variable>
9453
9467
 
9468
+ <!-- <xsl:if test="$debug = 'true'">
9469
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
9470
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
9471
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
9472
+ <xsl:copy-of select="$words_with_width_sorted"/>
9473
+ </redirect:write>
9474
+ </xsl:if> -->
9475
+
9454
9476
  <xsl:variable name="words">
9455
9477
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
9456
9478
  <word>
@@ -9576,6 +9598,7 @@
9576
9598
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
9577
9599
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
9578
9600
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
9601
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
9579
9602
  </tags>
9580
9603
  </xsl:template>
9581
9604
  <!-- =============================== -->
@@ -10118,7 +10141,16 @@
10118
10141
  </xsl:when>
10119
10142
  <xsl:otherwise>
10120
10143
  <!-- output text from <link>text</link> -->
10121
- <xsl:apply-templates/>
10144
+ <xsl:choose>
10145
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
10146
+ <xsl:call-template name="add-zero-spaces-link-java">
10147
+ <xsl:with-param name="text" select="."/>
10148
+ </xsl:call-template>
10149
+ </xsl:when>
10150
+ <xsl:otherwise>
10151
+ <xsl:apply-templates/>
10152
+ </xsl:otherwise>
10153
+ </xsl:choose>
10122
10154
  </xsl:otherwise>
10123
10155
  </xsl:choose>
10124
10156
  </fo:basic-link>
@@ -10757,16 +10789,29 @@
10757
10789
  <xsl:template name="getImageSrc">
10758
10790
  <xsl:choose>
10759
10791
  <xsl:when test="not(starts-with(@src, 'data:'))">
10792
+ <xsl:call-template name="getImageSrcExternal"/>
10793
+ </xsl:when>
10794
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10795
+ </xsl:choose>
10796
+ </xsl:template>
10797
+
10798
+ <xsl:template name="getImageSrcExternal">
10799
+ <xsl:choose>
10800
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10801
+ <xsl:value-of select="@src"/>
10802
+ </xsl:when>
10803
+ <xsl:otherwise>
10804
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
10805
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
10760
10806
  <xsl:choose>
10761
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10762
- <xsl:value-of select="@src"/>
10807
+ <xsl:when test="$file_exists = 'true'">
10808
+ <xsl:value-of select="$src_with_basepath"/>
10763
10809
  </xsl:when>
10764
10810
  <xsl:otherwise>
10765
- <xsl:value-of select="concat($basepath, @src)"/>
10811
+ <xsl:value-of select="@src"/>
10766
10812
  </xsl:otherwise>
10767
10813
  </xsl:choose>
10768
- </xsl:when>
10769
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10814
+ </xsl:otherwise>
10770
10815
  </xsl:choose>
10771
10816
  </xsl:template>
10772
10817
 
@@ -10814,14 +10859,8 @@
10814
10859
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
10815
10860
  </xsl:when>
10816
10861
  <xsl:when test="not(starts-with(@src, 'data:'))">
10817
- <xsl:choose>
10818
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10819
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
10820
- </xsl:when>
10821
- <xsl:otherwise>
10822
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10823
- </xsl:otherwise>
10824
- </xsl:choose>
10862
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
10863
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
10825
10864
  </xsl:when>
10826
10865
  <xsl:otherwise>
10827
10866
  <xsl:value-of select="@src"/>
@@ -10842,16 +10881,8 @@
10842
10881
  </svg>
10843
10882
  </xsl:when>
10844
10883
  <xsl:when test="not(starts-with(@src, 'data:'))">
10845
- <xsl:variable name="src">
10846
- <xsl:choose>
10847
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10848
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
10849
- </xsl:when>
10850
- <xsl:otherwise>
10851
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10852
- </xsl:otherwise>
10853
- </xsl:choose>
10854
- </xsl:variable>
10884
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
10885
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
10855
10886
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
10856
10887
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
10857
10888
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -15018,7 +15049,9 @@
15018
15049
  <xsl:template name="add_id">
15019
15050
  <xsl:if test="not(@id)">
15020
15051
  <!-- add @id - first element with @id plus '_element_name' -->
15021
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
15052
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
15053
+ <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>
15054
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
15022
15055
  </xsl:if>
15023
15056
  </xsl:template>
15024
15057
 
@@ -16425,6 +16458,7 @@
16425
16458
  <xsl:param name="formatted">false</xsl:param>
16426
16459
  <xsl:param name="lang"/>
16427
16460
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
16461
+ <xsl:param name="bibdata_updated"/>
16428
16462
 
16429
16463
  <xsl:variable name="curr_lang">
16430
16464
  <xsl:choose>
@@ -16438,6 +16472,9 @@
16438
16472
 
16439
16473
  <xsl:variable name="data_value">
16440
16474
  <xsl:choose>
16475
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
16476
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
16477
+ </xsl:when>
16441
16478
  <xsl:when test="$formatted = 'true'">
16442
16479
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
16443
16480
  </xsl:when>
@@ -16609,14 +16646,8 @@
16609
16646
  <xsl:value-of select="$src"/>
16610
16647
  </xsl:when>
16611
16648
  <xsl:otherwise>
16612
- <xsl:choose>
16613
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
16614
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
16615
- </xsl:when>
16616
- <xsl:otherwise>
16617
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
16618
- </xsl:otherwise>
16619
- </xsl:choose>
16649
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
16650
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
16620
16651
  </xsl:otherwise>
16621
16652
  </xsl:choose>
16622
16653
  </xsl:template>
@@ -16638,15 +16669,23 @@
16638
16669
  <!-- END: insert cover page image -->
16639
16670
 
16640
16671
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
16672
+ <xsl:variable name="regex_ja_spec_half_width_">
16673
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
16674
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
16675
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
16676
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
16677
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
16678
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
16679
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
16680
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
16681
+ </xsl:variable>
16682
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
16641
16683
  <xsl:variable name="regex_ja_spec_">[
16642
16684
  <!-- Rotate 90° clockwise -->
16643
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
16685
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
16644
16686
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
16645
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
16646
16687
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
16647
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
16648
16688
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
16649
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
16650
16689
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
16651
16690
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
16652
16691
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -16654,21 +16693,16 @@
16654
16693
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
16655
16694
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
16656
16695
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
16657
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
16658
16696
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
16659
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
16660
16697
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
16661
16698
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
16662
16699
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
16663
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
16664
16700
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
16665
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
16666
16701
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
16667
16702
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
16668
16703
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
16669
16704
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
16670
16705
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
16671
-
16672
16706
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
16673
16707
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
16674
16708
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -16700,6 +16734,7 @@
16700
16734
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
16701
16735
  <xsl:template name="insertVerticalChar">
16702
16736
  <xsl:param name="str"/>
16737
+ <xsl:param name="char_prev"/>
16703
16738
  <xsl:param name="writing-mode">lr-tb</xsl:param>
16704
16739
  <xsl:param name="reference-orientation">90</xsl:param>
16705
16740
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -16709,53 +16744,99 @@
16709
16744
  </xsl:when>
16710
16745
  <xsl:otherwise>
16711
16746
  <xsl:if test="string-length($str) &gt; 0">
16712
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
16747
+
16748
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
16713
16749
  <xsl:variable name="char" select="substring($str,1,1)"/>
16714
- <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">
16715
- <xsl:if test="normalize-space($writing-mode) != ''">
16716
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
16717
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
16718
- </xsl:if>
16719
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
16720
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
16721
- </xsl:if>
16722
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
16723
- <!-- Rotate 180°:
16724
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
16725
- U+3002 IDEOGRAPHIC FULL STOP (。)
16726
- U+FE52 SMALL FULL STOP (﹒)
16727
- U+FF0E FULLWIDTH FULL STOP ()
16728
- -->
16729
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
16730
- </xsl:if>
16731
- <fo:block-container width="1em">
16732
- <fo:block line-height="1em">
16733
- <xsl:choose>
16734
- <xsl:when test="$horizontal_mode = 'true'">
16735
- <xsl:value-of select="$str"/>
16736
- </xsl:when>
16737
- <xsl:otherwise>
16750
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
16751
+
16752
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
16753
+
16754
+ <xsl:choose>
16755
+ <xsl:when test="$char_half_width = 'true'">
16756
+ <fo:inline>
16757
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
16758
+ <xsl:value-of select="$char"/>
16759
+ </fo:inline>
16760
+ </xsl:when>
16761
+ <xsl:otherwise>
16762
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
16763
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
16764
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
16765
+ </xsl:if>
16766
+ <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">
16767
+ <xsl:if test="normalize-space($writing-mode) != ''">
16768
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
16769
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
16770
+ </xsl:if>
16771
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
16772
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
16773
+ </xsl:if>
16774
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
16775
+ <!-- Rotate 180°:
16776
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
16777
+ U+3002 IDEOGRAPHIC FULL STOP (。)
16778
+ U+FE52 SMALL FULL STOP (﹒)
16779
+ U+FF0E FULLWIDTH FULL STOP (.)
16780
+ -->
16781
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
16782
+ </xsl:if>
16783
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
16784
+ <fo:block line-height="1em" role="SKIP">
16785
+ <!-- <xsl:choose>
16786
+ <xsl:when test="$horizontal_mode = 'true'">
16787
+ <xsl:value-of select="$str"/>
16788
+ </xsl:when>
16789
+ <xsl:otherwise>
16790
+ <xsl:value-of select="$char"/>
16791
+ </xsl:otherwise>
16792
+ </xsl:choose> -->
16738
16793
  <xsl:value-of select="$char"/>
16739
- </xsl:otherwise>
16740
- </xsl:choose>
16741
- </fo:block>
16742
- </fo:block-container>
16743
- </fo:inline-container>
16744
- <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>
16745
-
16746
- <xsl:if test="$horizontal_mode = 'false'">
16747
- <xsl:call-template name="insertVerticalChar">
16748
- <xsl:with-param name="str" select="substring($str, 2)"/>
16749
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
16750
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
16751
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
16752
- </xsl:call-template>
16753
- </xsl:if>
16794
+ </fo:block>
16795
+ </fo:block-container>
16796
+ </fo:inline-container>
16797
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
16798
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
16799
+ </xsl:if>
16800
+ </xsl:otherwise>
16801
+ </xsl:choose>
16802
+
16803
+ <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>
16804
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
16805
+ <xsl:call-template name="insertVerticalChar">
16806
+ <xsl:with-param name="str" select="substring($str, 2)"/>
16807
+ <xsl:with-param name="char_prev" select="$char"/>
16808
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
16809
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
16810
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
16811
+ </xsl:call-template>
16812
+ <!-- </xsl:if> -->
16754
16813
  </xsl:if>
16755
16814
  </xsl:otherwise>
16756
16815
  </xsl:choose>
16757
16816
  </xsl:template>
16758
16817
 
16818
+ <xsl:template name="insertHorizontalChars">
16819
+ <xsl:param name="str"/>
16820
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
16821
+ <xsl:param name="reference-orientation">90</xsl:param>
16822
+ <xsl:param name="add_zero_width_space">false</xsl:param>
16823
+ <xsl:choose>
16824
+ <xsl:otherwise>
16825
+ <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">
16826
+ <xsl:if test="normalize-space($writing-mode) != ''">
16827
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
16828
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
16829
+ </xsl:if>
16830
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
16831
+ <fo:block line-height="1em" role="SKIP">
16832
+ <xsl:value-of select="$str"/>
16833
+ </fo:block>
16834
+ </fo:block-container>
16835
+ </fo:inline-container>
16836
+ </xsl:otherwise>
16837
+ </xsl:choose>
16838
+ </xsl:template>
16839
+
16759
16840
  <xsl:template name="number-to-words">
16760
16841
  <xsl:param name="number"/>
16761
16842
  <xsl:param name="first"/>
@@ -86,12 +86,12 @@ module IsoDoc
86
86
  .render1(RelatonBib::XMLParser.from_xml(bibitem.to_xml))
87
87
  end
88
88
 
89
- def bibliography_bibitem_number1(bibitem, idx)
89
+ def bibliography_bibitem_number1(bibitem, idx, normative)
90
90
  bibitem.xpath(ns(".//docidentifier[@type = 'metanorma' or " \
91
91
  "@type = 'metanorma-ordinal']")).each do |mn|
92
92
  /^\[?B?\d\]?$/.match?(mn&.text) and mn.remove
93
93
  end
94
- unless bibliography_bibitem_number_skip(bibitem)
94
+ unless bibliography_bibitem_number_skip(bibitem) || normative
95
95
  idx += 1
96
96
  docidentifier_insert_pt(bibitem).next =
97
97
  "<docidentifier type='metanorma-ordinal'>[B#{idx}]</docidentifier>"
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ieee
3
- VERSION = "1.3.6".freeze
3
+ VERSION = "1.3.7".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.3.7
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-11 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-standoc