metanorma-jis 0.0.9 → 0.0.10

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: 96fb5369c9530447626770ee760870db7070e6fd45aa3b1967c7dafaab62d4f1
4
- data.tar.gz: 325357b99ed0186f8297579404bed3a0935b9d5bbd4d43456330b18af8387bf0
3
+ metadata.gz: 1de2bc967e67625628eeb0c66b75e2c1276b28be7c03df0c367c4fde7aaf2f53
4
+ data.tar.gz: aa258e98b60ce190b9d34921a016d16bb9e0e898340cb8e6fe545dc45733482f
5
5
  SHA512:
6
- metadata.gz: 057bb29e1dce2f8a646f7ad95151111dbee6cc38effe9609d51a081b79e04e88eedea5c59eb6a541cce1f731d7036236a7a9be227d6ae5777c0448c2273dc495
7
- data.tar.gz: 2916496bebb78fbf748f177c67503143175abffcaa25adca5c96b3440c2e6d5a064a2d3461ef97816433da1745482ff869edf320f376d6cffc764908b2e72eec
6
+ metadata.gz: 14cae6306705404f86143d4e8d1fa0601167727aed32dd4801dcb59c75f85f8c811145eaf331ab10173edbbfc245f4241372c75a24e4c484584199d7fb555f74
7
+ data.tar.gz: 6378fa36481856db9419b5fc0eb94ab23340c425d6187546d52b7b55a135e5bc4f23d691687ea2b87b85743ec752c1b71c44b6055ba9f0833c1357ccea567f28
@@ -97,7 +97,7 @@ h1, h2, h3, h4, h5, h6 {
97
97
 
98
98
  blockquote, q {
99
99
  quotes: none; }
100
- blockquote:before, blockquote:after, q:before, q:after {
100
+ blockquote::before, blockquote::after, q::before, q::after {
101
101
  content: '';
102
102
  content: none; }
103
103
 
@@ -120,14 +120,18 @@ b, strong {
120
120
  div.document-stage-band, div.document-type-band {
121
121
  background-color: #333333; }
122
122
 
123
- a.FootnoteRef + a.FootnoteRef:before {
123
+ a.FootnoteRef + a.FootnoteRef::before {
124
124
  content: ", ";
125
125
  vertical-align: super; }
126
126
 
127
- a.TableFootnoteRef + a.TableFootnoteRef:before {
127
+ a.TableFootnoteRef + a.TableFootnoteRef::before {
128
128
  content: ", ";
129
129
  vertical-align: super; }
130
130
 
131
+ a.TableFootnoteRef, span.TableFootnoteRef,
132
+ a.FootnoteRef, span.FootnoteRef {
133
+ vertical-align: super; }
134
+
131
135
  .addition {
132
136
  color: blue; }
133
137
 
@@ -97,7 +97,7 @@ h1, h2, h3, h4, h5, h6 {
97
97
 
98
98
  blockquote, q {
99
99
  quotes: none; }
100
- blockquote:before, blockquote:after, q:before, q:after {
100
+ blockquote::before, blockquote::after, q::before, q::after {
101
101
  content: '';
102
102
  content: none; }
103
103
 
@@ -120,14 +120,18 @@ b, strong {
120
120
  div.document-stage-band, div.document-type-band {
121
121
  background-color: #333333; }
122
122
 
123
- a.FootnoteRef + a.FootnoteRef:before {
123
+ a.FootnoteRef + a.FootnoteRef::before {
124
124
  content: ", ";
125
125
  vertical-align: super; }
126
126
 
127
- a.TableFootnoteRef + a.TableFootnoteRef:before {
127
+ a.TableFootnoteRef + a.TableFootnoteRef::before {
128
128
  content: ", ";
129
129
  vertical-align: super; }
130
130
 
131
+ a.TableFootnoteRef, span.TableFootnoteRef,
132
+ a.FootnoteRef, span.FootnoteRef {
133
+ vertical-align: super; }
134
+
131
135
  .addition {
132
136
  color: blue; }
133
137
 
@@ -1167,6 +1167,46 @@
1167
1167
  </xsl:if>
1168
1168
  </xsl:template>
1169
1169
 
1170
+ <xsl:template match="*[local-name() = 'span'][@class = 'surname' or @class = 'givenname']" mode="update_xml_step1" priority="2">
1171
+ <xsl:copy>
1172
+ <xsl:apply-templates select="@* | node()" mode="update_xml_step1"/>
1173
+ </xsl:copy>
1174
+ </xsl:template>
1175
+
1176
+ <xsl:template match="jis:clause[@type = 'contributors']//jis:table//jis:span[@class = 'surname']/text()[string-length() &lt; 3]" priority="2">
1177
+ <xsl:choose>
1178
+ <xsl:when test="string-length() = 1">
1179
+ <xsl:value-of select="concat(.,'  ')"/>
1180
+ </xsl:when>
1181
+ <xsl:when test="string-length() = 2">
1182
+ <xsl:value-of select="concat(substring(.,1,1), ' ', substring(., 2))"/>
1183
+ </xsl:when>
1184
+ </xsl:choose>
1185
+ <xsl:if test="../following-sibling::node()[1][self::jis:span and @class = 'surname']"> <!-- if no space between surname and given name -->
1186
+ <xsl:text> </xsl:text>
1187
+ </xsl:if>
1188
+ </xsl:template>
1189
+
1190
+ <xsl:template match="jis:clause[@type = 'contributors']//jis:table//jis:span[@class = 'givenname']/text()[string-length() &lt; 3]" priority="2">
1191
+ <xsl:choose>
1192
+ <xsl:when test="string-length() = 1">
1193
+ <xsl:value-of select="concat('  ', .)"/>
1194
+ </xsl:when>
1195
+ <xsl:when test="string-length() = 2">
1196
+ <xsl:value-of select="concat(substring(.,1,1), ' ', substring(., 2))"/>
1197
+ </xsl:when>
1198
+ <xsl:otherwise>
1199
+ <xsl:value-of select="."/>
1200
+ </xsl:otherwise>
1201
+ </xsl:choose>
1202
+ </xsl:template>
1203
+
1204
+ <!-- space between surname and givenname replace by 'ideographic space' -->
1205
+ <!-- and following-sibling::node()[1][self::jis:span and @class = 'givenname'] -->
1206
+ <xsl:template match="jis:clause[@type = 'contributors']//jis:table//node()[preceding-sibling::node()[1][self::jis:span and @class = 'surname']][. = ' ']" priority="2">
1207
+ <xsl:text> </xsl:text>
1208
+ </xsl:template>
1209
+
1170
1210
  <xsl:template name="makePagedXML">
1171
1211
  <xsl:param name="structured_xml"/>
1172
1212
  <xsl:choose>
@@ -1571,19 +1611,32 @@
1571
1611
  <xsl:variable name="titles_">
1572
1612
 
1573
1613
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
1574
- <title-toc lang="en">
1575
-
1576
- </title-toc>
1577
- <title-toc lang="fr">
1614
+ <!-- <title-toc lang="en">
1615
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
1616
+ <xsl:text>Contents</xsl:text>
1617
+ </xsl:if>
1618
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
1619
+ <xsl:text>Table of Contents</xsl:text>
1620
+ </xsl:if>
1621
+ <xsl:if test="$namespace = 'gb'">
1622
+ <xsl:text>Table of contents</xsl:text>
1623
+ </xsl:if>
1624
+ </title-toc> -->
1625
+ <title-toc lang="en">Table of contents</title-toc>
1626
+ <!-- <title-toc lang="fr">
1578
1627
  <xsl:text>Sommaire</xsl:text>
1579
- </title-toc>
1580
- <title-toc lang="zh">
1581
-
1628
+ </title-toc> -->
1629
+ <!-- <title-toc lang="zh">
1630
+ <xsl:choose>
1631
+ <xsl:when test="$namespace = 'gb'">
1632
+ <xsl:text>目次</xsl:text>
1633
+ </xsl:when>
1634
+ <xsl:otherwise>
1582
1635
  <xsl:text>Contents</xsl:text>
1583
-
1584
- </title-toc>
1585
-
1586
- <title-descriptors lang="en">Descriptors</title-descriptors>
1636
+ </xsl:otherwise>
1637
+ </xsl:choose>
1638
+ </title-toc> -->
1639
+ <title-toc lang="zh">目次</title-toc>
1587
1640
 
1588
1641
  <title-part lang="en">
1589
1642
 
@@ -1599,20 +1652,6 @@
1599
1652
  <title-subpart lang="en">Sub-part #</title-subpart>
1600
1653
  <title-subpart lang="fr">Partie de sub #</title-subpart>
1601
1654
 
1602
- <title-list-tables lang="en">List of Tables</title-list-tables>
1603
-
1604
- <title-list-figures lang="en">List of Figures</title-list-figures>
1605
-
1606
- <title-table-figures lang="en">Table of Figures</title-table-figures>
1607
-
1608
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1609
-
1610
- <title-summary lang="en">Summary</title-summary>
1611
-
1612
- <title-continued lang="ru">(продолжение)</title-continued>
1613
- <title-continued lang="en">(continued)</title-continued>
1614
- <title-continued lang="fr">(continué)</title-continued>
1615
-
1616
1655
  </xsl:variable>
1617
1656
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1618
1657
 
@@ -1620,8 +1659,8 @@
1620
1659
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1621
1660
  <xsl:value-of select="$toc_table_title"/>
1622
1661
  <xsl:if test="normalize-space($toc_table_title) = ''">
1623
- <xsl:call-template name="getTitle">
1624
- <xsl:with-param name="name" select="'title-list-tables'"/>
1662
+ <xsl:call-template name="getLocalizedString">
1663
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
1625
1664
  </xsl:call-template>
1626
1665
  </xsl:if>
1627
1666
  </xsl:variable>
@@ -1630,8 +1669,8 @@
1630
1669
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1631
1670
  <xsl:value-of select="$toc_figure_title"/>
1632
1671
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1633
- <xsl:call-template name="getTitle">
1634
- <xsl:with-param name="name" select="'title-list-figures'"/>
1672
+ <xsl:call-template name="getLocalizedString">
1673
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
1635
1674
  </xsl:call-template>
1636
1675
  </xsl:if>
1637
1676
  </xsl:variable>
@@ -1640,8 +1679,8 @@
1640
1679
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1641
1680
  <xsl:value-of select="$toc_requirement_title"/>
1642
1681
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1643
- <xsl:call-template name="getTitle">
1644
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
1682
+ <xsl:call-template name="getLocalizedString">
1683
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1645
1684
  </xsl:call-template>
1646
1685
  </xsl:if>
1647
1686
  </xsl:variable>
@@ -5401,7 +5440,7 @@
5401
5440
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
5402
5441
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
5403
5442
  <xsl:choose>
5404
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
5443
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
5405
5444
  <!-- url -->
5406
5445
  <xsl:call-template name="add-zero-spaces-link-java"/>
5407
5446
  </xsl:when>
@@ -5867,10 +5906,13 @@
5867
5906
  </xsl:choose>
5868
5907
  </xsl:variable>
5869
5908
 
5909
+ <!-- replace sequence #x200B to one &#x200B -->
5910
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5911
+
5870
5912
  <!-- replace sequence #x200B and space TO space -->
5871
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5913
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5872
5914
 
5873
- <xsl:value-of select="$text10"/>
5915
+ <xsl:value-of select="$text11"/>
5874
5916
  </xsl:template>
5875
5917
 
5876
5918
  <xsl:template name="add-zero-spaces-link-java">
@@ -5880,8 +5922,12 @@
5880
5922
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5881
5923
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5882
5924
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5925
+
5926
+ <!-- replace sequence #x200B to one &#x200B -->
5927
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5928
+
5883
5929
  <!-- remove zero-width space at the end -->
5884
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5930
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5885
5931
  </xsl:template>
5886
5932
 
5887
5933
  <!-- add zero space after dash character (for table's entries) -->
@@ -7176,12 +7222,12 @@
7176
7222
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7177
7223
  <xsl:choose>
7178
7224
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
7179
- <fo:inline xsl:use-attribute-sets="note-p-style">
7225
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
7180
7226
  <xsl:apply-templates/>
7181
7227
  </fo:inline>
7182
7228
  </xsl:when>
7183
7229
  <xsl:otherwise>
7184
- <fo:block xsl:use-attribute-sets="note-p-style">
7230
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
7185
7231
  <xsl:apply-templates/>
7186
7232
  </fo:block>
7187
7233
  </xsl:otherwise>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module JIS
3
- VERSION = "0.0.9".freeze
3
+ VERSION = "0.0.10".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-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-07 00:00:00.000000000 Z
11
+ date: 2023-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso