metanorma-ribose 2.5.3 → 2.5.5

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: ad837cc7cdfb00ad1c42691462db593520aca7bd1cdea7e0f04df34224b2aae7
4
- data.tar.gz: 6ba4858570d7362138b247e3cb04027a7b9d833396169dc37afa3d6218c7b0dc
3
+ metadata.gz: 7c3761f452a1896870000f02c8af971bbe606801653ba71a7e5bfdc46474e731
4
+ data.tar.gz: 622820aa78a60196670b478f5a2a000c6a2c478ecd2c21ce263b6dd1f87afff8
5
5
  SHA512:
6
- metadata.gz: 44ff3c59e23df8a4dccdf73588b51738b14cefa49f2b04ce35851b5909153ffe0dae4703c64b977be41501c888da528e00c3a8eca24914d2840036e83062c8d3
7
- data.tar.gz: 7a8f288c813fc170520cc35dae69c67f220eb876370872894d66ccd6535cf439a28fe356809c7ee3216b125f79b8d47286deb5791071ea904ae2369053f5a7d7
6
+ metadata.gz: ca70973ef801ddb22d29d66e6ab0b85125a38986bb4814c6f5cff1e554752126da9889334e9b1c2fc5c0d5cc73a186fd474e4f503d7ad866c133e9be687457c6
7
+ data.tar.gz: b0601319759e71784f409a4bb0bb8f04c08935677d2c6a4ba41ab2db5c2eb38cd71d8a0d3b9234b0f73d78e41501a30d6758c0d7a575b843c5fb2d284cabba61
@@ -4735,7 +4735,8 @@
4735
4735
  </xsl:choose>
4736
4736
  </xsl:variable>
4737
4737
  <xsl:variable name="current_fn_number_text">
4738
- <xsl:value-of select="$current_fn_number"/>
4738
+
4739
+ <xsl:value-of select="$current_fn_number"/>
4739
4740
 
4740
4741
  </xsl:variable>
4741
4742
 
@@ -4753,10 +4754,14 @@
4753
4754
  <xsl:variable name="fn_styles">
4754
4755
  <xsl:choose>
4755
4756
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
4756
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
4757
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
4758
+
4759
+ </fn_styles>
4757
4760
  </xsl:when>
4758
4761
  <xsl:otherwise>
4759
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
4762
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
4763
+
4764
+ </fn_styles>
4760
4765
  </xsl:otherwise>
4761
4766
  </xsl:choose>
4762
4767
  </xsl:variable>
@@ -4771,8 +4776,10 @@
4771
4776
 
4772
4777
  <xsl:call-template name="insert_basic_link">
4773
4778
  <xsl:with-param name="element">
4774
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
4775
- <xsl:copy-of select="$current_fn_number_text"/>
4779
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
4780
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
4781
+ <xsl:copy-of select="$current_fn_number_text"/>
4782
+ </fo:inline>
4776
4783
  </fo:basic-link>
4777
4784
  </xsl:with-param>
4778
4785
  </xsl:call-template>
@@ -5053,7 +5060,7 @@
5053
5060
 
5054
5061
  <xsl:call-template name="refine_fn-reference-style"/>
5055
5062
 
5056
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5063
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5057
5064
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
5058
5065
  <xsl:attribute name="internal-destination">
5059
5066
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -6064,9 +6071,19 @@
6064
6071
  </fo:inline>
6065
6072
  </xsl:template>
6066
6073
 
6067
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
6074
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
6075
+ <xsl:param name="txt"/>
6068
6076
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
6069
- <xsl:variable name="text" select="."/>
6077
+ <xsl:variable name="text">
6078
+ <xsl:choose>
6079
+ <xsl:when test="$txt != ''">
6080
+ <xsl:value-of select="$txt"/>
6081
+ </xsl:when>
6082
+ <xsl:otherwise>
6083
+ <xsl:value-of select="."/>
6084
+ </xsl:otherwise>
6085
+ </xsl:choose>
6086
+ </xsl:variable>
6070
6087
  <xsl:variable name="ratio_">
6071
6088
  0.75
6072
6089
  </xsl:variable>
@@ -7512,9 +7529,12 @@
7512
7529
  <xsl:apply-templates/>
7513
7530
  </xsl:when>
7514
7531
  <xsl:otherwise>
7532
+ <xsl:variable name="alt_text">
7533
+ <xsl:call-template name="getAltText"/>
7534
+ </xsl:variable>
7515
7535
  <xsl:call-template name="insert_basic_link">
7516
7536
  <xsl:with-param name="element">
7517
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
7537
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
7518
7538
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7519
7539
  <xsl:attribute name="role">Annot</xsl:attribute>
7520
7540
  </xsl:if>
@@ -7541,6 +7561,14 @@
7541
7561
  </fo:inline>
7542
7562
  </xsl:template> <!-- link -->
7543
7563
 
7564
+ <xsl:template name="getAltText">
7565
+ <xsl:choose>
7566
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
7567
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
7568
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
7569
+ </xsl:choose>
7570
+ </xsl:template>
7571
+
7544
7572
  <!-- ======================== -->
7545
7573
  <!-- Appendix processing -->
7546
7574
  <!-- ======================== -->
@@ -7571,7 +7599,7 @@
7571
7599
  <xsl:template match="*[local-name() = 'callout']">
7572
7600
  <xsl:choose>
7573
7601
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
7574
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
7602
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
7575
7603
  </xsl:choose>
7576
7604
  </xsl:template>
7577
7605
 
@@ -7600,10 +7628,14 @@
7600
7628
  <xsl:template match="*[local-name() = 'xref']">
7601
7629
  <xsl:call-template name="insert_basic_link">
7602
7630
  <xsl:with-param name="element">
7603
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7631
+ <xsl:variable name="alt_text">
7632
+ <xsl:call-template name="getAltText"/>
7633
+ </xsl:variable>
7634
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
7604
7635
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
7605
7636
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7606
7637
  </xsl:if>
7638
+
7607
7639
  <xsl:if test="parent::*[local-name() = 'add']">
7608
7640
  <xsl:call-template name="append_add-style"/>
7609
7641
  </xsl:if>
@@ -7712,44 +7744,44 @@
7712
7744
 
7713
7745
  <xsl:template match="*[local-name() = 'note']" name="note">
7714
7746
 
7715
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
7747
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
7716
7748
 
7717
- <xsl:call-template name="setBlockSpanAll"/>
7749
+ <xsl:call-template name="setBlockSpanAll"/>
7718
7750
 
7719
- <xsl:call-template name="refine_note-style"/>
7751
+ <xsl:call-template name="refine_note-style"/>
7720
7752
 
7721
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
7753
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
7722
7754
 
7723
- <fo:block>
7755
+ <fo:block>
7724
7756
 
7725
- <xsl:call-template name="refine_note_block_style"/>
7757
+ <xsl:call-template name="refine_note_block_style"/>
7726
7758
 
7727
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
7759
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
7728
7760
 
7729
- <xsl:call-template name="refine_note-name-style"/>
7761
+ <xsl:call-template name="refine_note-name-style"/>
7730
7762
 
7731
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7732
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7733
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
7734
- <xsl:call-template name="append_add-style"/>
7735
- </xsl:if>
7763
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7764
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7765
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
7766
+ <xsl:call-template name="append_add-style"/>
7767
+ </xsl:if>
7736
7768
 
7737
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
7738
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
7739
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
7740
- <xsl:with-param name="skip">false</xsl:with-param>
7741
- </xsl:apply-templates>
7742
- </xsl:if>
7769
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
7770
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
7771
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
7772
+ <xsl:with-param name="skip">false</xsl:with-param>
7773
+ </xsl:apply-templates>
7774
+ </xsl:if>
7743
7775
 
7744
- <xsl:apply-templates select="*[local-name() = 'name']"/>
7776
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
7745
7777
 
7746
- </fo:inline>
7778
+ </fo:inline>
7747
7779
 
7748
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7749
- </fo:block>
7780
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7781
+ </fo:block>
7750
7782
 
7751
- </fo:block-container>
7752
- </fo:block-container>
7783
+ </fo:block-container>
7784
+ </fo:block-container>
7753
7785
 
7754
7786
  </xsl:template>
7755
7787
 
@@ -10088,12 +10120,14 @@
10088
10120
 
10089
10121
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
10090
10122
 
10091
- <xsl:variable name="provisional_distance_between_starts">
10123
+ <xsl:variable name="provisional_distance_between_starts_">
10092
10124
  7
10093
10125
  </xsl:variable>
10094
- <xsl:variable name="indent">
10126
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
10127
+ <xsl:variable name="indent_">
10095
10128
  0
10096
10129
  </xsl:variable>
10130
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
10097
10131
 
10098
10132
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
10099
10133
  <fo:list-item>
@@ -10157,6 +10191,7 @@
10157
10191
  </xsl:when>
10158
10192
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
10159
10193
  <fo:block xsl:use-attribute-sets="example-name-style">
10194
+
10160
10195
  <xsl:apply-templates/>
10161
10196
  </fo:block>
10162
10197
  </xsl:when>
@@ -10172,6 +10207,7 @@
10172
10207
 
10173
10208
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
10174
10209
  <fo:inline xsl:use-attribute-sets="example-name-style">
10210
+
10175
10211
  <xsl:apply-templates/>
10176
10212
  </fo:inline>
10177
10213
  </xsl:template>
@@ -10543,12 +10579,14 @@
10543
10579
 
10544
10580
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
10545
10581
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
10582
+
10546
10583
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
10547
10584
  </fo:block>
10548
10585
  </xsl:if>
10549
10586
 
10550
10587
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
10551
10588
  <xsl:call-template name="setStyle_preferred"/>
10589
+
10552
10590
  <xsl:apply-templates/>
10553
10591
  </fo:block>
10554
10592
  </fo:block>
@@ -10819,14 +10857,17 @@
10819
10857
  </xsl:when>
10820
10858
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10821
10859
 
10822
- <xsl:variable name="label">
10860
+ <xsl:variable name="type" select="../@type"/>
10823
10861
 
10824
- <xsl:variable name="type" select="../@type"/>
10862
+ <xsl:variable name="label">
10825
10863
 
10826
10864
  <xsl:variable name="style_prefix_">
10827
10865
  <xsl:if test="$type = 'roman'">
10828
10866
  <!-- Example: (i) -->
10829
10867
  </xsl:if>
10868
+ <xsl:if test="$type = 'alphabet'">
10869
+
10870
+ </xsl:if>
10830
10871
  </xsl:variable>
10831
10872
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
10832
10873
 
@@ -10852,13 +10893,15 @@
10852
10893
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
10853
10894
  <xsl:value-of select="$style_prefix"/>
10854
10895
  </xsl:if>
10896
+
10855
10897
  <xsl:value-of select="@label"/>
10898
+
10856
10899
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
10857
10900
  <xsl:value-of select="$style_suffix"/>
10858
10901
  </xsl:if>
10859
10902
  </xsl:variable>
10860
10903
 
10861
- <xsl:value-of select="normalize-space($label)"/>
10904
+ <xsl:value-of select="normalize-space($label)"/>
10862
10905
 
10863
10906
  </xsl:when>
10864
10907
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -13052,7 +13095,8 @@
13052
13095
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
13053
13096
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
13054
13097
  <!-- Todo: need update -->
13055
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13098
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13099
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13056
13100
 
13057
13101
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
13058
13102
  <xsl:attribute name="src">
@@ -13073,6 +13117,9 @@
13073
13117
  <xsl:if test="$afrelationship != ''">
13074
13118
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13075
13119
  </xsl:if>
13120
+ <xsl:if test="$volatile != ''">
13121
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13122
+ </xsl:if>
13076
13123
  </pdf:embedded-file>
13077
13124
  </xsl:for-each>
13078
13125
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -13083,14 +13130,18 @@
13083
13130
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13084
13131
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13085
13132
  <!-- Todo: need update -->
13086
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13133
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13134
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13087
13135
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
13088
13136
  <xsl:if test="$description != ''">
13089
13137
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13090
13138
  </xsl:if>
13091
13139
  <xsl:if test="$afrelationship != ''">
13092
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13093
- </xsl:if>
13140
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13141
+ </xsl:if>
13142
+ <xsl:if test="$volatile != ''">
13143
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13144
+ </xsl:if>
13094
13145
  </pdf:embedded-file>
13095
13146
  </xsl:for-each>
13096
13147
  </xsl:if>
@@ -13137,10 +13188,31 @@
13137
13188
  <xsl:value-of select="$level_total - 2"/>
13138
13189
  </xsl:when>
13139
13190
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
13140
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13191
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
13192
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
13193
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
13194
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
13195
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
13196
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
13197
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
13198
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
13199
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
13200
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
13201
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
13141
13202
  <xsl:choose>
13142
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13143
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
13203
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
13204
+ <xsl:value-of select="number($curr_clause_depth)"/>
13205
+ </xsl:when>
13206
+ <xsl:otherwise>
13207
+ <xsl:value-of select="$level_total - 2"/>
13208
+ </xsl:otherwise>
13209
+ </xsl:choose>
13210
+ </xsl:when>
13211
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
13212
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13213
+ <xsl:choose>
13214
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
13215
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
13144
13216
  </xsl:when>
13145
13217
  <xsl:otherwise>
13146
13218
  <xsl:value-of select="$level_total - 2"/>
@@ -13148,7 +13220,7 @@
13148
13220
  </xsl:choose>
13149
13221
  </xsl:when>
13150
13222
  <xsl:when test="ancestor::*[local-name() = 'sections']">
13151
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
13223
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13152
13224
  <xsl:choose>
13153
13225
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13154
13226
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -13465,9 +13537,10 @@
13465
13537
  <xsl:template name="insertBackgroundPageImage">
13466
13538
  <xsl:param name="number">1</xsl:param>
13467
13539
  <xsl:param name="name">coverpage-image</xsl:param>
13540
+ <xsl:param name="suffix"/>
13468
13541
  <xsl:variable name="num" select="number($number)"/>
13469
13542
  <!-- background image -->
13470
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
13543
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
13471
13544
  <fo:block>
13472
13545
  <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
13473
13546
  <xsl:choose>
@@ -13533,16 +13606,29 @@
13533
13606
 
13534
13607
  <!-- END: insert cover page image -->
13535
13608
 
13609
+ <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
13536
13610
  <xsl:template name="insertVerticalChar">
13537
13611
  <xsl:param name="str"/>
13612
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
13613
+ <xsl:param name="reference-orientation">90</xsl:param>
13538
13614
  <xsl:if test="string-length($str) &gt; 0">
13539
- <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
13615
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
13616
+ <xsl:if test="normalize-space($writing-mode) != ''">
13617
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13618
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13619
+ </xsl:if>
13620
+ <xsl:variable name="char" select="substring($str,1,1)"/>
13621
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13622
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
13623
+ </xsl:if>
13540
13624
  <fo:block-container width="1em">
13541
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
13625
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
13542
13626
  </fo:block-container>
13543
13627
  </fo:inline-container>
13544
13628
  <xsl:call-template name="insertVerticalChar">
13545
13629
  <xsl:with-param name="str" select="substring($str, 2)"/>
13630
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
13631
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13546
13632
  </xsl:call-template>
13547
13633
  </xsl:if>
13548
13634
  </xsl:template>
@@ -32,7 +32,7 @@ module IsoDoc
32
32
  @anchors[clause["id"]] =
33
33
  { label: num, level: level, xref: num }
34
34
  # subclauses are not prefixed with "Clause"
35
- i = Counter.new(0, prefix: "#{num}.")
35
+ i = Counter.new(0, prefix: num)
36
36
  clause.xpath(ns("./clause | ./terms | ./term | ./definitions | " \
37
37
  "./references")).each do |c|
38
38
  section_names1(c, i.increment(c).print, level + 1)
@@ -45,7 +45,7 @@ module IsoDoc
45
45
  clause.at(ns("./clause")) and
46
46
  @anchors[clause["id"]] = { label: "0", level: 1, type: "clause",
47
47
  xref: clause.at(ns("./title"))&.text }
