metanorma-iho 0.6.9 → 0.6.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: 5408e6fd36f49a2deb7f16bb4ba15a65cd20978ac94c1b8b8a1f39926befe7ff
4
- data.tar.gz: c009c23c9fa96d5aba6190f652359ee5081b4cd1a89c2747bdc96457e9f2a26a
3
+ metadata.gz: 88630b7ecf636f3705ff06b6b7f313efb5fd3b622e85a2735b82659d170e8b6b
4
+ data.tar.gz: e6b48482db3da8d4ceb13e3b8402a8d0004d3dfb1a392cc916eefbe0e5a8afa0
5
5
  SHA512:
6
- metadata.gz: 66b6277306f9e2b2eec8d07150eedbc7e6830fe59d299a33b23d9e989889e92ca8aa3be5a04f0d05d4077bc7c33a483a9d6145504440b8113f4f919c998b8f16
7
- data.tar.gz: 41ff57ad0fb09e3f4b2b3629fcf08d6274769f4677697ef5a2ab42e9ab1de6f3ab62fe30a083e497d75698e6b9be6c2d5fecfffdac04a8d24df10bdfba660c93
6
+ metadata.gz: e15ca9e2d633cbd4e2b451edf2c5358d59e0ba25902d18683ab76381bf97956da513a8df4219c167ae9a5a79972218829cd526c52c06c1d161488a193f191aad
7
+ data.tar.gz: 1b1b6f84b78af8db1cb2b195feacfdb53a6a47d1d7be212b015be60f34e664f3a57717c3a1a7c3a65209a5a861396bb0abf7aa9d7acff33a82f6515b68cf95d0
@@ -7513,7 +7513,7 @@
7513
7513
  <!-- ====== -->
7514
7514
  <!-- eref -->
7515
7515
  <!-- ====== -->
7516
- <xsl:template match="*[local-name() = 'eref']">
7516
+ <xsl:template match="*[local-name() = 'eref']" name="eref">
7517
7517
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7518
7518
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7519
7519
  <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
@@ -8006,21 +8006,29 @@
8006
8006
  </xsl:variable>
8007
8007
 
8008
8008
  <xsl:template match="@*|node()" mode="index_add_id">
8009
+ <xsl:param name="docid"/>
8009
8010
  <xsl:copy>
8010
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
8011
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
8012
+ <xsl:with-param name="docid" select="$docid"/>
8013
+ </xsl:apply-templates>
8011
8014
  </xsl:copy>
8012
8015
  </xsl:template>
8013
8016
 
8014
8017
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
8018
+ <xsl:param name="docid"/>
8015
8019
  <xsl:variable name="id">
8016
- <xsl:call-template name="generateIndexXrefId"/>
8020
+ <xsl:call-template name="generateIndexXrefId">
8021
+ <xsl:with-param name="docid" select="$docid"/>
8022
+ </xsl:call-template>
8017
8023
  </xsl:variable>
8018
8024
  <xsl:copy> <!-- add id to xref -->
8019
8025
  <xsl:apply-templates select="@*" mode="index_add_id"/>
8020
8026
  <xsl:attribute name="id">
8021
8027
  <xsl:value-of select="$id"/>
8022
8028
  </xsl:attribute>
8023
- <xsl:apply-templates mode="index_add_id"/>
8029
+ <xsl:apply-templates mode="index_add_id">
8030
+ <xsl:with-param name="docid" select="$docid"/>
8031
+ </xsl:apply-templates>
8024
8032
  </xsl:copy>
8025
8033
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
8026
8034
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -8032,7 +8040,9 @@
8032
8040
  <xsl:attribute name="id">
8033
8041
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
8034
8042
  </xsl:attribute>
8035
- <xsl:apply-templates mode="index_add_id"/>
8043
+ <xsl:apply-templates mode="index_add_id">
8044
+ <xsl:with-param name="docid" select="$docid"/>
8045
+ </xsl:apply-templates>
8036
8046
  </xsl:copy>
8037
8047
  </xsl:if>
8038
8048
  </xsl:template>
@@ -8069,12 +8079,33 @@
8069
8079
  </xsl:when>
8070
8080
  <xsl:when test="self::* and local-name(.) = 'xref'">
8071
8081
  <xsl:variable name="id" select="@id"/>
8072
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
8073
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8074
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
8075
8082
 
8083
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8076
8084
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
8077
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
8085
+
8086
+ <xsl:variable name="pages_">
8087
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
8088
+ <xsl:choose>
8089
+ <xsl:when test="@id = $id">
8090
+ <page><xsl:value-of select="."/></page>
8091
+ </xsl:when>
8092
+ <xsl:when test="@id = $id_next">
8093
+ <page_next><xsl:value-of select="."/></page_next>
8094
+ </xsl:when>
8095
+ <xsl:when test="@id = $id_prev">
8096
+ <page_prev><xsl:value-of select="."/></page_prev>
8097
+ </xsl:when>
8098
+ </xsl:choose>
8099
+ </xsl:for-each>
8100
+ </xsl:variable>
8101
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
8102
+
8103
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
8104
+ <xsl:variable name="page" select="$pages/page"/>
8105
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
8106
+ <xsl:variable name="page_next" select="$pages/page_next"/>
8107
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
8108
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
8078
8109
 
8079
8110
  <xsl:choose>
8080
8111
  <!-- 2nd pass -->
@@ -8134,16 +8165,20 @@
8134
8165
  </xsl:template>
8135
8166
 
8136
8167
  <xsl:template name="generateIndexXrefId">
8168
+ <xsl:param name="docid"/>
8169
+
8137
8170
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
8138
8171
 
8139
- <xsl:variable name="docid">
8140
- <xsl:call-template name="getDocumentId"/>
8172
+ <xsl:variable name="docid_curr">
8173
+ <xsl:value-of select="$docid"/>
8174
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
8141
8175
  </xsl:variable>
8176
+
8142
8177
  <xsl:variable name="item_number">
8143
8178
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
8144
8179
  </xsl:variable>
8145
8180
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
8146
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8181
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8147
8182
  </xsl:template>
8148
8183
 
8149
8184
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -7513,7 +7513,7 @@
7513
7513
  <!-- ====== -->
7514
7514
  <!-- eref -->
7515
7515
  <!-- ====== -->
7516
- <xsl:template match="*[local-name() = 'eref']">
7516
+ <xsl:template match="*[local-name() = 'eref']" name="eref">
7517
7517
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7518
7518
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7519
7519
  <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
@@ -8006,21 +8006,29 @@
8006
8006
  </xsl:variable>
8007
8007
 
8008
8008
  <xsl:template match="@*|node()" mode="index_add_id">
8009
+ <xsl:param name="docid"/>
8009
8010
  <xsl:copy>
8010
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
8011
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
8012
+ <xsl:with-param name="docid" select="$docid"/>
8013
+ </xsl:apply-templates>
8011
8014
  </xsl:copy>
8012
8015
  </xsl:template>
8013
8016
 
8014
8017
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
8018
+ <xsl:param name="docid"/>
8015
8019
  <xsl:variable name="id">
8016
- <xsl:call-template name="generateIndexXrefId"/>
8020
+ <xsl:call-template name="generateIndexXrefId">
8021
+ <xsl:with-param name="docid" select="$docid"/>
8022
+ </xsl:call-template>
8017
8023
  </xsl:variable>
8018
8024
  <xsl:copy> <!-- add id to xref -->
8019
8025
  <xsl:apply-templates select="@*" mode="index_add_id"/>
8020
8026
  <xsl:attribute name="id">
8021
8027
  <xsl:value-of select="$id"/>
8022
8028
  </xsl:attribute>
8023
- <xsl:apply-templates mode="index_add_id"/>
8029
+ <xsl:apply-templates mode="index_add_id">
8030
+ <xsl:with-param name="docid" select="$docid"/>
8031
+ </xsl:apply-templates>
8024
8032
  </xsl:copy>
8025
8033
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
8026
8034
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -8032,7 +8040,9 @@
8032
8040
  <xsl:attribute name="id">
8033
8041
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
8034
8042
  </xsl:attribute>
8035
- <xsl:apply-templates mode="index_add_id"/>
8043
+ <xsl:apply-templates mode="index_add_id">
8044
+ <xsl:with-param name="docid" select="$docid"/>
8045
+ </xsl:apply-templates>
8036
8046
  </xsl:copy>
8037
8047
  </xsl:if>
8038
8048
  </xsl:template>
@@ -8069,12 +8079,33 @@
8069
8079
  </xsl:when>
8070
8080
  <xsl:when test="self::* and local-name(.) = 'xref'">
8071
8081
  <xsl:variable name="id" select="@id"/>
8072
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
8073
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8074
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
8075
8082
 
8083
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8076
8084
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
8077
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
8085
+
8086
+ <xsl:variable name="pages_">
8087
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
8088
+ <xsl:choose>
8089
+ <xsl:when test="@id = $id">
8090
+ <page><xsl:value-of select="."/></page>
8091
+ </xsl:when>
8092
+ <xsl:when test="@id = $id_next">
8093
+ <page_next><xsl:value-of select="."/></page_next>
8094
+ </xsl:when>
8095
+ <xsl:when test="@id = $id_prev">
8096
+ <page_prev><xsl:value-of select="."/></page_prev>
8097
+ </xsl:when>
8098
+ </xsl:choose>
8099
+ </xsl:for-each>
8100
+ </xsl:variable>
8101
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
8102
+
8103
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
8104
+ <xsl:variable name="page" select="$pages/page"/>
8105
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
8106
+ <xsl:variable name="page_next" select="$pages/page_next"/>
8107
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
8108
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
8078
8109
 
8079
8110
  <xsl:choose>
8080
8111
  <!-- 2nd pass -->
@@ -8134,16 +8165,20 @@
8134
8165
  </xsl:template>
8135
8166
 
8136
8167
  <xsl:template name="generateIndexXrefId">
8168
+ <xsl:param name="docid"/>
8169
+
8137
8170
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
8138
8171
 
8139
- <xsl:variable name="docid">
8140
- <xsl:call-template name="getDocumentId"/>
8172
+ <xsl:variable name="docid_curr">
8173
+ <xsl:value-of select="$docid"/>
8174
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
8141
8175
  </xsl:variable>
8176
+
8142
8177
  <xsl:variable name="item_number">
8143
8178
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
8144
8179
  </xsl:variable>
8145
8180
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
8146
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8181
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8147
8182
  </xsl:template>
8148
8183
 
8149
8184
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -205,6 +205,15 @@
205
205
  <data type="boolean"/>
206
206
  </attribute>
207
207
  </optional>
208
+ <optional>
209
+ <attribute name="style">
210
+ <choice>
211
+ <value>basic</value>
212
+ <value>full</value>
213
+ <value>short</value>
214
+ </choice>
215
+ </attribute>
216
+ </optional>
208
217
  <ref name="XrefBody"/>
209
218
  </element>
210
219
  </define>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.6.9".freeze
3
+ VERSION = "0.6.10".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9
4
+ version: 0.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-26 00:00:00.000000000 Z
11
+ date: 2022-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic