metanorma-iec 2.5.9 → 2.5.11

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: 5d0becaffcc3cd620e5f2b1d87977bb658288535432eec52e4a63ee7f06b3977
4
- data.tar.gz: 531a8328fbe227e5f9a948d7acc09404bd6a16ace11baf9dabc91d2662147252
3
+ metadata.gz: ed4a618c9e1ba0726ed92aa754be91fc050633dfcc14200f8ca1df0770d6e6e2
4
+ data.tar.gz: 79c04caf59bb6e617d2e7a2481673af29cd11d43c44c17cd625b554567a1f43d
5
5
  SHA512:
6
- metadata.gz: 7e5a09441f37e50e32afd63f558898e95c3da2e5fb1f03cea2ee50cbc7d06fca1b466b6b5cee2dca750da5597923378d675476aa56e5a70d8b2a9c247657a0ba
7
- data.tar.gz: eec7c45f07955eccc9e66433fdbcecf490840f357ca6fe327d7e1e457f75ecf545a889cc537d652f3e899d2404b1998f559bf28be44087f1ce37003049afd642
6
+ metadata.gz: 81d946a173c03c2782a6c20c4ba5a42396605778fb8780446256b8e303731d0c3ce5813cb5c9ad60c38e0f9091250d589e18dc7dd0fd8dbfdef4eb329f6dd4b1
7
+ data.tar.gz: f9e096af9bc5e8f8e34b6ded0a600dcfdedf3fc636555663fc85c30558fdd9a54539382ca5cbc871760bc47b26669dc6d0b0a9023d3ea16a8c52f47501f65ac6
@@ -1411,7 +1411,7 @@
1411
1411
  <xsl:template name="insertPrefacepages">
1412
1412
  <xsl:param name="num"/>
1413
1413
 
1414
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//image or .//svg]">
1414
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
1415
1415
 
1416
1416
  <fo:page-sequence master-reference="document" format="1" force-page-count="no-force">
1417
1417
 
@@ -1444,7 +1444,7 @@
1444
1444
  <xsl:param name="lang" select="'en'"/>
1445
1445
  <!-- BODY -->
1446
1446
 
1447
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//image or .//svg]">
1447
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
1448
1448
 
1449
1449
  <fo:page-sequence master-reference="document" force-page-count="no-force">
1450
1450
 
@@ -2172,8 +2172,21 @@
2172
2172
 
2173
2173
  <!-- <xsl:strip-space elements="iec:xref"/> -->
2174
2174
 
2175
- <xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
2176
- <xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
2175
+ <xsl:variable name="namespace_full_">
2176
+ <xsl:choose>
2177
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
2178
+ <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/iso -->
2179
+ </xsl:choose>
2180
+ </xsl:variable>
2181
+ <xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
2182
+
2183
+ <xsl:variable name="root_element_">
2184
+ <xsl:choose>
2185
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
2186
+ <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
2187
+ </xsl:choose>
2188
+ </xsl:variable>
2189
+ <xsl:variable name="root_element" select="normalize-space($root_element_)"/>
2177
2190
 
2178
2191
  <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'])"/>
2179
2192
 
@@ -5594,7 +5607,9 @@
5594
5607
  <fo:block role="SKIP">
5595
5608
 
5596
5609
  <xsl:if test="$isGenerateTableIF = 'true'">
5597
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5610
+
5611
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
5612
+
5598
5613
  </xsl:if>
5599
5614
 
5600
5615
  <xsl:apply-templates/>
@@ -6627,7 +6642,17 @@
6627
6642
  <xsl:call-template name="refine_dt-cell-style"/>
6628
6643
 
6629
6644
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
6630
- <xsl:copy-of select="@id"/>
6645
+
6646
+ <xsl:choose>
6647
+ <xsl:when test="$isGenerateTableIF = 'true'">
6648
+
6649
+ <xsl:copy-of select="@id"/>
6650
+
6651
+ </xsl:when>
6652
+ <xsl:otherwise>
6653
+ <xsl:copy-of select="@id"/>
6654
+ </xsl:otherwise>
6655
+ </xsl:choose>
6631
6656
 
6632
6657
  <xsl:if test="normalize-space($key_iso) = 'true'">
6633
6658
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -6659,7 +6684,9 @@
6659
6684
  <fo:block role="SKIP">
6660
6685
 
6661
6686
  <xsl:if test="$isGenerateTableIF = 'true'">
6662
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
6687
+
6688
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
6689
+
6663
6690
  </xsl:if>
6664
6691
 
6665
6692
  <xsl:choose>
@@ -7137,6 +7164,12 @@
7137
7164
  </xsl:if>
