metanorma-cc 2.5.8 → 2.5.10

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: 8e6e2e0002ff5d21efb028567a37c919bf125671ff2e144d2cb1b79590e489b3
4
- data.tar.gz: 837f2cd8cdd5e69c90205f8d530852ce6238471e82e24914b2e3161fdbc48da8
3
+ metadata.gz: beff4398218564ac9cbaf3bd447151d6ca275086e01e1a9c5999c9ad6515246d
4
+ data.tar.gz: ccdd274f2e67a44ea41900888420ef97a655cd9c45f452d4e1763d91d57fd67a
5
5
  SHA512:
6
- metadata.gz: 3281c8b62a4e7f7d9b0e332f505c8c4cd876e88df7fb232fc0b33decc82f5895894ee71d17212a64d53eb17de3cb474368d95b7d81e6ae1afaab8167eeeaafc2
7
- data.tar.gz: bc278dfffa0784e265dc2bae58c6d2f856cb46e2264c337851ea328d5450eb300f8cd4fa6ba85095431abf96b43c94b7d8be65c701fda662ce7471a00484d253
6
+ metadata.gz: 2df226344aa62d4171e0c0e6ae10e93d9925793d70da127275d3e654ebf888921d3d9e2956e28f309eb34e2bc78a9e2a3bb3b79bec5fca0861dd4372601a8c50
7
+ data.tar.gz: ab00b4fe640ec8e69a31fb8a16733422491438901b606509d89c5b36b40040b164cdfe551f62c8d34150f1fc121c106e57b8109dcab6f0f1e25f99c06b056d5e
@@ -243,7 +243,7 @@
243
243
  </xsl:variable>
244
244
 
245
245
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
246
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//image or .//svg]">
246
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
247
247
 
248
248
  <!-- Copyright, Content, Foreword, etc. pages -->
249
249
  <fo:page-sequence master-reference="preface" format="i">
@@ -306,7 +306,7 @@
306
306
  </fo:page-sequence>
307
307
  </xsl:for-each>
308
308
 
309
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//image or .//svg]">
309
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
310
310
 
311
311
  <!-- Document Pages -->
312
312
  <fo:page-sequence master-reference="document" format="1" force-page-count="no-force">
@@ -679,8 +679,21 @@
679
679
 
680
680
  <!-- <xsl:strip-space elements="csd:xref"/> -->
681
681
 
682
- <xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
683
- <xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
682
+ <xsl:variable name="namespace_full_">
683
+ <xsl:choose>
684
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
685
+ <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/iso -->
686
+ </xsl:choose>
687
+ </xsl:variable>
688
+ <xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
689
+
690
+ <xsl:variable name="root_element_">
691
+ <xsl:choose>
692
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
693
+ <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
694
+ </xsl:choose>
695
+ </xsl:variable>
696
+ <xsl:variable name="root_element" select="normalize-space($root_element_)"/>
684
697
 
685
698
  <xsl:variable name="document_scheme" select="normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
686
699
 
@@ -3913,7 +3926,9 @@
3913
3926
  <fo:block role="SKIP">
3914
3927
 
3915
3928
  <xsl:if test="$isGenerateTableIF = 'true'">
3916
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3929
+
3930
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3931
+
3917
3932
  </xsl:if>
3918
3933
 
3919
3934
  <xsl:apply-templates/>
@@ -4932,7 +4947,17 @@
4932
4947
  <xsl:call-template name="refine_dt-cell-style"/>
4933
4948
 
4934
4949
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
4935
- <xsl:copy-of select="@id"/>
4950
+
4951
+ <xsl:choose>
4952
+ <xsl:when test="$isGenerateTableIF = 'true'">
4953
+
4954
+ <xsl:copy-of select="@id"/>
4955
+
4956
+ </xsl:when>
4957
+ <xsl:otherwise>
4958
+ <xsl:copy-of select="@id"/>
4959
+ </xsl:otherwise>
4960
+ </xsl:choose>
4936
4961
 
4937
4962
  <xsl:if test="normalize-space($key_iso) = 'true'">
4938
4963
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -4964,7 +4989,9 @@
4964
4989
  <fo:block role="SKIP">
4965
4990
 
4966
4991
  <xsl:if test="$isGenerateTableIF = 'true'">
4967
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4992
+
4993
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4994
+
4968
4995
  </xsl:if>
4969
4996
 
4970
4997
  <xsl:choose>
@@ -5443,6 +5470,12 @@
5443
5470
  </xsl:if>
5444
5471
  </xsl:template>
5445
5472
 
5473
+ <xsl:template match="*[local-name()='strike']">
5474
+ <fo:inline text-decoration="line-through">
5475
+ <xsl:apply-templates/>
5476
+ </fo:inline>
5477
+ </xsl:template>
5478
+
5446
5479
  <xsl:template match="*[local-name() = 'pagebreak']">
5447
5480
  <fo:block break-after="page"/>
5448
5481
  <fo:block> </fo:block>
@@ -6205,6 +6238,14 @@
6205
6238
  </xsl:for-each>
6206
6239
  </xsl:variable>
6207
6240
 
6241
+ <!-- <xsl:if test="$debug = 'true'">
6242
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
6243
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
6244
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
6245
+ <xsl:copy-of select="$words_with_width_sorted"/>
6246
+ </redirect:write>
6247
+ </xsl:if> -->
6248
+
6208
6249
  <xsl:variable name="words">
6209
6250
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
6210
6251
  <word>
@@ -6330,6 +6371,7 @@
6330
6371
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
6331
6372
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
6332
6373
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
6374
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
6333
6375
  </tags>
6334
6376
  </xsl:template>
6335
6377
  <!-- =============================== -->
@@ -6870,7 +6912,16 @@
6870
6912
  </xsl:when>
6871
6913
  <xsl:otherwise>
6872
6914
  <!-- output text from <link>text</link> -->
6873
- <xsl:apply-templates/>
6915
+ <xsl:choose>
6916
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
6917
+ <xsl:call-template name="add-zero-spaces-link-java">
6918
+ <xsl:with-param name="text" select="."/>
6919
+ </xsl:call-template>
6920
+ </xsl:when>
6921
+ <xsl:otherwise>
6922
+ <xsl:apply-templates/>
6923
+ </xsl:otherwise>
6924
+ </xsl:choose>
6874
6925
  </xsl:otherwise>
6875
6926
  </xsl:choose>
6876
6927
  </fo:basic-link>
@@ -7509,16 +7560,29 @@
7509
7560
  <xsl:template name="getImageSrc">
7510
7561
  <xsl:choose>
7511
7562
  <xsl:when test="not(starts-with(@src, 'data:'))">
7563
+ <xsl:call-template name="getImageSrcExternal"/>
7564
+ </xsl:when>
7565
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7566
+ </xsl:choose>
7567
+ </xsl:template>
7568
+
7569
+ <xsl:template name="getImageSrcExternal">
7570
+ <xsl:choose>
7571
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7572
+ <xsl:value-of select="@src"/>
7573
+ </xsl:when>
7574
+ <xsl:otherwise>
7575
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
7576
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
7512
7577
  <xsl:choose>
7513
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7514
- <xsl:value-of select="@src"/>
7578
+ <xsl:when test="$file_exists = 'true'">
7579
+ <xsl:value-of select="$src_with_basepath"/>
7515
7580
  </xsl:when>
7516
7581
  <xsl:otherwise>
7517
- <xsl:value-of select="concat($basepath, @src)"/>
7582
+ <xsl:value-of select="@src"/>
7518
7583
  </xsl:otherwise>
7519
7584
  </xsl:choose>
7520
- </xsl:when>
7521
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7585
+ </xsl:otherwise>
7522
7586
  </xsl:choose>
7523
7587
  </xsl:template>
7524
7588
 
@@ -7566,14 +7630,8 @@
7566
7630
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
7567
7631
  </xsl:when>
7568
7632
  <xsl:when test="not(starts-with(@src, 'data:'))">
7569
- <xsl:choose>
7570
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7571
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7572
- </xsl:when>
7573
- <xsl:otherwise>
7574
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7575
- </xsl:otherwise>
7576
- </xsl:choose>
7633
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
7634
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
7577
7635
  </xsl:when>
7578
7636
  <xsl:otherwise>
7579
7637
  <xsl:value-of select="@src"/>
@@ -7594,16 +7652,8 @@
7594
7652
  </svg>
7595
7653
  </xsl:when>
7596
7654
  <xsl:when test="not(starts-with(@src, 'data:'))">
7597
- <xsl:variable name="src">
7598
- <xsl:choose>
7599
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7600
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7601
- </xsl:when>
7602
- <xsl:otherwise>
7603
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7604
- </xsl:otherwise>
7605
- </xsl:choose>
7606
- </xsl:variable>
7655
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
7656
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
7607
7657
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7608
7658
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
7609
7659
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -11731,7 +11781,9 @@
11731
11781
  <xsl:template name="add_id">
11732
11782
  <xsl:if test="not(@id)">
11733
11783
  <!-- add @id - first element with @id plus '_element_name' -->
11734
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
11784
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
11785
+ <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>
11786
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
11735
11787
  </xsl:if>
11736
11788
  </xsl:template>
11737
11789
 
@@ -13036,6 +13088,7 @@
13036
13088
  <xsl:param name="formatted">false</xsl:param>
13037
13089
  <xsl:param name="lang"/>
13038
13090
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
13091
+ <xsl:param name="bibdata_updated"/>
13039
13092
 
13040
13093
  <xsl:variable name="curr_lang">
13041
13094
  <xsl:choose>
@@ -13049,6 +13102,9 @@
13049
13102
 
13050
13103
  <xsl:variable name="data_value">
13051
13104
  <xsl:choose>
13105
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
13106
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
13107
+ </xsl:when>
13052
13108
  <xsl:when test="$formatted = 'true'">
13053
13109
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
13054
13110
  </xsl:when>
@@ -13220,14 +13276,8 @@
13220
13276
  <xsl:value-of select="$src"/>
13221
13277
  </xsl:when>
13222
13278
  <xsl:otherwise>
13223
- <xsl:choose>
13224
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
13225
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
13226
- </xsl:when>
13227
- <xsl:otherwise>
13228
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13229
- </xsl:otherwise>
13230
- </xsl:choose>
13279
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
13280
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
13231
13281
  </xsl:otherwise>
13232
13282
  </xsl:choose>
13233
13283
  </xsl:template>
@@ -13249,15 +13299,23 @@
13249
13299
  <!-- END: insert cover page image -->
13250
13300
 
