metanorma-un 0.9.9 → 0.9.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: f4134dee9f7b858f16da13effd1f60fcec62c1b81c7d1cb6fb00bf14851839fe
4
- data.tar.gz: 1ca85dfad1fa39a2d5094b62a74f0ed13ce5727368cc1536c3d702e610e1c752
3
+ metadata.gz: 7b7eed9a4ee7a8a2f881a16841acb2d6d9310618d61b27994d70eebb9e0c2cc1
4
+ data.tar.gz: '00018c02bdbbec199661eb6e5aa43b09240a22948528a9fde135142445c82d5b'
5
5
  SHA512:
6
- metadata.gz: 3164723cc1fd0cc5d20195f4d7d52582585dd0c030763554dc819407c3705bef35d93020d257c26d0c3e8ee65cf079af55768c7639c11a403f62139850ef87d5
7
- data.tar.gz: 2214521c8a53956cc2960db30b4fdf875358dff48a8db4179794b4bf828d32ef7f35f734dcadb602147431397788989f64f00615a0b6cad7d940bf8df03e93b7
6
+ metadata.gz: 63e67ef5e0bf08d8823bad86046701935fa38bec6e21fbdac22033903a49290dd0b854d564f8468625d9c28a3bfc217ce74b8582dfde386a689ea4c1c2dccc40
7
+ data.tar.gz: 377c2a773f8c9d230506070943113c01009a49673607c92e93a4946b9ca060cc087f1ee8909fe8e6999a19c6a46b5e31df74359899a0a0eae5d614acd96162ec
@@ -7503,7 +7503,7 @@
7503
7503
  <!-- ====== -->
7504
7504
  <!-- eref -->
7505
7505
  <!-- ====== -->
7506
- <xsl:template match="*[local-name() = 'eref']">
7506
+ <xsl:template match="*[local-name() = 'eref']" name="eref">
7507
7507
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7508
7508
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7509
7509
  <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
@@ -8004,21 +8004,29 @@
8004
8004
  </xsl:variable>
8005
8005
 
8006
8006
  <xsl:template match="@*|node()" mode="index_add_id">
8007
+ <xsl:param name="docid"/>
8007
8008
  <xsl:copy>
8008
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
8009
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
8010
+ <xsl:with-param name="docid" select="$docid"/>
8011
+ </xsl:apply-templates>
8009
8012
  </xsl:copy>
8010
8013
  </xsl:template>
8011
8014
 
8012
8015
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
8016
+ <xsl:param name="docid"/>
8013
8017
  <xsl:variable name="id">
8014
- <xsl:call-template name="generateIndexXrefId"/>
8018
+ <xsl:call-template name="generateIndexXrefId">
8019
+ <xsl:with-param name="docid" select="$docid"/>
8020
+ </xsl:call-template>
8015
8021
  </xsl:variable>
8016
8022
  <xsl:copy> <!-- add id to xref -->
8017
8023
  <xsl:apply-templates select="@*" mode="index_add_id"/>
8018
8024
  <xsl:attribute name="id">
8019
8025
  <xsl:value-of select="$id"/>
8020
8026
  </xsl:attribute>
8021
- <xsl:apply-templates mode="index_add_id"/>
8027
+ <xsl:apply-templates mode="index_add_id">
8028
+ <xsl:with-param name="docid" select="$docid"/>
8029
+ </xsl:apply-templates>
8022
8030
  </xsl:copy>
8023
8031
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
8024
8032
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -8030,7 +8038,9 @@
8030
8038
  <xsl:attribute name="id">
8031
8039
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
8032
8040
  </xsl:attribute>
8033
- <xsl:apply-templates mode="index_add_id"/>
8041
+ <xsl:apply-templates mode="index_add_id">
8042
+ <xsl:with-param name="docid" select="$docid"/>
8043
+ </xsl:apply-templates>
8034
8044
  </xsl:copy>
8035
8045
  </xsl:if>
8036
8046
  </xsl:template>
@@ -8067,12 +8077,33 @@
8067
8077
  </xsl:when>
8068
8078
  <xsl:when test="self::* and local-name(.) = 'xref'">
8069
8079
  <xsl:variable name="id" select="@id"/>
8070
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
8071
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8072
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
8073
8080
 
8081
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8074
8082
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
8075
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
8083
+
8084
+ <xsl:variable name="pages_">
8085
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
8086
+ <xsl:choose>
8087
+ <xsl:when test="@id = $id">
8088
+ <page><xsl:value-of select="."/></page>
8089
+ </xsl:when>
8090
+ <xsl:when test="@id = $id_next">
8091
+ <page_next><xsl:value-of select="."/></page_next>
8092
+ </xsl:when>
8093
+ <xsl:when test="@id = $id_prev">
8094
+ <page_prev><xsl:value-of select="."/></page_prev>
8095
+ </xsl:when>
8096
+ </xsl:choose>
8097
+ </xsl:for-each>
8098
+ </xsl:variable>
8099
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
8100
+
8101
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
8102
+ <xsl:variable name="page" select="$pages/page"/>
8103
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
8104
+ <xsl:variable name="page_next" select="$pages/page_next"/>
8105
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
8106
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
8076
8107
 
8077
8108
  <xsl:choose>
8078
8109
  <!-- 2nd pass -->
@@ -8132,16 +8163,20 @@
8132
8163
  </xsl:template>
8133
8164
 
8134
8165
  <xsl:template name="generateIndexXrefId">
8166
+ <xsl:param name="docid"/>
8167
+
8135
8168
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
8136
8169
 
8137
- <xsl:variable name="docid">
8138
- <xsl:call-template name="getDocumentId"/>
8170
+ <xsl:variable name="docid_curr">
8171
+ <xsl:value-of select="$docid"/>
8172
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
8139
8173
  </xsl:variable>
8174
+
8140
8175
  <xsl:variable name="item_number">
8141
8176
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
8142
8177
  </xsl:variable>
8143
8178
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
8144
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8179
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8145
8180
  </xsl:template>
8146
8181
 
8147
8182
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -7503,7 +7503,7 @@
7503
7503
  <!-- ====== -->
7504
7504
  <!-- eref -->
7505
7505
  <!-- ====== -->
7506
- <xsl:template match="*[local-name() = 'eref']">
7506
+ <xsl:template match="*[local-name() = 'eref']" name="eref">
7507
7507
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7508
7508
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7509
7509
  <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
@@ -8004,21 +8004,29 @@
8004
8004
  </xsl:variable>
8005
8005
 
8006
8006
  <xsl:template match="@*|node()" mode="index_add_id">
8007
+ <xsl:param name="docid"/>
8007
8008
  <xsl:copy>
8008
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
8009
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
8010
+ <xsl:with-param name="docid" select="$docid"/>
8011
+ </xsl:apply-templates>
8009
8012
  </xsl:copy>
8010
8013
  </xsl:template>
8011
8014
 
8012
8015
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
8016
+ <xsl:param name="docid"/>
8013
8017
  <xsl:variable name="id">
8014
- <xsl:call-template name="generateIndexXrefId"/>
8018
+ <xsl:call-template name="generateIndexXrefId">
8019
+ <xsl:with-param name="docid" select="$docid"/>
8020
+ </xsl:call-template>
8015
8021
  </xsl:variable>
8016
8022
  <xsl:copy> <!-- add id to xref -->
8017
8023
  <xsl:apply-templates select="@*" mode="index_add_id"/>
8018
8024
  <xsl:attribute name="id">
8019
8025
  <xsl:value-of select="$id"/>
8020
8026
  </xsl:attribute>
8021
- <xsl:apply-templates mode="index_add_id"/>
8027
+ <xsl:apply-templates mode="index_add_id">
8028
+ <xsl:with-param name="docid" select="$docid"/>
8029
+ </xsl:apply-templates>
8022
8030
  </xsl:copy>
8023
8031
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
8024
8032
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -8030,7 +8038,9 @@
8030
8038
  <xsl:attribute name="id">
8031
8039
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
8032
8040
  </xsl:attribute>
8033
- <xsl:apply-templates mode="index_add_id"/>
8041
+ <xsl:apply-templates mode="index_add_id">
8042
+ <xsl:with-param name="docid" select="$docid"/>
8043
+ </xsl:apply-templates>
8034
8044
  </xsl:copy>
8035
8045
  </xsl:if>
8036
8046
  </xsl:template>
@@ -8067,12 +8077,33 @@
8067
8077
  </xsl:when>
8068
8078
  <xsl:when test="self::* and local-name(.) = 'xref'">
8069
8079
  <xsl:variable name="id" select="@id"/>
8070
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
8071
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8072
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
8073
8080
 
8081
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8074
8082
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
8075
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
8083
+
8084
+ <xsl:variable name="pages_">
8085
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
8086
+ <xsl:choose>
8087
+ <xsl:when test="@id = $id">
8088
+ <page><xsl:value-of select="."/></page>
8089
+ </xsl:when>
8090
+ <xsl:when test="@id = $id_next">
8091
+ <page_next><xsl:value-of select="."/></page_next>
8092
+ </xsl:when>
8093
+ <xsl:when test="@id = $id_prev">
8094
+ <page_prev><xsl:value-of select="."/></page_prev>
8095
+ </xsl:when>
8096
+ </xsl:choose>
8097
+ </xsl:for-each>
8098
+ </xsl:variable>
8099
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
8100
+
8101
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
8102
+ <xsl:variable name="page" select="$pages/page"/>
8103
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
8104
+ <xsl:variable name="page_next" select="$pages/page_next"/>
8105
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
8106
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
8076
8107
 
8077
8108
  <xsl:choose>
8078
8109
  <!-- 2nd pass -->
@@ -8132,16 +8163,20 @@
8132
8163
  </xsl:template>
8133
8164
 
8134
8165
  <xsl:template name="generateIndexXrefId">
8166
+ <xsl:param name="docid"/>
8167
+
8135
8168
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
8136
8169
 