48
- i = Counter.new(0, prefix: "0.")
48
+ i = Counter.new(0, prefix: "0")
49
49
  clause.xpath(ns("./clause")).each do |c|
50
50
  section_names1(c, i.increment(c).print, 2)
51
51
  end
@@ -72,6 +72,9 @@ standards defining organization, and that is rendered in a distinct manner</a:do
72
72
  from other documents in the same doctype</a:documentation>
73
73
  </ref>
74
74
  </optional>
75
+ <ref name="flavor">
76
+ <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
77
+ </ref>
75
78
  <optional>
76
79
  <ref name="editorialgroup">
77
80
  <a:documentation>Groups associated with the production of the standards document, typically within
@@ -113,6 +116,16 @@ a standards definition organization</a:documentation>
113
116
  <define name="DocumentSubtype">
114
117
  <text/>
115
118
  </define>
119
+ <define name="flavor">
120
+ <element name="flavor">
121
+ <ref name="MetanormaFlavor"/>
122
+ </element>
123
+ </define>
124
+ <define name="MetanormaFlavor">
125
+ <a:documentation>This is in fact an enum, as of this writing: standoc iso generic ietf ieee itu nist ogc csa cc iho ribose jis iec bsi bipm plateau.
126
+ However we prefer not to hardcode it, given ongoing extension.</a:documentation>
127
+ <text/>
128
+ </define>
116
129
  <define name="editorialgroup">
117
130
  <a:documentation>A group associated with the production of the standards document, typically within
118
131
  a standards definition organization</a:documentation>
@@ -1382,18 +1382,7 @@ Applies whether the resource has already been created or not, and whether it is
1382
1382
  <define name="bdate">
1383
1383
  <a:documentation>Significant date in the lifecycle of the bibliographic item, including its production and its access</a:documentation>
1384
1384
  <element name="date">
1385
- <attribute name="type">
1386
- <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1387
- <choice>
1388
- <ref name="BibliographicDateType"/>
1389
- <text/>
1390
- </choice>
1391
- </attribute>
1392
- <optional>
1393
- <attribute name="text">
1394
- <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1395
- </attribute>
1396
- </optional>
1385
+ <ref name="bDateAttributes"/>
1397
1386
  <optional>
1398
1387
  <choice>
1399
1388
  <group>
@@ -1416,6 +1405,20 @@ Applies whether the resource has already been created or not, and whether it is
1416
1405
  </optional>
1417
1406
  </element>
1418
1407
  </define>
1408
+ <define name="bDateAttributes">
1409
+ <attribute name="type">
1410
+ <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1411
+ <choice>
1412
+ <ref name="BibliographicDateType"/>
1413
+ <text/>
1414
+ </choice>
1415
+ </attribute>
1416
+ <optional>
1417
+ <attribute name="text">
1418
+ <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1419
+ </attribute>
1420
+ </optional>
1421
+ </define>
1419
1422
  <define name="docidentifier">
1420
1423
  <a:documentation>An identifier of a bibliographic item in an international standard scheme</a:documentation>
1421
1424
  <element name="docidentifier">
@@ -1884,6 +1887,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1884
1887
  <value>hasAnnotation</value>
1885
1888
  <value>draftOf</value>
1886
1889
  <value>hasDraft</value>
1890
+ <value>preliminaryDraftOf</value>
1891
+ <value>hasPreliminaryDraft</value>
1892
+ <value>revisionDraftOf</value>
1893
+ <value>hasRevisionDraft</value>
1887
1894
  <value>editionOf</value>
1888
1895
  <value>hasEdition</value>
1889
1896
  <value>updates</value>
@@ -30,6 +30,7 @@
30
30
  <optional>
31
31
  <ref name="docsubtype"/>
32
32
  </optional>
33
+ <ref name="flavor"/>
33
34
  <ref name="editorialgroup"/>
34
35
  <zeroOrMore>
35
36
  <ref name="ics"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.5.3".freeze
3
+ VERSION = "2.5.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.3
4
+ version: 2.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-30 00:00:00.000000000 Z
11
+ date: 2024-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic