metanorma-csa 2.1.8 → 2.1.9

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: 357398e41b0ef4578ddc860fb07f9362a08a0f328761e51c081145ae136876c8
4
- data.tar.gz: 2fc5973e45e3de787fb5a4d0e0c8547ad59955538bc02769911e01b46b2be682
3
+ metadata.gz: e98c297fc717846192a2551b22d1e565b8e2b163dc2f261c27aabe7b423f91e2
4
+ data.tar.gz: c0f7495d9c084b83c09291e96a2b35fd7a3efba34d0bf723032c24ae6aaede9f
5
5
  SHA512:
6
- metadata.gz: ec885ceec9ee2fd164859646646bc06d6200612ec77b4bd5d465ea7170dd0fa21f64a65e3d0b83a76337e0f6db6626a2590b7319061034ac17637bf0f69ee6cd
7
- data.tar.gz: d13c3a960df5c9802ff586654c49c786b7cc0f4a17a7ca6c105814adf9f7a91eb51b22c8ea0af85000d3f3cd29451972743abcd2737709be5b6709b0feb3e850
6
+ metadata.gz: 9634d6ab81f7703fd35ab314fc5b147499013f82ee77b9a78eeaeb07543f22d3bee955025599fe37872bb5f6f29ec28e1dbaa4db8d05dcf37ace4f5d101ade9c
7
+ data.tar.gz: f91cb6b8d65cdef3a3835c6e57643dd61bef7fdd3595c4a24d5aa07ea879907cce9670f2e6064752c39594e9994676392876906bcce510c0c6c142316aca7322
@@ -6354,6 +6354,18 @@
6354
6354
  </xsl:copy>
6355
6355
  </xsl:template>
6356
6356
 
6357
+ <xsl:template match="*[local-name() = 'sub']" mode="contents_item">
6358
+ <xsl:copy>
6359
+ <xsl:apply-templates mode="contents_item"/>
6360
+ </xsl:copy>
6361
+ </xsl:template>
6362
+
6363
+ <xsl:template match="*[local-name() = 'sup']" mode="contents_item">
6364
+ <xsl:copy>
6365
+ <xsl:apply-templates mode="contents_item"/>
6366
+ </xsl:copy>
6367
+ </xsl:template>
6368
+
6357
6369
  <xsl:template match="*[local-name() = 'stem']" mode="contents_item">
6358
6370
  <xsl:copy-of select="."/>
6359
6371
  </xsl:template>
@@ -7798,21 +7810,29 @@
7798
7810
  </xsl:variable>
7799
7811
 
7800
7812
  <xsl:template match="@*|node()" mode="index_add_id">
7813
+ <xsl:param name="docid"/>
7801
7814
  <xsl:copy>
7802
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
7815
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
7816
+ <xsl:with-param name="docid" select="$docid"/>
7817
+ </xsl:apply-templates>
7803
7818
  </xsl:copy>
7804
7819
  </xsl:template>
7805
7820
 
7806
7821
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
7822
+ <xsl:param name="docid"/>
7807
7823
  <xsl:variable name="id">
7808
- <xsl:call-template name="generateIndexXrefId"/>
7824
+ <xsl:call-template name="generateIndexXrefId">
7825
+ <xsl:with-param name="docid" select="$docid"/>
7826
+ </xsl:call-template>
7809
7827
  </xsl:variable>
7810
7828
  <xsl:copy> <!-- add id to xref -->
7811
7829
  <xsl:apply-templates select="@*" mode="index_add_id"/>
7812
7830
  <xsl:attribute name="id">
7813
7831
  <xsl:value-of select="$id"/>
7814
7832
  </xsl:attribute>
7815
- <xsl:apply-templates mode="index_add_id"/>
7833
+ <xsl:apply-templates mode="index_add_id">
7834
+ <xsl:with-param name="docid" select="$docid"/>
7835
+ </xsl:apply-templates>
7816
7836
  </xsl:copy>
7817
7837
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
7818
7838
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -7824,7 +7844,9 @@
7824
7844
  <xsl:attribute name="id">
7825
7845
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
7826
7846
  </xsl:attribute>
7827
- <xsl:apply-templates mode="index_add_id"/>
7847
+ <xsl:apply-templates mode="index_add_id">
7848
+ <xsl:with-param name="docid" select="$docid"/>
7849
+ </xsl:apply-templates>
7828
7850
  </xsl:copy>
7829
7851
  </xsl:if>
7830
7852
  </xsl:template>
@@ -7861,12 +7883,33 @@
7861
7883
  </xsl:when>
7862
7884
  <xsl:when test="self::* and local-name(.) = 'xref'">
7863
7885
  <xsl:variable name="id" select="@id"/>
7864
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
7865
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
7866
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
7867
7886
 
7887
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
7868
7888
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
7869
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
7889
+
7890
+ <xsl:variable name="pages_">
7891
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
7892
+ <xsl:choose>
7893
+ <xsl:when test="@id = $id">
7894
+ <page><xsl:value-of select="."/></page>
7895
+ </xsl:when>
7896
+ <xsl:when test="@id = $id_next">
7897
+ <page_next><xsl:value-of select="."/></page_next>
7898
+ </xsl:when>
7899
+ <xsl:when test="@id = $id_prev">
7900
+ <page_prev><xsl:value-of select="."/></page_prev>
7901
+ </xsl:when>
7902
+ </xsl:choose>
7903
+ </xsl:for-each>
7904
+ </xsl:variable>
7905
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
7906
+
7907
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
7908
+ <xsl:variable name="page" select="$pages/page"/>
7909
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
7910
+ <xsl:variable name="page_next" select="$pages/page_next"/>
7911
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
7912
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
7870
7913
 
7871
7914
  <xsl:choose>
7872
7915
  <!-- 2nd pass -->
@@ -7926,16 +7969,20 @@
7926
7969
  </xsl:template>
7927
7970
 
7928
7971
  <xsl:template name="generateIndexXrefId">
7972
+ <xsl:param name="docid"/>
7973
+
7929
7974
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
7930
7975
 
7931
- <xsl:variable name="docid">
7932
- <xsl:call-template name="getDocumentId"/>
7976
+ <xsl:variable name="docid_curr">
7977
+ <xsl:value-of select="$docid"/>
7978
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
7933
7979
  </xsl:variable>
7980
+
7934
7981
  <xsl:variable name="item_number">
7935
7982
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
7936
7983
  </xsl:variable>
7937
7984
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
7938
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
7985
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
7939
7986
  </xsl:template>
7940
7987
 
7941
7988
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">