8137
- <xsl:variable name="docid">
8138
- <xsl:call-template name="getDocumentId"/>
8170
+ <xsl:variable name="docid_curr">
8171
+ <xsl:value-of select="$docid"/>
8172
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
8139
8173
  </xsl:variable>
8174
+
8140
8175
  <xsl:variable name="item_number">
8141
8176
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
8142
8177
  </xsl:variable>
8143
8178
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
8144
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8179
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8145
8180
  </xsl:template>
8146
8181
 
8147
8182
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -7583,7 +7583,7 @@
7583
7583
  <!-- ====== -->
7584
7584
  <!-- eref -->
7585
7585
  <!-- ====== -->
7586
- <xsl:template match="*[local-name() = 'eref']">
7586
+ <xsl:template match="*[local-name() = 'eref']" name="eref">
7587
7587
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7588
7588
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7589
7589
  <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
@@ -8084,21 +8084,29 @@
8084
8084
  </xsl:variable>
8085
8085
 
8086
8086
  <xsl:template match="@*|node()" mode="index_add_id">
8087
+ <xsl:param name="docid"/>
8087
8088
  <xsl:copy>
8088
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
8089
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
8090
+ <xsl:with-param name="docid" select="$docid"/>
8091
+ </xsl:apply-templates>
8089
8092
  </xsl:copy>
8090
8093
  </xsl:template>
8091
8094
 
8092
8095
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
8096
+ <xsl:param name="docid"/>
8093
8097
  <xsl:variable name="id">
8094
- <xsl:call-template name="generateIndexXrefId"/>
8098
+ <xsl:call-template name="generateIndexXrefId">
8099
+ <xsl:with-param name="docid" select="$docid"/>
8100
+ </xsl:call-template>
8095
8101
  </xsl:variable>
8096
8102
  <xsl:copy> <!-- add id to xref -->
8097
8103
  <xsl:apply-templates select="@*" mode="index_add_id"/>
8098
8104
  <xsl:attribute name="id">
8099
8105
  <xsl:value-of select="$id"/>
8100
8106
  </xsl:attribute>
8101
- <xsl:apply-templates mode="index_add_id"/>
8107
+ <xsl:apply-templates mode="index_add_id">
8108
+ <xsl:with-param name="docid" select="$docid"/>
8109
+ </xsl:apply-templates>
8102
8110
  </xsl:copy>
8103
8111
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
8104
8112
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -8110,7 +8118,9 @@
8110
8118
  <xsl:attribute name="id">
8111
8119
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
8112
8120
  </xsl:attribute>
8113
- <xsl:apply-templates mode="index_add_id"/>
8121
+ <xsl:apply-templates mode="index_add_id">
8122
+ <xsl:with-param name="docid" select="$docid"/>
8123
+ </xsl:apply-templates>
8114
8124
  </xsl:copy>
8115
8125
  </xsl:if>
8116
8126
  </xsl:template>
@@ -8147,12 +8157,33 @@
8147
8157
  </xsl:when>
8148
8158
  <xsl:when test="self::* and local-name(.) = 'xref'">
8149
8159
  <xsl:variable name="id" select="@id"/>
8150
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
8151
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8152
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
8153
8160
 
8161
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
8154
8162
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
8155
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
8163
+
8164
+ <xsl:variable name="pages_">
8165
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
8166
+ <xsl:choose>
8167
+ <xsl:when test="@id = $id">
8168
+ <page><xsl:value-of select="."/></page>
8169
+ </xsl:when>
8170
+ <xsl:when test="@id = $id_next">
8171
+ <page_next><xsl:value-of select="."/></page_next>
8172
+ </xsl:when>
8173
+ <xsl:when test="@id = $id_prev">
8174
+ <page_prev><xsl:value-of select="."/></page_prev>
8175
+ </xsl:when>
8176
+ </xsl:choose>
8177
+ </xsl:for-each>
8178
+ </xsl:variable>
8179
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
8180
+
8181
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
8182
+ <xsl:variable name="page" select="$pages/page"/>
8183
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
8184
+ <xsl:variable name="page_next" select="$pages/page_next"/>
8185
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
8186
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
8156
8187
 
8157
8188
  <xsl:choose>
8158
8189
  <!-- 2nd pass -->
@@ -8212,16 +8243,20 @@
8212
8243
  </xsl:template>
8213
8244
 
8214
8245
  <xsl:template name="generateIndexXrefId">
8246
+ <xsl:param name="docid"/>
8247
+
8215
8248
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
8216
8249
 
8217
- <xsl:variable name="docid">
8218
- <xsl:call-template name="getDocumentId"/>
8250
+ <xsl:variable name="docid_curr">
8251
+ <xsl:value-of select="$docid"/>
8252
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
8219
8253
  </xsl:variable>
8254
+
8220
8255
  <xsl:variable name="item_number">
8221
8256
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
8222
8257
  </xsl:variable>
8223
8258
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
8224
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8259
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
8225
8260
  </xsl:template>
8226
8261
 
8227
8262
  <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 UN
3
- VERSION = "0.9.9".freeze
3
+ VERSION = "0.9.10".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.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: iso-639