metanorma-iso 2.9.2 → 2.9.3

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: d8cce2da59aa8b9dc9110813d8705c46804317af51f1d1ac3c7c9feeaefce0ee
4
- data.tar.gz: 421cc96a3f66326d521a543a8e42e62b7e5b1db5180aceb0bd45ff94eceea917
3
+ metadata.gz: 37034092d78c76a73f393f7c4f6713df2b80a86516af183d2db8b05861357254
4
+ data.tar.gz: f03f3c24d35340eb998552a8447d54788ae293a59c99e9121f74bf56fa11276f
5
5
  SHA512:
6
- metadata.gz: 7323f3b08a9de3a3d27dc57847c09baa2e2c418a3db00d36ad232ab9235b5e0cae6a9fffb4663d36c497c1677ee0f455cd718516c195c45cd54da81ca3407ffd
7
- data.tar.gz: eca0875e427fc33eb671a59a659f544c2af89699024c622192f8250b7197026c33c7fc696f16ed7e59753abe844a82ddb7cae9b08e056bdc28634d9ae4404442
6
+ metadata.gz: c933caa17390d91b1f44f20eb4ff86cff8a7d2a77394ee1fb99bdd339b9bb20da046f547f53551c8b80d2fe79b92409ad73f1a2de528bc79bec00de9edc0795d
7
+ data.tar.gz: b55aa2f2192298d4c24c2d25d219b2b47bb3665622a75402e005fff8c7f2ee89fa80c0c4fb2e52371528851ed6df69192d3d42d272e8a3cc766fdbfb78479e03
@@ -14,9 +14,6 @@ withdrawn: Zurückgezogen.
14
14
  cancelled_and_replaced: Abgebrochen und ersetzt durch %.
15
15
  table_of_contents: Inhalt
16
16
  date: datum
17
- index: Index
18
- see: schau
19
- see_also: siehe auch
20
17
  secretariat: Sekretariat
21
18
  edition: Ausgabe
22
19
  termsrelated: Begriffe im Zusammenhang mit
@@ -17,9 +17,6 @@ withdrawn: Withdrawn.
17
17
  cancelled_and_replaced: Cancelled and replaced by %.
18
18
  table_of_contents: Contents
19
19
  date: Date
20
- index: Index
21
- see: see
22
- see_also: see also
23
20
  secretariat: Secretariat
24
21
  edition: edition
25
22
  edition_ordinal_old: "{{ var1 | ordinal_num: 'edition', '' }} EDITION"
@@ -17,9 +17,6 @@ under_preparation: En cours d'élaboration. (Stade au moment de la publication %
17
17
  withdrawn: Retiré.
18
18
  cancelled_and_replaced: Annulé et remplacé par %.
19
19
  date: Date
20
- index: Index
21
- see: voir
22
- see_also: voir aussi
23
20
  secretariat: Secrétariat
24
21
  edition: édition
25
22
  edition_ordinal_old: "{{ var1 | ordinal_num: 'edition', '' }} ÉDITION"
@@ -16,9 +16,6 @@ withdrawn: Отозван.
16
16
  cancelled_and_replaced: Отменено и заменено на %.
17
17
  table_of_contents: Содержание
18
18
  date: Дата
19
- index: Алфавитный указатель
20
- see: см.
21
- see_also: см. также
22
19
  secretariat: Секретариат
23
20
  scope: Область применения
24
21
  edition: издание
@@ -12,9 +12,6 @@ under_preparation: 制定中(出版时最新状态为%)
12
12
  withdrawn: 撤回 .
13
13
  cancelled_and_replaced: 已取消并由%取代。
14
14
  date: 日期
15
- index: 索引
16
- see: 见
17
- see_also: 另见
18
15
  secretariat: 秘书处
19
16
  edition: 版
20
17
  termsrelated: 相关术语
@@ -11,11 +11,20 @@
11
11
 
12
12
  <xsl:variable name="column_gap">8.5mm</xsl:variable>
13
13
 
14
- <xsl:variable name="docidentifierISO_undated"><xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM')"><xsl:value-of select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-undated'])"/></xsl:if></xsl:variable>
14
+ <xsl:variable name="docidentifier_iso" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
15
+
16
+ <xsl:variable name="docidentifier_undated_" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-undated'])"/>
17
+ <xsl:variable name="docidentifier_undated"><xsl:value-of select="$docidentifier_undated_"/><xsl:if test="$docidentifier_undated_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
18
+ <xsl:variable name="docidentifierISO_undated_">
19
+ <xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM')">
20
+ <xsl:value-of select="$docidentifier_undated_"/>
21
+ </xsl:if>
22
+ </xsl:variable>
23
+ <xsl:variable name="docidentifierISO_undated" select="normalize-space($docidentifierISO_undated_)"/>
15
24
  <xsl:variable name="docidentifierISO_">
16
25
  <xsl:value-of select="$docidentifierISO_undated"/>
17
26
  <xsl:if test="$docidentifierISO_undated = ''">
18
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
27
+ <xsl:value-of select="$docidentifier_iso"/>
19
28
  </xsl:if>
20
29
  </xsl:variable>
21
30
  <xsl:variable name="docidentifierISO" select="normalize-space($docidentifierISO_)"/>
@@ -77,12 +86,14 @@
77
86
  <xsl:value-of select="$i18n_all_rights_reserved"/>
78
87
  </xsl:variable>
79
88
 
80
- <xsl:variable name="docidentifier_iso_with_lang" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang']"/>
89
+ <xsl:variable name="docidentifier_iso_with_lang_" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'])"/>
90
+ <xsl:variable name="docidentifier_iso_with_lang"><xsl:value-of select="$docidentifier_iso_with_lang_"/><xsl:if test="$docidentifier_iso_with_lang_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
81
91
 
82
92
  <xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after($docidentifier_iso_with_lang, '('), ')')"/>
83
93
  <xsl:variable name="lang-1st-letter" select="concat('(', $lang-1st-letter_tmp , ')')"/>
84
94
 
85
- <xsl:variable name="iso_reference" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-reference']"/>
95
+ <xsl:variable name="iso_reference_" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-reference'])"/>
96
+ <xsl:variable name="iso_reference"><xsl:value-of select="$iso_reference_"/><xsl:if test="$iso_reference_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
86
97
  <xsl:variable name="anotherNumbers">
87
98
  <xsl:variable name="year_iso_reference" select="concat(':',substring-after($iso_reference,':'))"/>
88
99
  <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type != '' and @type != 'ISO' and not(starts-with(@type, 'iso-')) and @type != 'URN']">
@@ -966,7 +977,7 @@
966
977
  </xsl:variable>
967
978
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($doctype_international_standard))"/>
968
979
  <xsl:text> </xsl:text>
969
- <xsl:value-of select="translate(substring-before(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-undated'], '/'),':','-')"/>
980
+ <xsl:value-of select="translate(substring-before($docidentifier_undated, '/'),':','-')"/>
970
981
  <xsl:text>/</xsl:text>
971
982
  <xsl:value-of select="$doctype_localized"/>
972
983
  <xsl:text> </xsl:text>
@@ -1037,7 +1048,7 @@
1037
1048
 
1038
1049
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
1039
1050
 
1040
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//image or .//svg]">
1051
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
1041
1052
 
1042
1053
  <fo:page-sequence format="i" force-page-count="no-force">
1043
1054
 
@@ -1186,7 +1197,7 @@
1186
1197
 
1187
1198
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to sections, if top element in 'sections' -->
1188
1199
 
1189
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//image or .//svg]">
1200
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
1190
1201
 
1191
1202
  <!-- BODY -->
1192
1203
  <fo:page-sequence force-page-count="no-force">
@@ -1924,7 +1935,7 @@
1924
1935
  <xsl:call-template name="insertTitlesLangMain"/>
1925
1936
  </fo:block>
1926
1937
 
1927
- <xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'PRF')">
1938
+ <xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM')"> <!-- or $stage-abbreviation = 'PRF' -->
1928
1939
  <xsl:for-each select="xalan:nodeset($lang_other)/lang">
1929
1940
  <xsl:variable name="lang_other" select="."/>
1930
1941
  <fo:block font-size="12pt" role="SKIP"><xsl:value-of select="$linebreak"/></fo:block>
@@ -9161,7 +9172,9 @@
9161
9172
  <fo:block role="SKIP">
9162
9173
 
9163
9174
  <xsl:if test="$isGenerateTableIF = 'true'">
9164
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
9175
+
9176
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
9177
+
9165
9178
  </xsl:if>
9166
9179
 
9167
9180
  <xsl:apply-templates/>
@@ -10211,7 +10224,17 @@
10211
10224
  <xsl:call-template name="refine_dt-cell-style"/>
10212
10225
 
10213
10226
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
10214
- <xsl:copy-of select="@id"/>
10227
+
10228
+ <xsl:choose>
10229
+ <xsl:when test="$isGenerateTableIF = 'true'">
10230
+
10231
+ <xsl:copy-of select="@id"/>
10232
+
10233
+ </xsl:when>
10234
+ <xsl:otherwise>
10235
+ <xsl:copy-of select="@id"/>
10236
+ </xsl:otherwise>
10237
+ </xsl:choose>
10215
10238
 
10216
10239
  <xsl:if test="normalize-space($key_iso) = 'true'">
10217
10240
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -10243,7 +10266,9 @@
10243
10266
  <fo:block role="SKIP">
10244
10267
 
10245
10268
  <xsl:if test="$isGenerateTableIF = 'true'">
10246
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
10269
+
10270
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
10271
+
10247
10272
  </xsl:if>
10248
10273
 
10249
10274
  <xsl:choose>
@@ -11566,6 +11591,14 @@
11566
11591
  </xsl:for-each>
11567
11592
  </xsl:variable>
11568
11593
 
11594
+ <!-- <xsl:if test="$debug = 'true'">
11595
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
11596
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
11597
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
11598
+ <xsl:copy-of select="$words_with_width_sorted"/>
11599
+ </redirect:write>
11600
+ </xsl:if> -->
11601
+
11569
11602
  <xsl:variable name="words">
11570
11603
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
11571
11604
  <word>
@@ -11691,6 +11724,7 @@
11691
11724
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
11692
11725
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
11693
11726
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
11727
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
11694
11728
  </tags>
11695
11729
  </xsl:template>
11696
11730
  <!-- =============================== -->
@@ -12238,7 +12272,16 @@
12238
12272
  </xsl:when>
12239
12273
  <xsl:otherwise>
12240
12274
  <!-- output text from <link>text</link> -->
12241
- <xsl:apply-templates/>
12275
+ <xsl:choose>
12276
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
12277
+ <xsl:call-template name="add-zero-spaces-link-java">
12278
+ <xsl:with-param name="text" select="."/>
12279
+ </xsl:call-template>
12280
+ </xsl:when>
12281
+ <xsl:otherwise>
12282
+ <xsl:apply-templates/>
12283
+ </xsl:otherwise>
12284
+ </xsl:choose>
12242
12285
  </xsl:otherwise>
12243
12286
  </xsl:choose>
12244
12287
  </fo:basic-link>
@@ -12908,16 +12951,29 @@
12908
12951
  <xsl:template name="getImageSrc">
12909
12952
  <xsl:choose>
12910
12953
  <xsl:when test="not(starts-with(@src, 'data:'))">
12954
+ <xsl:call-template name="getImageSrcExternal"/>
12955
+ </xsl:when>
12956
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
12957
+ </xsl:choose>
12958
+ </xsl:template>
12959
+
12960
+ <xsl:template name="getImageSrcExternal">
12961
+ <xsl:choose>
12962
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12963
+ <xsl:value-of select="@src"/>
12964
+ </xsl:when>
12965
+ <xsl:otherwise>
12966
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
12967
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
12911
12968
  <xsl:choose>
12912
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12913
- <xsl:value-of select="@src"/>
12969
+ <xsl:when test="$file_exists = 'true'">
12970
+ <xsl:value-of select="$src_with_basepath"/>
12914
12971
  </xsl:when>
12915
12972
  <xsl:otherwise>
12916
- <xsl:value-of select="concat($basepath, @src)"/>
12973
+ <xsl:value-of select="@src"/>
12917
12974
  </xsl:otherwise>
12918
12975
  </xsl:choose>
12919
- </xsl:when>
12920
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
12976
+ </xsl:otherwise>
12921
12977
  </xsl:choose>
12922
12978
  </xsl:template>
12923
12979
 
@@ -12965,14 +13021,8 @@
12965
13021
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
12966
13022
  </xsl:when>
12967
13023
  <xsl:when test="not(starts-with(@src, 'data:'))">
12968
- <xsl:choose>
12969
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12970
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12971
- </xsl:when>
12972
- <xsl:otherwise>
12973
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12974
- </xsl:otherwise>
12975
- </xsl:choose>
13024
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
13025
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
12976
13026
  </xsl:when>
12977
13027
  <xsl:otherwise>
12978
13028
  <xsl:value-of select="@src"/>
@@ -12993,16 +13043,8 @@
12993
13043
  </svg>
12994
13044
  </xsl:when>
12995
13045
  <xsl:when test="not(starts-with(@src, 'data:'))">
12996
- <xsl:variable name="src">
12997
- <xsl:choose>
12998
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12999
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
13000
- </xsl:when>
13001
- <xsl:otherwise>
13002
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
13003
- </xsl:otherwise>
13004
- </xsl:choose>
13005
- </xsl:variable>
13046
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
13047
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
13006
13048
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
13007
13049
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
13008
13050
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -17195,7 +17237,9 @@
17195
17237
  <xsl:template name="add_id">
17196
17238
  <xsl:if test="not(@id)">
17197
17239
  <!-- add @id - first element with @id plus '_element_name' -->
17198
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
17240
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
17241
+ <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>
17242
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
17199
17243
  </xsl:if>
17200
17244
  </xsl:template>
17201
17245
 
@@ -18254,7 +18298,14 @@
18254
18298
  <xsl:variable name="title">
18255
18299
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
18256
18300
 
18257
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
18301
+ <xsl:choose>
18302
+ <xsl:when test="*[local-name() = 'title'][@language = $lang and @type = 'main']">
18303
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
18304
+ </xsl:when>
18305
+ <xsl:otherwise>
18306
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'title-main']"/>
18307
+ </xsl:otherwise>
18308
+ </xsl:choose>
18258
18309
 
18259
18310
  </xsl:for-each>
18260
18311
  </xsl:variable>
@@ -18627,6 +18678,7 @@
18627
18678
  <xsl:param name="formatted">false</xsl:param>
18628
18679
  <xsl:param name="lang"/>
18629
18680
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
18681
+ <xsl:param name="bibdata_updated"/>
18630
18682
 
18631
18683
  <xsl:variable name="curr_lang">
18632
18684
  <xsl:choose>
@@ -18640,6 +18692,9 @@
18640
18692
 
18641
18693
  <xsl:variable name="data_value">
18642
18694
  <xsl:choose>
18695
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
18696
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
18697
+ </xsl:when>
18643
18698
  <xsl:when test="$formatted = 'true'">
18644
18699
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
18645
18700
  </xsl:when>
@@ -18811,14 +18866,8 @@
18811
18866
  <xsl:value-of select="$src"/>
18812
18867
  </xsl:when>
18813
18868
  <xsl:otherwise>
18814
- <xsl:choose>
18815
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
18816
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
18817
- </xsl:when>
18818
- <xsl:otherwise>
18819
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
18820
- </xsl:otherwise>
18821
- </xsl:choose>
18869
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
18870
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
18822
18871
  </xsl:otherwise>
18823
18872
  </xsl:choose>
18824
18873
  </xsl:template>
@@ -18840,15 +18889,23 @@
18840
18889
  <!-- END: insert cover page image -->
18841
18890
 
18842
18891
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
18892
+ <xsl:variable name="regex_ja_spec_half_width_">
18893
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
18894
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
18895
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
18896
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
18897
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
18898
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
18899
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
18900
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
18901
+ </xsl:variable>
18902
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
18843
18903
  <xsl:variable name="regex_ja_spec_">[
18844
18904
  <!-- Rotate 90° clockwise -->
18845
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
18905
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
18846
18906
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
18847
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
18848
18907
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
18849
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
18850
18908
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
18851
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
18852
18909
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
18853
18910
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
18854
18911
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -18856,21 +18913,16 @@
18856
18913
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
18857
18914
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
18858
18915
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
18859
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
18860
18916
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
18861
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
18862
18917
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
18863
18918
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
18864
18919
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
18865
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
18866
18920
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
18867
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
18868
18921
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
18869
18922
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
18870
18923
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
18871
18924
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
18872
18925
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
18873
-
18874
18926
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
18875
18927
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
18876
18928
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -18902,6 +18954,7 @@
18902
18954
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
18903
18955
  <xsl:template name="insertVerticalChar">
18904
18956
  <xsl:param name="str"/>
18957
+ <xsl:param name="char_prev"/>
18905
18958
  <xsl:param name="writing-mode">lr-tb</xsl:param>
18906
18959
  <xsl:param name="reference-orientation">90</xsl:param>
18907
18960
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -18911,53 +18964,99 @@
18911
18964
  </xsl:when>
18912
18965
  <xsl:otherwise>
18913
18966
  <xsl:if test="string-length($str) &gt; 0">
18914
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
18967
+
18968
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
18915
18969
  <xsl:variable name="char" select="substring($str,1,1)"/>
18916
- <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">
18917
- <xsl:if test="normalize-space($writing-mode) != ''">
18918
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
18919
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
18920
- </xsl:if>
18921
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
18922
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
18923
- </xsl:if>
18924
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
18925
- <!-- Rotate 180°:
18926
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
18927
- U+3002 IDEOGRAPHIC FULL STOP (。)
18928
- U+FE52 SMALL FULL STOP (﹒)
18929
- U+FF0E FULLWIDTH FULL STOP ()
18930
- -->
18931
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
18932
- </xsl:if>
18933
- <fo:block-container width="1em">
18934
- <fo:block line-height="1em">
18935
- <xsl:choose>
18936
- <xsl:when test="$horizontal_mode = 'true'">
18937
- <xsl:value-of select="$str"/>
18938
- </xsl:when>
18939
- <xsl:otherwise>
18970
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
18971
+
18972
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
18973
+
18974
+ <xsl:choose>
18975
+ <xsl:when test="$char_half_width = 'true'">
18976
+ <fo:inline>
18977
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
18978
+ <xsl:value-of select="$char"/>
18979
+ </fo:inline>
18980
+ </xsl:when>
18981
+ <xsl:otherwise>
18982
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
18983
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
18984
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
18985
+ </xsl:if>
18986
+ <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">
18987
+ <xsl:if test="normalize-space($writing-mode) != ''">
18988
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
18989
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
18990
+ </xsl:if>
18991
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
18992
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
18993
+ </xsl:if>
18994
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
18995
+ <!-- Rotate 180°:
18996
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
18997
+ U+3002 IDEOGRAPHIC FULL STOP (。)
18998
+ U+FE52 SMALL FULL STOP (﹒)
18999
+ U+FF0E FULLWIDTH FULL STOP (.)
19000
+ -->
19001
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
19002
+ </xsl:if>
19003
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
19004
+ <fo:block line-height="1em" role="SKIP">
19005
+ <!-- <xsl:choose>
19006
+ <xsl:when test="$horizontal_mode = 'true'">
19007
+ <xsl:value-of select="$str"/>
19008
+ </xsl:when>
19009
+ <xsl:otherwise>
19010
+ <xsl:value-of select="$char"/>
19011
+ </xsl:otherwise>
19012
+ </xsl:choose> -->
18940
19013
  <xsl:value-of select="$char"/>
18941
- </xsl:otherwise>
18942
- </xsl:choose>
18943
- </fo:block>
18944
- </fo:block-container>
18945
- </fo:inline-container>
18946
- <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>
18947
-
18948
- <xsl:if test="$horizontal_mode = 'false'">
18949
- <xsl:call-template name="insertVerticalChar">
18950
- <xsl:with-param name="str" select="substring($str, 2)"/>
18951
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
18952
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
18953
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
18954
- </xsl:call-template>
18955
- </xsl:if>
19014
+ </fo:block>
19015
+ </fo:block-container>
19016
+ </fo:inline-container>
19017
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
19018
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
19019
+ </xsl:if>
19020
+ </xsl:otherwise>
19021
+ </xsl:choose>
19022
+
19023
+ <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>
19024
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
19025
+ <xsl:call-template name="insertVerticalChar">
19026
+ <xsl:with-param name="str" select="substring($str, 2)"/>
19027
+ <xsl:with-param name="char_prev" select="$char"/>
19028
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
19029
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
19030
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
19031
+ </xsl:call-template>
19032
+ <!-- </xsl:if> -->
18956
19033
  </xsl:if>
18957
19034
  </xsl:otherwise>
18958
19035
  </xsl:choose>
18959
19036
  </xsl:template>
18960
19037
 
19038
+ <xsl:template name="insertHorizontalChars">
19039
+ <xsl:param name="str"/>
19040
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
19041
+ <xsl:param name="reference-orientation">90</xsl:param>
19042
+ <xsl:param name="add_zero_width_space">false</xsl:param>
19043
+ <xsl:choose>
19044
+ <xsl:otherwise>
19045
+ <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">
19046
+ <xsl:if test="normalize-space($writing-mode) != ''">
19047
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
19048
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
19049
+ </xsl:if>
19050
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
19051
+ <fo:block line-height="1em" role="SKIP">
19052
+ <xsl:value-of select="$str"/>
19053
+ </fo:block>
19054
+ </fo:block-container>
19055
+ </fo:inline-container>
19056
+ </xsl:otherwise>
19057
+ </xsl:choose>
19058
+ </xsl:template>
19059
+
18961
19060
  <xsl:template name="number-to-words">
18962
19061
  <xsl:param name="number"/>
18963
19062
  <xsl:param name="first"/>