7138
7165
  </xsl:template>
7139
7166
 
7167
+ <xsl:template match="*[local-name()='strike']">
7168
+ <fo:inline text-decoration="line-through">
7169
+ <xsl:apply-templates/>
7170
+ </fo:inline>
7171
+ </xsl:template>
7172
+
7140
7173
  <xsl:template match="*[local-name() = 'pagebreak']">
7141
7174
  <fo:block break-after="page"/>
7142
7175
  <fo:block> </fo:block>
@@ -7970,6 +8003,14 @@
7970
8003
  </xsl:for-each>
7971
8004
  </xsl:variable>
7972
8005
 
8006
+ <!-- <xsl:if test="$debug = 'true'">
8007
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
8008
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
8009
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
8010
+ <xsl:copy-of select="$words_with_width_sorted"/>
8011
+ </redirect:write>
8012
+ </xsl:if> -->
8013
+
7973
8014
  <xsl:variable name="words">
7974
8015
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
7975
8016
  <word>
@@ -8095,6 +8136,7 @@
8095
8136
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
8096
8137
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
8097
8138
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
8139
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
8098
8140
  </tags>
8099
8141
  </xsl:template>
8100
8142
  <!-- =============================== -->
@@ -8635,7 +8677,16 @@
8635
8677
  </xsl:when>
8636
8678
  <xsl:otherwise>
8637
8679
  <!-- output text from <link>text</link> -->
8638
- <xsl:apply-templates/>
8680
+ <xsl:choose>
8681
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
8682
+ <xsl:call-template name="add-zero-spaces-link-java">
8683
+ <xsl:with-param name="text" select="."/>
8684
+ </xsl:call-template>
8685
+ </xsl:when>
8686
+ <xsl:otherwise>
8687
+ <xsl:apply-templates/>
8688
+ </xsl:otherwise>
8689
+ </xsl:choose>
8639
8690
  </xsl:otherwise>
8640
8691
  </xsl:choose>
8641
8692
  </fo:basic-link>
@@ -9276,16 +9327,29 @@
9276
9327
  <xsl:template name="getImageSrc">
9277
9328
  <xsl:choose>
9278
9329
  <xsl:when test="not(starts-with(@src, 'data:'))">
9330
+ <xsl:call-template name="getImageSrcExternal"/>
9331
+ </xsl:when>
9332
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
9333
+ </xsl:choose>
9334
+ </xsl:template>
9335
+
9336
+ <xsl:template name="getImageSrcExternal">
9337
+ <xsl:choose>
9338
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
9339
+ <xsl:value-of select="@src"/>
9340
+ </xsl:when>
9341
+ <xsl:otherwise>
9342
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
9343
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
9279
9344
  <xsl:choose>
9280
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
9281
- <xsl:value-of select="@src"/>
9345
+ <xsl:when test="$file_exists = 'true'">
9346
+ <xsl:value-of select="$src_with_basepath"/>
9282
9347
  </xsl:when>
9283
9348
  <xsl:otherwise>
9284
- <xsl:value-of select="concat($basepath, @src)"/>
9349
+ <xsl:value-of select="@src"/>
9285
9350
  </xsl:otherwise>
9286
9351
  </xsl:choose>
9287
- </xsl:when>
9288
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
9352
+ </xsl:otherwise>
9289
9353
  </xsl:choose>
9290
9354
  </xsl:template>
9291
9355
 
@@ -9333,14 +9397,8 @@
9333
9397
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
9334
9398
  </xsl:when>
9335
9399
  <xsl:when test="not(starts-with(@src, 'data:'))">
9336
- <xsl:choose>
9337
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
9338
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
9339
- </xsl:when>
9340
- <xsl:otherwise>
9341
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
9342
- </xsl:otherwise>
9343
- </xsl:choose>
9400
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
9401
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
9344
9402
  </xsl:when>
9345
9403
  <xsl:otherwise>
9346
9404
  <xsl:value-of select="@src"/>
@@ -9361,16 +9419,8 @@
9361
9419
  </svg>
9362
9420
  </xsl:when>
9363
9421
  <xsl:when test="not(starts-with(@src, 'data:'))">
9364
- <xsl:variable name="src">
9365
- <xsl:choose>
9366
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
9367
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
9368
- </xsl:when>
9369
- <xsl:otherwise>
9370
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
9371
- </xsl:otherwise>
9372
- </xsl:choose>
9373
- </xsl:variable>
9422
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
9423
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
9374
9424
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
9375
9425
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
9376
9426
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -13512,7 +13562,9 @@
13512
13562
  <xsl:template name="add_id">
13513
13563
  <xsl:if test="not(@id)">