13251
13301
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
13302
+ <xsl:variable name="regex_ja_spec_half_width_">
13303
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
13304
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
13305
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
13306
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
13307
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
13308
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
13309
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
13310
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
13311
+ </xsl:variable>
13312
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
13252
13313
  <xsl:variable name="regex_ja_spec_">[
13253
13314
  <!-- Rotate 90° clockwise -->
13254
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
13315
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
13255
13316
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
13256
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
13257
13317
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
13258
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
13259
13318
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
13260
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
13261
13319
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
13262
13320
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
13263
13321
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -13265,21 +13323,16 @@
13265
13323
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
13266
13324
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
13267
13325
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
13268
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
13269
13326
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
13270
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
13271
13327
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
13272
13328
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
13273
13329
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
13274
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
13275
13330
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
13276
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
13277
13331
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
13278
13332
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
13279
13333
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
13280
13334
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
13281
13335
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
13282
-
13283
13336
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
13284
13337
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
13285
13338
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -13311,6 +13364,7 @@
13311
13364
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
13312
13365
  <xsl:template name="insertVerticalChar">
13313
13366
  <xsl:param name="str"/>
13367
+ <xsl:param name="char_prev"/>
13314
13368
  <xsl:param name="writing-mode">lr-tb</xsl:param>
13315
13369
  <xsl:param name="reference-orientation">90</xsl:param>
13316
13370
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -13320,53 +13374,99 @@
13320
13374
  </xsl:when>
13321
13375
  <xsl:otherwise>
13322
13376
  <xsl:if test="string-length($str) &gt; 0">
13323
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
13377
+
13378
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
13324
13379
  <xsl:variable name="char" select="substring($str,1,1)"/>
13325
- <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">
13326
- <xsl:if test="normalize-space($writing-mode) != ''">
13327
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13328
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
13329
- </xsl:if>
13330
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13331
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
13332
- </xsl:if>
13333
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
13334
- <!-- Rotate 180°:
13335
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
13336
- U+3002 IDEOGRAPHIC FULL STOP (。)
13337
- U+FE52 SMALL FULL STOP (﹒)
13338
- U+FF0E FULLWIDTH FULL STOP ()
13339
- -->
13340
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
13341
- </xsl:if>
13342
- <fo:block-container width="1em">
13343
- <fo:block line-height="1em">
13344
- <xsl:choose>
13345
- <xsl:when test="$horizontal_mode = 'true'">
13346
- <xsl:value-of select="$str"/>
13347
- </xsl:when>
13348
- <xsl:otherwise>
13380
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
13381
+
13382
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
13383
+
13384
+ <xsl:choose>
13385
+ <xsl:when test="$char_half_width = 'true'">
13386
+ <fo:inline>
13387
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
13388
+ <xsl:value-of select="$char"/>
13389
+ </fo:inline>
13390
+ </xsl:when>
13391
+ <xsl:otherwise>
13392
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
13393
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
13394
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
13395
+ </xsl:if>
13396
+ <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">
13397
+ <xsl:if test="normalize-space($writing-mode) != ''">
13398
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13399
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13400
+ </xsl:if>
13401
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13402
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
13403
+ </xsl:if>
13404
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
13405
+ <!-- Rotate 180°:
13406
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
13407
+ U+3002 IDEOGRAPHIC FULL STOP (。)
13408
+ U+FE52 SMALL FULL STOP (﹒)
13409
+ U+FF0E FULLWIDTH FULL STOP (.)
13410
+ -->
13411
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
13412
+ </xsl:if>
13413
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
13414
+ <fo:block line-height="1em" role="SKIP">
13415
+ <!-- <xsl:choose>
13416
+ <xsl:when test="$horizontal_mode = 'true'">
13417
+ <xsl:value-of select="$str"/>
13418
+ </xsl:when>
13419
+ <xsl:otherwise>
13420
+ <xsl:value-of select="$char"/>
13421
+ </xsl:otherwise>
13422
+ </xsl:choose> -->
13349
13423
  <xsl:value-of select="$char"/>
13350
- </xsl:otherwise>
13351
- </xsl:choose>
13352
- </fo:block>
13353
- </fo:block-container>
13354
- </fo:inline-container>
13355
- <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>
13356
-
13357
- <xsl:if test="$horizontal_mode = 'false'">
13358
- <xsl:call-template name="insertVerticalChar">
13359
- <xsl:with-param name="str" select="substring($str, 2)"/>
13360
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
13361
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13362
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
13363
- </xsl:call-template>
13364
- </xsl:if>
13424
+ </fo:block>
13425
+ </fo:block-container>
13426
+ </fo:inline-container>
13427
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
13428
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
13429
+ </xsl:if>
13430
+ </xsl:otherwise>
13431
+ </xsl:choose>
13432
+
13433
+ <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>
13434
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
13435
+ <xsl:call-template name="insertVerticalChar">
13436
+ <xsl:with-param name="str" select="substring($str, 2)"/>
13437
+ <xsl:with-param name="char_prev" select="$char"/>
13438
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
13439
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13440
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
13441
+ </xsl:call-template>
13442
+ <!-- </xsl:if> -->
13365
13443
  </xsl:if>
13366
13444
  </xsl:otherwise>
13367
13445
  </xsl:choose>
13368
13446
  </xsl:template>
13369
13447
 
13448
+ <xsl:template name="insertHorizontalChars">
13449
+ <xsl:param name="str"/>
13450
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
13451
+ <xsl:param name="reference-orientation">90</xsl:param>
13452
+ <xsl:param name="add_zero_width_space">false</xsl:param>
13453
+ <xsl:choose>
13454
+ <xsl:otherwise>
13455
+ <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">
13456
+ <xsl:if test="normalize-space($writing-mode) != ''">
13457
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13458
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13459
+ </xsl:if>
13460
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
13461
+ <fo:block line-height="1em" role="SKIP">
13462
+ <xsl:value-of select="$str"/>
13463
+ </fo:block>
13464
+ </fo:block-container>
13465
+ </fo:inline-container>
13466
+ </xsl:otherwise>
13467
+ </xsl:choose>
13468
+ </xsl:template>
13469
+
13370
13470
  <xsl:template name="number-to-words">
13371
13471
  <xsl:param name="number"/>
13372
13472
  <xsl:param name="first"/>
@@ -267,11 +267,11 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
267
267
  <a:documentation>An identifier of the person according to an international identifier scheme</a:documentation>
268
268
  </ref>
269
269
  </zeroOrMore>
270
- <zeroOrMore>
270
+ <optional>
271
271
  <ref name="contact">
272
272
  <a:documentation>Contact information for the person, including URI, address, phone number, and email</a:documentation>
273
273
  </ref>
274
- </zeroOrMore>
274
+ </optional>
275
275
  </element>
276
276
  </define>
277
277
  <define name="fullname">
@@ -454,11 +454,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
454
454
  <a:documentation>An identifier of the organization according to an international identifier scheme</a:documentation>
455
455
  </ref>
456
456
  </zeroOrMore>
457
- <zeroOrMore>
457
+ <optional>
458
458
  <ref name="contact">
459
459
  <a:documentation>Contact information for the organization, including address, phone number, and email</a:documentation>
460
460
  </ref>
461
- </zeroOrMore>
461
+ </optional>
462
462
  <optional>
463
463
  <ref name="logo">
464
464
  <a:documentation>A logo for the organization</a:documentation>
@@ -540,12 +540,18 @@ real names (if the person is named with a pseudonym or user name); previous lega
540
540
  <!-- TODO may change -->
541
541
  <define name="contact">
542
542
  <a:documentation>Contact information for a person or organization</a:documentation>
543
- <choice>
543
+ <zeroOrMore>
544
544
  <ref name="address"/>
545
+ </zeroOrMore>
546
+ <zeroOrMore>
545
547
  <ref name="phone"/>
548
+ </zeroOrMore>
549
+ <zeroOrMore>
546
550
  <ref name="email"/>
551
+ </zeroOrMore>
552
+ <zeroOrMore>
547
553
  <ref name="uri"/>
548
- </choice>
554
+ </zeroOrMore>
549
555
  </define>
550
556
  <define name="phone">
551
557
  <a:documentation>The phone number associated with a person or organization</a:documentation>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Cc
3
- VERSION = "2.5.8".freeze
3
+ VERSION = "2.5.10".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.8
4
+ version: 2.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -243,7 +243,7 @@ homepage: https://github.com/metanorma/metanorma-cc
243
243
  licenses:
244
244
  - BSD-2-Clause
245
245
  metadata: {}
246
- post_install_message:
246
+ post_install_message:
247
247
  rdoc_options: []
248
248
  require_paths:
249
249
  - lib
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  version: '0'
260
260
  requirements: []
261
261
  rubygems_version: 3.3.27
262
- signing_key:
262
+ signing_key:
263
263
  specification_version: 4
264
264
  summary: metanorma-cc lets you write CalConnect standards in AsciiDoc.
265
265
  test_files: []