metanorma-ogc 2.0.5 → 2.0.6

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: 056640c9b99f89ac5e10954d3902f72441ec971b2245724e15d47a7f65e20b62
4
- data.tar.gz: 8dd6622cd5bdd70472865ce662e23a555db66f661d33f274bff9cb4b9a2d4742
3
+ metadata.gz: 61e36c2e89b6b98ad39875845197c8614cd4c1906f4d6f4e2359cc33c7933010
4
+ data.tar.gz: 151018908ddb1823476252db5ea5a196854999365e34f678c47d9c5f3775c2a9
5
5
  SHA512:
6
- metadata.gz: 68082bdefeadf5e0be4ac14485c32ee8514788c1734ec10ddab4c449f5d454014834311290a7837002b7022f73811e24ab1ddc66ac8475899357c2a2f7d54b69
7
- data.tar.gz: da8f7bc31006422fa95fc20b99392fe218ef18d9c7335c0d929c2437ed0d438678644e5e200f7c2e7de6ab262d5579dcbf5f857d2cbba0840453817554d42396
6
+ metadata.gz: 1ac0c8664160741ddaff9f625c64663338d6c1fd176f6b2d60f59d0810c3b448865cadeb5a15c1a269542cfce7fb98dc192b5a90a9dcb37d18e010db2f1127fc
7
+ data.tar.gz: d9b93b3c092a5d9b57d6ce03b8cf865e82ae04f0cb1faaf9feb55a2b67f9827aa7a8a511c6afcbd8fc202c6d12e393f8e2f8e6008c249f9d19448d53af037326
@@ -1451,7 +1451,7 @@
1451
1451
  </fo:static-content>
1452
1452
  </xsl:template>
1453
1453
 
1454
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:key name="bibitems" match="*[local-name() = 'bibitem']" use="@id"/><xsl:key name="bibitems_hidden" match="*[local-name() = 'bibitem'][@hidden='true'] | *[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']" use="@id"/><xsl:variable name="lang">
1454
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
1455
1455
  <xsl:call-template name="getLang"/>
1456
1456
  </xsl:variable><xsl:variable name="pageWidth_">
1457
1457
  215.9
@@ -6113,7 +6113,51 @@
6113
6113
  <xsl:with-param name="text" select="$text_step1"/>
6114
6114
  </xsl:call-template>
6115
6115
  </xsl:variable>
6116
- <xsl:value-of select="$text_step2"/>
6116
+
6117
+ <!-- <xsl:value-of select="$text_step2"/> -->
6118
+
6119
+ <!-- add zero-width space after space -->
6120
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
6121
+
6122
+ <!-- split text by zero-width space -->
6123
+ <xsl:variable name="text_step4">
6124
+ <xsl:call-template name="split">
6125
+ <xsl:with-param name="pText" select="$text_step3"/>
6126
+ <xsl:with-param name="sep" select="$zero_width_space"/>
6127
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
6128
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
6129
+ </xsl:call-template>
6130
+ </xsl:variable>
6131
+
6132
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
6133
+ <xsl:choose>
6134
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6135
+ <xsl:call-template name="interspers">
6136
+ <xsl:with-param name="str" select="."/>
6137
+ </xsl:call-template>
6138
+ </xsl:when>
6139
+ <xsl:otherwise>
6140
+ <xsl:value-of select="."/>
6141
+ </xsl:otherwise>
6142
+ </xsl:choose>
6143
+ </xsl:for-each>
6144
+
6145
+ </xsl:template><xsl:template name="interspers">
6146
+ <xsl:param name="str"/>
6147
+ <xsl:param name="char" select="$zero_width_space"/>
6148
+ <xsl:if test="$str != ''">
6149
+ <xsl:value-of select="substring($str, 1, 1)"/>
6150
+
6151
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
6152
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
6153
+ <xsl:value-of select="$char"/>
6154
+ </xsl:if>
6155
+
6156
+ <xsl:call-template name="interspers">
6157
+ <xsl:with-param name="str" select="substring($str, 2)"/>
6158
+ <xsl:with-param name="char" select="$char"/>
6159
+ </xsl:call-template>
6160
+ </xsl:if>
6117
6161
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6118
6162
  <xsl:apply-templates mode="syntax_highlight"/>
6119
6163
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -6631,11 +6675,24 @@
6631
6675
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6632
6676
  <xsl:text>— </xsl:text>
6633
6677
  <xsl:apply-templates/>
6634
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6678
+ </xsl:template><xsl:variable name="bibitems_">
6679
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
6680
+ <xsl:copy-of select="."/>
6681
+ </xsl:for-each>
6682
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
6683
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6684
+ <xsl:copy-of select="."/>
6685
+ </xsl:for-each>
6686
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
6687
+ <xsl:copy-of select="."/>
6688
+ </xsl:for-each>
6689
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6635
6690
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
6636
- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
6691
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
6692
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
6637
6693
  <xsl:choose>
6638
- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6694
+ <!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6695
+ <xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6639
6696
  <fo:inline xsl:use-attribute-sets="eref-style">
6640
6697
  <xsl:if test="@type = 'footnote'">
6641
6698
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -7881,7 +7938,7 @@
7881
7938
  <xsl:copy>
7882
7939
  <xsl:copy-of select="@*"/>
7883
7940
  <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
7884
- <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
7941
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
7885
7942
  <xsl:sort select="@displayorder" data-type="number"/>
7886
7943
  <xsl:apply-templates select="." mode="update_xml_step1"/>
7887
7944
  </xsl:for-each>
@@ -8130,22 +8187,25 @@
8130
8187
  <xsl:param name="pText" select="."/>
8131
8188
  <xsl:param name="sep" select="','"/>
8132
8189
  <xsl:param name="normalize-space" select="'true'"/>
8190
+ <xsl:param name="keep_sep" select="'false'"/>
8133
8191
  <xsl:if test="string-length($pText) &gt;0">
8134
- <item>
8135
- <xsl:choose>
8136
- <xsl:when test="$normalize-space = 'true'">
8137
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8138
- </xsl:when>
8139
- <xsl:otherwise>
8140
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8141
- </xsl:otherwise>
8142
- </xsl:choose>
8143
- </item>
8144
- <xsl:call-template name="split">
8145
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8146
- <xsl:with-param name="sep" select="$sep"/>
8147
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
8148
- </xsl:call-template>
8192
+ <item>
8193
+ <xsl:choose>
8194
+ <xsl:when test="$normalize-space = 'true'">
8195
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8196
+ </xsl:when>
8197
+ <xsl:otherwise>
8198
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8199
+ </xsl:otherwise>
8200
+ </xsl:choose>
8201
+ </item>
8202
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
8203
+ <xsl:call-template name="split">
8204
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8205
+ <xsl:with-param name="sep" select="$sep"/>
8206
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
8207
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
8208
+ </xsl:call-template>
8149
8209
  </xsl:if>
8150
8210
  </xsl:template><xsl:template name="getDocumentId">
8151
8211
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
@@ -1451,7 +1451,7 @@
1451
1451
  </fo:static-content>
1452
1452
  </xsl:template>
1453
1453
 
1454
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:key name="bibitems" match="*[local-name() = 'bibitem']" use="@id"/><xsl:key name="bibitems_hidden" match="*[local-name() = 'bibitem'][@hidden='true'] | *[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']" use="@id"/><xsl:variable name="lang">
1454
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
1455
1455
  <xsl:call-template name="getLang"/>
1456
1456
  </xsl:variable><xsl:variable name="pageWidth_">
1457
1457
  215.9
@@ -6113,7 +6113,51 @@
6113
6113
  <xsl:with-param name="text" select="$text_step1"/>
6114
6114
  </xsl:call-template>
6115
6115
  </xsl:variable>
6116
- <xsl:value-of select="$text_step2"/>
6116
+
6117
+ <!-- <xsl:value-of select="$text_step2"/> -->
6118
+
6119
+ <!-- add zero-width space after space -->
6120
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
6121
+
6122
+ <!-- split text by zero-width space -->
6123
+ <xsl:variable name="text_step4">
6124
+ <xsl:call-template name="split">
6125
+ <xsl:with-param name="pText" select="$text_step3"/>
6126
+ <xsl:with-param name="sep" select="$zero_width_space"/>
6127
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
6128
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
6129
+ </xsl:call-template>
6130
+ </xsl:variable>
6131
+
6132
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
6133
+ <xsl:choose>
6134
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6135
+ <xsl:call-template name="interspers">
6136
+ <xsl:with-param name="str" select="."/>
6137
+ </xsl:call-template>
6138
+ </xsl:when>
6139
+ <xsl:otherwise>
6140
+ <xsl:value-of select="."/>
6141
+ </xsl:otherwise>
6142
+ </xsl:choose>
6143
+ </xsl:for-each>
6144
+
6145
+ </xsl:template><xsl:template name="interspers">
6146
+ <xsl:param name="str"/>
6147
+ <xsl:param name="char" select="$zero_width_space"/>
6148
+ <xsl:if test="$str != ''">
6149
+ <xsl:value-of select="substring($str, 1, 1)"/>
6150
+
6151
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
6152
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
6153
+ <xsl:value-of select="$char"/>
6154
+ </xsl:if>
6155
+
6156
+ <xsl:call-template name="interspers">
6157
+ <xsl:with-param name="str" select="substring($str, 2)"/>
6158
+ <xsl:with-param name="char" select="$char"/>
6159
+ </xsl:call-template>
6160
+ </xsl:if>
6117
6161
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6118
6162
  <xsl:apply-templates mode="syntax_highlight"/>
6119
6163
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -6631,11 +6675,24 @@
6631
6675
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6632
6676
  <xsl:text>— </xsl:text>
6633
6677
  <xsl:apply-templates/>
6634
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6678
+ </xsl:template><xsl:variable name="bibitems_">
6679
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
6680
+ <xsl:copy-of select="."/>
6681
+ </xsl:for-each>
6682
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
6683
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6684
+ <xsl:copy-of select="."/>
6685
+ </xsl:for-each>
6686
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
6687
+ <xsl:copy-of select="."/>
6688
+ </xsl:for-each>
6689
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6635
6690
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
6636
- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
6691
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
6692
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
6637
6693
  <xsl:choose>
6638
- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6694
+ <!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6695
+ <xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6639
6696
  <fo:inline xsl:use-attribute-sets="eref-style">
6640
6697
  <xsl:if test="@type = 'footnote'">
6641
6698
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -7881,7 +7938,7 @@
7881
7938
  <xsl:copy>
7882
7939
  <xsl:copy-of select="@*"/>
7883
7940
  <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
7884
- <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
7941
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
7885
7942
  <xsl:sort select="@displayorder" data-type="number"/>
7886
7943
  <xsl:apply-templates select="." mode="update_xml_step1"/>
7887
7944
  </xsl:for-each>
@@ -8130,22 +8187,25 @@
8130
8187
  <xsl:param name="pText" select="."/>
8131
8188
  <xsl:param name="sep" select="','"/>
8132
8189
  <xsl:param name="normalize-space" select="'true'"/>
8190
+ <xsl:param name="keep_sep" select="'false'"/>
8133
8191
  <xsl:if test="string-length($pText) &gt;0">
8134
- <item>
8135
- <xsl:choose>
8136
- <xsl:when test="$normalize-space = 'true'">
8137
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8138
- </xsl:when>
8139
- <xsl:otherwise>
8140
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8141
- </xsl:otherwise>
8142
- </xsl:choose>
8143
- </item>
8144
- <xsl:call-template name="split">
8145
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8146
- <xsl:with-param name="sep" select="$sep"/>
8147
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
8148
- </xsl:call-template>
8192
+ <item>
8193
+ <xsl:choose>
8194
+ <xsl:when test="$normalize-space = 'true'">
8195
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8196
+ </xsl:when>
8197
+ <xsl:otherwise>
8198
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8199
+ </xsl:otherwise>
8200
+ </xsl:choose>
8201
+ </item>
8202
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
8203
+ <xsl:call-template name="split">
8204
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8205
+ <xsl:with-param name="sep" select="$sep"/>
8206
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
8207
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
8208
+ </xsl:call-template>
8149
8209
  </xsl:if>
8150
8210
  </xsl:template><xsl:template name="getDocumentId">
8151
8211
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
@@ -1451,7 +1451,7 @@
1451
1451
  </fo:static-content>
1452
1452
  </xsl:template>
1453
1453
 
1454
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:key name="bibitems" match="*[local-name() = 'bibitem']" use="@id"/><xsl:key name="bibitems_hidden" match="*[local-name() = 'bibitem'][@hidden='true'] | *[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']" use="@id"/><xsl:variable name="lang">
1454
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
1455
1455
  <xsl:call-template name="getLang"/>
1456
1456
  </xsl:variable><xsl:variable name="pageWidth_">
1457
1457
  215.9
@@ -6113,7 +6113,51 @@
6113
6113
  <xsl:with-param name="text" select="$text_step1"/>
6114
6114
  </xsl:call-template>
6115
6115
  </xsl:variable>
6116
- <xsl:value-of select="$text_step2"/>
6116
+
6117
+ <!-- <xsl:value-of select="$text_step2"/> -->
6118
+
6119
+ <!-- add zero-width space after space -->
6120
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
6121
+
6122
+ <!-- split text by zero-width space -->
6123
+ <xsl:variable name="text_step4">
6124
+ <xsl:call-template name="split">
6125
+ <xsl:with-param name="pText" select="$text_step3"/>
6126
+ <xsl:with-param name="sep" select="$zero_width_space"/>
6127
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
6128
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
6129
+ </xsl:call-template>
6130
+ </xsl:variable>
6131
+
6132
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
6133
+ <xsl:choose>
6134
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6135
+ <xsl:call-template name="interspers">
6136
+ <xsl:with-param name="str" select="."/>
6137
+ </xsl:call-template>
6138
+ </xsl:when>
6139
+ <xsl:otherwise>
6140
+ <xsl:value-of select="."/>
6141
+ </xsl:otherwise>
6142
+ </xsl:choose>
6143
+ </xsl:for-each>
6144
+
6145
+ </xsl:template><xsl:template name="interspers">
6146
+ <xsl:param name="str"/>
6147
+ <xsl:param name="char" select="$zero_width_space"/>
6148
+ <xsl:if test="$str != ''">
6149
+ <xsl:value-of select="substring($str, 1, 1)"/>
6150
+
6151
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
6152
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
6153
+ <xsl:value-of select="$char"/>
6154
+ </xsl:if>
6155
+
6156
+ <xsl:call-template name="interspers">
6157
+ <xsl:with-param name="str" select="substring($str, 2)"/>
6158
+ <xsl:with-param name="char" select="$char"/>
6159
+ </xsl:call-template>
6160
+ </xsl:if>
6117
6161
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6118
6162
  <xsl:apply-templates mode="syntax_highlight"/>
6119
6163
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -6631,11 +6675,24 @@
6631
6675
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6632
6676
  <xsl:text>— </xsl:text>
6633
6677
  <xsl:apply-templates/>
6634
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6678
+ </xsl:template><xsl:variable name="bibitems_">
6679
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
6680
+ <xsl:copy-of select="."/>
6681
+ </xsl:for-each>
6682
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
6683
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6684
+ <xsl:copy-of select="."/>
6685
+ </xsl:for-each>
6686
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
6687
+ <xsl:copy-of select="."/>
6688
+ </xsl:for-each>
6689
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6635
6690
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
6636
- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
6691
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
6692
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
6637
6693
  <xsl:choose>
6638
- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6694
+ <!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6695
+ <xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6639
6696
  <fo:inline xsl:use-attribute-sets="eref-style">
6640
6697
  <xsl:if test="@type = 'footnote'">
6641
6698
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -7881,7 +7938,7 @@
7881
7938
  <xsl:copy>
7882
7939
  <xsl:copy-of select="@*"/>
7883
7940
  <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
7884
- <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
7941
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
7885
7942
  <xsl:sort select="@displayorder" data-type="number"/>
7886
7943
  <xsl:apply-templates select="." mode="update_xml_step1"/>
7887
7944
  </xsl:for-each>
@@ -8130,22 +8187,25 @@
8130
8187
  <xsl:param name="pText" select="."/>
8131
8188
  <xsl:param name="sep" select="','"/>
8132
8189
  <xsl:param name="normalize-space" select="'true'"/>
8190
+ <xsl:param name="keep_sep" select="'false'"/>
8133
8191
  <xsl:if test="string-length($pText) &gt;0">
8134
- <item>
8135
- <xsl:choose>
8136
- <xsl:when test="$normalize-space = 'true'">
8137
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8138
- </xsl:when>
8139
- <xsl:otherwise>
8140
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8141
- </xsl:otherwise>
8142
- </xsl:choose>
8143
- </item>
8144
- <xsl:call-template name="split">
8145
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8146
- <xsl:with-param name="sep" select="$sep"/>
8147
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
8148
- </xsl:call-template>
8192
+ <item>
8193
+ <xsl:choose>
8194
+ <xsl:when test="$normalize-space = 'true'">
8195
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8196
+ </xsl:when>
8197
+ <xsl:otherwise>
8198
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8199
+ </xsl:otherwise>
8200
+ </xsl:choose>
8201
+ </item>
8202
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
8203
+ <xsl:call-template name="split">
8204
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8205
+ <xsl:with-param name="sep" select="$sep"/>
8206
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
8207
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
8208
+ </xsl:call-template>
8149
8209
  </xsl:if>
8150
8210
  </xsl:template><xsl:template name="getDocumentId">
8151
8211
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
@@ -1451,7 +1451,7 @@
1451
1451
  </fo:static-content>
1452
1452
  </xsl:template>
1453
1453
 
1454
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:key name="bibitems" match="*[local-name() = 'bibitem']" use="@id"/><xsl:key name="bibitems_hidden" match="*[local-name() = 'bibitem'][@hidden='true'] | *[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']" use="@id"/><xsl:variable name="lang">
1454
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
1455
1455
  <xsl:call-template name="getLang"/>
1456
1456
  </xsl:variable><xsl:variable name="pageWidth_">
1457
1457
  215.9
@@ -6113,7 +6113,51 @@
6113
6113
  <xsl:with-param name="text" select="$text_step1"/>
6114
6114
  </xsl:call-template>
6115
6115
  </xsl:variable>
6116
- <xsl:value-of select="$text_step2"/>
6116
+
6117
+ <!-- <xsl:value-of select="$text_step2"/> -->
6118
+
6119
+ <!-- add zero-width space after space -->
6120
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
6121
+
6122
+ <!-- split text by zero-width space -->
6123
+ <xsl:variable name="text_step4">
6124
+ <xsl:call-template name="split">
6125
+ <xsl:with-param name="pText" select="$text_step3"/>
6126
+ <xsl:with-param name="sep" select="$zero_width_space"/>
6127
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
6128
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
6129
+ </xsl:call-template>
6130
+ </xsl:variable>
6131
+
6132
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
6133
+ <xsl:choose>
6134
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6135
+ <xsl:call-template name="interspers">
6136
+ <xsl:with-param name="str" select="."/>
6137
+ </xsl:call-template>
6138
+ </xsl:when>
6139
+ <xsl:otherwise>
6140
+ <xsl:value-of select="."/>
6141
+ </xsl:otherwise>
6142
+ </xsl:choose>
6143
+ </xsl:for-each>
6144
+
6145
+ </xsl:template><xsl:template name="interspers">
6146
+ <xsl:param name="str"/>
6147
+ <xsl:param name="char" select="$zero_width_space"/>
6148
+ <xsl:if test="$str != ''">
6149
+ <xsl:value-of select="substring($str, 1, 1)"/>
6150
+
6151
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
6152
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
6153
+ <xsl:value-of select="$char"/>
6154
+ </xsl:if>
6155
+
6156
+ <xsl:call-template name="interspers">
6157
+ <xsl:with-param name="str" select="substring($str, 2)"/>
6158
+ <xsl:with-param name="char" select="$char"/>
6159
+ </xsl:call-template>
6160
+ </xsl:if>
6117
6161
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6118
6162
  <xsl:apply-templates mode="syntax_highlight"/>
6119
6163
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -6631,11 +6675,24 @@
6631
6675
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6632
6676
  <xsl:text>— </xsl:text>
6633
6677
  <xsl:apply-templates/>
6634
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6678
+ </xsl:template><xsl:variable name="bibitems_">
6679
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
6680
+ <xsl:copy-of select="."/>
6681
+ </xsl:for-each>
6682
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
6683
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6684
+ <xsl:copy-of select="."/>
6685
+ </xsl:for-each>
6686
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
6687
+ <xsl:copy-of select="."/>
6688
+ </xsl:for-each>
6689
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6635
6690
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
6636
- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
6691
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
6692
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
6637
6693
  <xsl:choose>
6638
- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6694
+ <!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6695
+ <xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6639
6696
  <fo:inline xsl:use-attribute-sets="eref-style">
6640
6697
  <xsl:if test="@type = 'footnote'">
6641
6698
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -7881,7 +7938,7 @@
7881
7938
  <xsl:copy>
7882
7939
  <xsl:copy-of select="@*"/>
7883
7940
  <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
7884
- <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
7941
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
7885
7942
  <xsl:sort select="@displayorder" data-type="number"/>
7886
7943
  <xsl:apply-templates select="." mode="update_xml_step1"/>
7887
7944
  </xsl:for-each>
@@ -8130,22 +8187,25 @@
8130
8187
  <xsl:param name="pText" select="."/>
8131
8188
  <xsl:param name="sep" select="','"/>
8132
8189
  <xsl:param name="normalize-space" select="'true'"/>
8190
+ <xsl:param name="keep_sep" select="'false'"/>
8133
8191
  <xsl:if test="string-length($pText) &gt;0">
8134
- <item>
8135
- <xsl:choose>
8136
- <xsl:when test="$normalize-space = 'true'">
8137
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8138
- </xsl:when>
8139
- <xsl:otherwise>
8140
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8141
- </xsl:otherwise>
8142
- </xsl:choose>
8143
- </item>
8144
- <xsl:call-template name="split">
8145
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8146
- <xsl:with-param name="sep" select="$sep"/>
8147
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
8148
- </xsl:call-template>
8192
+ <item>
8193
+ <xsl:choose>
8194
+ <xsl:when test="$normalize-space = 'true'">
8195
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8196
+ </xsl:when>
8197
+ <xsl:otherwise>
8198
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8199
+ </xsl:otherwise>
8200
+ </xsl:choose>
8201
+ </item>
8202
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
8203
+ <xsl:call-template name="split">
8204
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8205
+ <xsl:with-param name="sep" select="$sep"/>
8206
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
8207
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
8208
+ </xsl:call-template>
8149
8209
  </xsl:if>
8150
8210
  </xsl:template><xsl:template name="getDocumentId">
8151
8211
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>