13514
13564
  <!-- add @id - first element with @id plus '_element_name' -->
13515
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
13565
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
13566
+ <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>
13567
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
13516
13568
  </xsl:if>
13517
13569
  </xsl:template>
13518
13570
 
@@ -14444,7 +14496,14 @@
14444
14496
  <xsl:variable name="title">
14445
14497
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
14446
14498
 
14447
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
14499
+ <xsl:choose>
14500
+ <xsl:when test="*[local-name() = 'title'][@language = $lang and @type = 'main']">
14501
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
14502
+ </xsl:when>
14503
+ <xsl:otherwise>
14504
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'title-main']"/>
14505
+ </xsl:otherwise>
14506
+ </xsl:choose>
14448
14507
 
14449
14508
  </xsl:for-each>
14450
14509
  </xsl:variable>
@@ -14817,6 +14876,7 @@
14817
14876
  <xsl:param name="formatted">false</xsl:param>
14818
14877
  <xsl:param name="lang"/>
14819
14878
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
14879
+ <xsl:param name="bibdata_updated"/>
14820
14880
 
14821
14881
  <xsl:variable name="curr_lang">
14822
14882
  <xsl:choose>
@@ -14830,6 +14890,9 @@
14830
14890
 
14831
14891
  <xsl:variable name="data_value">
14832
14892
  <xsl:choose>
14893
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
14894
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14895
+ </xsl:when>
14833
14896
  <xsl:when test="$formatted = 'true'">
14834
14897
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14835
14898
  </xsl:when>
@@ -15001,14 +15064,8 @@
15001
15064
  <xsl:value-of select="$src"/>
15002
15065
  </xsl:when>
15003
15066
  <xsl:otherwise>
15004
- <xsl:choose>
15005
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
15006
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
15007
- </xsl:when>
15008
- <xsl:otherwise>
15009
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
15010
- </xsl:otherwise>
15011
- </xsl:choose>
15067
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
15068
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
15012
15069
  </xsl:otherwise>
15013
15070
  </xsl:choose>
15014
15071
  </xsl:template>
@@ -15030,15 +15087,23 @@
15030
15087
  <!-- END: insert cover page image -->
15031
15088
 
15032
15089
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
15090
+ <xsl:variable name="regex_ja_spec_half_width_">
15091
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
15092
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
15093
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
15094
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
15095
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
15096
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
15097
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
15098
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
15099
+ </xsl:variable>
15100
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
15033
15101
  <xsl:variable name="regex_ja_spec_">[
15034
15102
  <!-- Rotate 90° clockwise -->
15035
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
15103
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
15036
15104
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
15037
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
15038
15105
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
15039
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
15040
15106
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
15041
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
15042
15107
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
15043
15108
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
15044
15109
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -15046,21 +15111,16 @@
15046
15111
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
15047
15112
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
15048
15113
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
15049
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
15050
15114
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
15051
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
15052
15115
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
15053
15116
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
15054
15117
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
15055
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
15056
15118
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
15057
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
15058
15119
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
15059
15120
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
15060
15121
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
15061
15122
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
15062
15123
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
15063
-
15064
15124
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
15065
15125
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
15066
15126
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -15092,6 +15152,7 @@
15092
15152
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
15093
15153
  <xsl:template name="insertVerticalChar">
15094
15154
  <xsl:param name="str"/>
15155
+ <xsl:param name="char_prev"/>
15095
15156
  <xsl:param name="writing-mode">lr-tb</xsl:param>
15096
15157
  <xsl:param name="reference-orientation">90</xsl:param>
15097
15158
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -15101,53 +15162,99 @@
15101
15162
  </xsl:when>
15102
15163
  <xsl:otherwise>
15103
15164
  <xsl:if test="string-length($str) &gt; 0">
15104
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
15165
+
15166
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
15105
15167
  <xsl:variable name="char" select="substring($str,1,1)"/>
15106
- <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">
15107
- <xsl:if test="normalize-space($writing-mode) != ''">
15108
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
15109
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
15110
- </xsl:if>
15111
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
15112
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
15113
- </xsl:if>
15114
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
15115
- <!-- Rotate 180°:
15116
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
15117
- U+3002 IDEOGRAPHIC FULL STOP (。)
15118
- U+FE52 SMALL FULL STOP (﹒)
15119
- U+FF0E FULLWIDTH FULL STOP ()
15120
- -->
15121
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
15122
- </xsl:if>
15123
- <fo:block-container width="1em">
15124
- <fo:block line-height="1em">
15125
- <xsl:choose>
15126
- <xsl:when test="$horizontal_mode = 'true'">
15127
- <xsl:value-of select="$str"/>
15128
- </xsl:when>
15129
- <xsl:otherwise>
15168
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
15169
+
15170
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
15171
+
15172
+ <xsl:choose>
15173
+ <xsl:when test="$char_half_width = 'true'">
15174
+ <fo:inline>
15175
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
15176
+ <xsl:value-of select="$char"/>
15177
+ </fo:inline>
15178
+ </xsl:when>
15179
+ <xsl:otherwise>
15180
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
15181
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
15182
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
15183
+ </xsl:if>
15184
+ <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">
15185
+ <xsl:if test="normalize-space($writing-mode) != ''">
15186
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
15187
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
15188
+ </xsl:if>
15189
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
15190
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
15191
+ </xsl:if>
15192
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
15193
+ <!-- Rotate 180°:
15194
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
15195
+ U+3002 IDEOGRAPHIC FULL STOP (。)
15196
+ U+FE52 SMALL FULL STOP (﹒)
15197
+ U+FF0E FULLWIDTH FULL STOP (.)
15198
+ -->
15199
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
15200
+ </xsl:if>
15201
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
15202
+ <fo:block line-height="1em" role="SKIP">
15203
+ <!-- <xsl:choose>
15204
+ <xsl:when test="$horizontal_mode = 'true'">
15205
+ <xsl:value-of select="$str"/>
15206
+ </xsl:when>
15207
+ <xsl:otherwise>
15208
+ <xsl:value-of select="$char"/>
15209
+ </xsl:otherwise>
15210
+ </xsl:choose> -->
15130
15211
  <xsl:value-of select="$char"/>
15131
- </xsl:otherwise>
15132
- </xsl:choose>
15133
- </fo:block>
15134
- </fo:block-container>
15135
- </fo:inline-container>
15136
- <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>
15137
-
15138
- <xsl:if test="$horizontal_mode = 'false'">
15139
- <xsl:call-template name="insertVerticalChar">
15140
- <xsl:with-param name="str" select="substring($str, 2)"/>
15141
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
15142
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
15143
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
15144
- </xsl:call-template>
15145
- </xsl:if>
15212
+ </fo:block>
15213
+ </fo:block-container>
15214
+ </fo:inline-container>
15215
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
15216
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
15217
+ </xsl:if>
15218
+ </xsl:otherwise>
15219
+ </xsl:choose>
15220
+
15221
+ <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>
15222
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
15223
+ <xsl:call-template name="insertVerticalChar">
15224
+ <xsl:with-param name="str" select="substring($str, 2)"/>
15225
+ <xsl:with-param name="char_prev" select="$char"/>
15226
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
15227
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
15228
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
15229
+ </xsl:call-template>
15230
+ <!-- </xsl:if> -->
15146
15231
  </xsl:if>
15147
15232
  </xsl:otherwise>
15148
15233
  </xsl:choose>
15149
15234
  </xsl:template>
15150
15235
 
15236
+ <xsl:template name="insertHorizontalChars">
15237
+ <xsl:param name="str"/>
15238
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
15239
+ <xsl:param name="reference-orientation">90</xsl:param>
15240
+ <xsl:param name="add_zero_width_space">false</xsl:param>
15241
+ <xsl:choose>
15242
+ <xsl:otherwise>
15243
+ <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">
15244
+ <xsl:if test="normalize-space($writing-mode) != ''">
15245
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
15246
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
15247
+ </xsl:if>
15248
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
15249
+ <fo:block line-height="1em" role="SKIP">
15250
+ <xsl:value-of select="$str"/>
15251
+ </fo:block>
15252
+ </fo:block-container>
15253
+ </fo:inline-container>
15254
+ </xsl:otherwise>
15255
+ </xsl:choose>
15256
+ </xsl:template>
15257
+
15151
15258
  <xsl:template name="number-to-words">
15152
15259
  <xsl:param name="number"/>
15153
15260
  <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,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.5.9".freeze
3
+ VERSION = "2.5.11".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.9
4
+ version: 2.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
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-iso
@@ -273,7 +273,7 @@ homepage: https://github.com/metanorma/metanorma-iec
273
273
  licenses:
274
274
  - BSD-2-Clause
275
275
  metadata: {}
276
- post_install_message:
276
+ post_install_message:
277
277
  rdoc_options: []
278
278
  require_paths:
279
279
  - lib
@@ -289,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
289
  version: '0'
290
290
  requirements: []
291
291
  rubygems_version: 3.3.27
292
- signing_key:
292
+ signing_key:
293
293
  specification_version: 4
294
294
  summary: metanorma-iec lets you write IEC standards in AsciiDoc.
295
295
  test_files: []