metanorma-ribose 2.2.0 → 2.2.2

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: 0a6232179686f66cbd2c5eff24711ccfc03c241075f8338c74ff0dd9b62ab305
4
- data.tar.gz: bd5d151cd18b5b372b9b7bdd9fb0d49ed4137fb0f297f766244363a0cd46f9c6
3
+ metadata.gz: b52a4ce5e81936ba043035a243a88a1fe2d8f1c17f8b1195499fbd0ea30ea8cd
4
+ data.tar.gz: e0f5af98060005b86849b0b8651b3fbae732dd8a446f9f03aae558a86f633eac
5
5
  SHA512:
6
- metadata.gz: f7c60b4dec2755741d5e109311acda0ef95a3c7cd9bde3c8701360fcde125c7b883e0678a3ab76a98ecd5da8337cd738f93b9a4ea1223b067365b079880b66ed
7
- data.tar.gz: 4f6924cf224c226380ba24a208e80afdb5b129d962541002823bf75901190b616fdd3dd0e08d424e77f7e1d9e5120a16b90469b0fbe07034700ae6096876fccb
6
+ metadata.gz: a5857de14aea32a150ff1dea4cb9a59754b42d8f51f8bbbd71d8ce609a3945e0489ce4cbe44212f28fa75fd0b71c19d228f900514f6e5de64242c62bdb1435ad
7
+ data.tar.gz: d1e0d6d808ed9bc5b758d83395ba39e764c54364cf2e7214c976fd67a4ba27b9e7a7a36d309a2c06416ef080f694c65e6b89e0a0277706d3cbe32756fcfec5a7
@@ -131,6 +131,35 @@ a.FootnoteRef + a.FootnoteRef:before {
131
131
  color: red;
132
132
  text-decoration: line-through; }
133
133
 
134
+ /* code highlighting with line numbers */
135
+ table.rouge-line-table td.rouge-gutter {
136
+ -moz-user-select: none;
137
+ -ms-user-select: none;
138
+ -webkit-user-select: none;
139
+ user-select: none;
140
+ padding-right: 1em; }
141
+
142
+ table.rouge-line-table td.rouge-code {
143
+ -moz-user-select: all;
144
+ -ms-user-select: all;
145
+ -webkit-user-select: all;
146
+ user-select: all; }
147
+
148
+ table.rouge-line-table,
149
+ table.rouge-line-table th,
150
+ table.rouge-line-table td {
151
+ width: auto;
152
+ border: none;
153
+ margin: 0;
154
+ padding: 0;
155
+ font-size: 100%; }
156
+
157
+ table.rouge-line-table pre {
158
+ margin: 0;
159
+ padding: 0;
160
+ overflow-x: visible;
161
+ font-size: 100%; }
162
+
134
163
  #standard-band {
135
164
  background-color: #0AC442; }
136
165
 
@@ -622,8 +651,11 @@ a:hover {
622
651
  background: #1661AD;
623
652
  box-shadow: 3px 0 0 #1661AD, -3px 0 0 #1661AD; }
624
653
 
625
- ::selection,
626
- ::-moz-selection {
654
+ *::selection {
655
+ background: #1661AD;
656
+ color: white; }
657
+
658
+ *::-moz-selection {
627
659
  background: #1661AD;
628
660
  color: white; }
629
661
 
@@ -784,7 +816,7 @@ table {
784
816
  table th, table td {
785
817
  padding: 1em; }
786
818
  table td.header {
787
- font-weigth: 400; }
819
+ font-weight: 400; }
788
820
 
789
821
  p.TableTitle {
790
822
  text-align: center;
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
5
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
@@ -2030,6 +2030,10 @@
2030
2030
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2031
2031
  </xsl:attribute-set>
2032
2032
 
2033
+ <xsl:attribute-set name="figure-block-style">
2034
+
2035
+ </xsl:attribute-set>
2036
+
2033
2037
  <xsl:attribute-set name="figure-style">
2034
2038
  <!-- background for image -->
2035
2039
  <xsl:attribute name="background-color">rgb(236,242,246)</xsl:attribute>
@@ -3478,6 +3482,10 @@
3478
3482
  <xsl:with-param name="continued">true</xsl:with-param>
3479
3483
  </xsl:apply-templates>
3480
3484
 
3485
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
3486
+ <fo:block/>
3487
+ </xsl:if>
3488
+
3481
3489
  </fo:table-cell>
3482
3490
  </fo:table-row>
3483
3491
  </xsl:template> <!-- table-header-title -->
@@ -3836,7 +3844,7 @@
3836
3844
  </fn>
3837
3845
  -->
3838
3846
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
3839
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
3847
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
3840
3848
 
3841
3849
  <!-- list of footnotes to calculate actual footnotes number -->
3842
3850
  <xsl:variable name="p_fn_">
@@ -3867,7 +3875,22 @@
3867
3875
 
3868
3876
  <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3869
3877
  <xsl:variable name="footnote_inline">
3870
- <fo:inline xsl:use-attribute-sets="fn-num-style">
3878
+ <fo:inline>
3879
+
3880
+ <xsl:variable name="fn_styles">
3881
+ <xsl:choose>
3882
+ <xsl:when test="ancestor::*[local-name() = 'bibitem']">
3883
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
3884
+ </xsl:when>
3885
+ <xsl:otherwise>
3886
+ <fn_styles xsl:use-attribute-sets="fn-num-style"/>
3887
+ </xsl:otherwise>
3888
+ </xsl:choose>
3889
+ </xsl:variable>
3890
+
3891
+ <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
3892
+ <xsl:copy-of select="."/>
3893
+ </xsl:for-each>
3871
3894
 
3872
3895
  <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
3873
3896
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
@@ -3878,8 +3901,7 @@
3878
3901
  </fo:basic-link>
3879
3902
  </fo:inline>
3880
3903
  </xsl:variable>
3881
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3882
- gen_id=<xsl:value-of select="$gen_id"/> -->
3904
+
3883
3905
  <xsl:choose>
3884
3906
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3885
3907
  <xsl:copy-of select="$footnote_inline"/>
@@ -3931,7 +3953,10 @@
3931
3953
  </xsl:for-each>
3932
3954
  <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
3933
3955
  <xsl:sort select="@displayorder" data-type="number"/>
3934
- <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3956
+ <!-- commented:
3957
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3958
+ because 'fn' there is in biblio-tag -->
3959
+ <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3935
3960
  <!-- copy unique fn -->
3936
3961
  <fn gen_id="{generate-id(.)}">
3937
3962
  <xsl:copy-of select="@*"/>
@@ -4788,7 +4813,7 @@
4788
4813
 
4789
4814
  <xsl:variable name="_font-size">
4790
4815
 
4791
- <!-- 10 -->
4816
+ <!-- inherit -->
4792
4817
 
4793
4818
  <xsl:choose>
4794
4819
  <xsl:when test="ancestor::*[local-name() = 'table']">inherit</xsl:when>
@@ -5761,6 +5786,33 @@
5761
5786
  </xsl:choose>
5762
5787
  </xsl:template>
5763
5788
 
5789
+ <xsl:template name="getLang_fromCurrentNode">
5790
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5791
+ <xsl:variable name="language">
5792
+ <xsl:choose>
5793
+ <xsl:when test="$language_current != ''">
5794
+ <xsl:value-of select="$language_current"/>
5795
+ </xsl:when>
5796
+ <xsl:otherwise>
5797
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5798
+ <xsl:choose>
5799
+ <xsl:when test="$language_current_2 != ''">
5800
+ <xsl:value-of select="$language_current_2"/>
5801
+ </xsl:when>
5802
+ <xsl:otherwise>
5803
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
5804
+ </xsl:otherwise>
5805
+ </xsl:choose>
5806
+ </xsl:otherwise>
5807
+ </xsl:choose>
5808
+ </xsl:variable>
5809
+
5810
+ <xsl:choose>
5811
+ <xsl:when test="$language = 'English'">en</xsl:when>
5812
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
5813
+ </xsl:choose>
5814
+ </xsl:template>
5815
+
5764
5816
  <xsl:template name="capitalizeWords">
5765
5817
  <xsl:param name="str"/>
5766
5818
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -6390,7 +6442,7 @@
6390
6442
  <xsl:template match="*[local-name() = 'figure']" name="figure">
6391
6443
  <xsl:variable name="isAdded" select="@added"/>
6392
6444
  <xsl:variable name="isDeleted" select="@deleted"/>
6393
- <fo:block-container id="{@id}">
6445
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6394
6446
 
6395
6447
  <xsl:call-template name="setTrackChangesStyles">
6396
6448
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -6469,7 +6521,9 @@
6469
6521
 
6470
6522
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
6471
6523
  <xsl:if test="number($scale) &lt; 100">
6472
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6524
+
6525
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6526
+
6473
6527
  </xsl:if>
6474
6528
 
6475
6529
  </xsl:if>
@@ -7377,7 +7431,13 @@
7377
7431
  </xsl:template>
7378
7432
 
7379
7433
  <xsl:template match="text()" mode="contents_item">
7380
- <xsl:call-template name="keep_together_standard_number"/>
7434
+ <xsl:variable name="text">
7435
+ <!-- to split by '_' and other chars -->
7436
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
7437
+ </xsl:variable>
7438
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
7439
+ <xsl:call-template name="keep_together_standard_number"/>
7440
+ </xsl:for-each>
7381
7441
  </xsl:template>
7382
7442
 
7383
7443
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -7388,39 +7448,57 @@
7388
7448
  <!-- =============== -->
7389
7449
  <!-- sourcecode -->
7390
7450
  <!-- =============== -->
7391
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7392
7451
 
7393
- <xsl:variable name="sourcecode_attributes">
7394
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
7395
- <xsl:variable name="_font-size">
7452
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
7453
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
7454
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
7396
7455
 
7397
- <!-- 9 -->
7456
+ <xsl:template match="*[local-name() = 'property']" mode="css">
7457
+ <xsl:attribute name="{@name}">
7458
+ <xsl:value-of select="@value"/>
7459
+ </xsl:attribute>
7460
+ </xsl:template>
7398
7461
 
7399
- <!-- <xsl:if test="$namespace = 'ieee'">
7400
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
7401
- </xsl:if> -->
7462
+ <xsl:template name="get_sourcecode_attributes">
7463
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
7464
+ <xsl:variable name="_font-size">
7402
7465
 
7403
- <xsl:choose>
7404
- <xsl:when test="ancestor::*[local-name() = 'table']">inherit</xsl:when>
7405
- <xsl:otherwise>95%</xsl:otherwise><!-- 110% -->
7406
- </xsl:choose>
7466
+ <!-- inherit -->
7407
7467
 
7408
- </xsl:variable>
7468
+ <!-- <xsl:if test="$namespace = 'ieee'">
7469
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
7470
+ </xsl:if> -->
7409
7471
 
7410
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
7411
- <xsl:if test="$font-size != ''">
7412
- <xsl:attribute name="font-size">
7413
- <xsl:choose>
7414
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
7415
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
7416
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
7417
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
7418
- </xsl:choose>
7419
- </xsl:attribute>
7420
- </xsl:if>
7421
- </xsl:element>
7472
+ <xsl:choose>
7473
+ <xsl:when test="ancestor::*[local-name() = 'table'][not(parent::*[local-name() = 'sourcecode'][@linenums = 'true'])]">inherit</xsl:when>
7474
+ <xsl:otherwise>95%</xsl:otherwise><!-- 110% -->
7475
+ </xsl:choose>
7476
+
7477
+ </xsl:variable>
7478
+
7479
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
7480
+ <xsl:if test="$font-size != ''">
7481
+ <xsl:attribute name="font-size">
7482
+ <xsl:choose>
7483
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
7484
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
7485
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
7486
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
7487
+ </xsl:choose>
7488
+ </xsl:attribute>
7489
+ </xsl:if>
7490
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
7491
+ </xsl:element>
7492
+ </xsl:template>
7493
+
7494
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7495
+
7496
+ <xsl:variable name="sourcecode_attributes">
7497
+ <xsl:call-template name="get_sourcecode_attributes"/>
7422
7498
  </xsl:variable>
7423
7499
 
7500
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
7501
+
7424
7502
  <xsl:choose>
7425
7503
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
7426
7504
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -7479,6 +7557,12 @@
7479
7557
  </xsl:if>
7480
7558
  </xsl:if>
7481
7559
 
7560
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
7561
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
7562
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7563
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7564
+ </xsl:if>
7565
+
7482
7566
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7483
7567
  </fo:block>
7484
7568
 
@@ -7488,9 +7572,10 @@
7488
7572
  </xsl:choose>
7489
7573
  </xsl:template>
7490
7574
 
7491
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
7575
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
7492
7576
  <xsl:choose>
7493
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
7577
+ <!-- disabled -->
7578
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
7494
7579
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
7495
7580
  <xsl:choose>
7496
7581
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -7505,8 +7590,76 @@
7505
7590
  <xsl:call-template name="add_spaces_to_sourcecode"/>
7506
7591
  </xsl:otherwise>
7507
7592
  </xsl:choose>
7593
+ </xsl:template>
7594
+
7595
+ <!-- add sourcecode highlighting -->
7596
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
7597
+ <xsl:variable name="class" select="@class"/>
7598
+ <xsl:choose>
7599
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
7600
+ <fo:inline>
7601
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
7602
+ <xsl:apply-templates/>
7603
+ </fo:inline>
7604
+ </xsl:when>
7605
+ <xsl:otherwise>
7606
+ <xsl:apply-templates/>
7607
+ </xsl:otherwise>
7608
+ </xsl:choose>
7609
+ </xsl:template>
7508
7610
 
7611
+ <!-- outer table with line numbers for sourcecode -->
7612
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
7613
+ <fo:block>
7614
+ <fo:table width="100%" table-layout="fixed">
7615
+ <xsl:copy-of select="@id"/>
7616
+ <fo:table-column column-width="8%"/>
7617
+ <fo:table-column column-width="92%"/>
7618
+ <fo:table-body>
7619
+ <xsl:apply-templates/>
7620
+ </fo:table-body>
7621
+ </fo:table>
7622
+ </fo:block>
7623
+ </xsl:template>
7624
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
7625
+ <xsl:apply-templates/>
7626
+ </xsl:template>
7627
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
7628
+ <fo:table-row>
7629
+ <xsl:apply-templates/>
7630
+ </fo:table-row>
7509
7631
  </xsl:template>
7632
+ <!-- first td with line numbers -->
7633
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
7634
+ <fo:table-cell>
7635
+ <fo:block>
7636
+
7637
+ <!-- set attibutes for line numbers - same as sourcecode -->
7638
+ <xsl:variable name="sourcecode_attributes">
7639
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
7640
+ <xsl:call-template name="get_sourcecode_attributes"/>
7641
+ </xsl:for-each>
7642
+ </xsl:variable>
7643
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
7644
+ <xsl:attribute name="{local-name()}">
7645
+ <xsl:value-of select="."/>
7646
+ </xsl:attribute>
7647
+ </xsl:for-each>
7648
+
7649
+ <xsl:apply-templates/>
7650
+ </fo:block>
7651
+ </fo:table-cell>
7652
+ </xsl:template>
7653
+
7654
+ <!-- second td with sourcecode -->
7655
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
7656
+ <fo:table-cell>
7657
+ <fo:block>
7658
+ <xsl:apply-templates/>
7659
+ </fo:block>
7660
+ </fo:table-cell>
7661
+ </xsl:template>
7662
+ <!-- END outer table with line numbers for sourcecode -->
7510
7663
 
7511
7664
  <xsl:template name="add_spaces_to_sourcecode">
7512
7665
  <xsl:variable name="text_step1">
@@ -7737,7 +7890,25 @@
7737
7890
  <xsl:template match="*[local-name()='pre']" name="pre">
7738
7891
  <fo:block xsl:use-attribute-sets="pre-style">
7739
7892
  <xsl:copy-of select="@id"/>
7740
- <xsl:apply-templates/>
7893
+ <xsl:choose>
7894
+
7895
+ <xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
7896
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
7897
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7898
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7899
+ </xsl:if>
7900
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
7901
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
7902
+ <mtext><xsl:value-of select="."/></mtext>
7903
+ </math>
7904
+ </fo:instream-foreign-object>
7905
+ </xsl:when>
7906
+
7907
+ <xsl:otherwise>
7908
+ <xsl:apply-templates/>
7909
+ </xsl:otherwise>
7910
+
7911
+ </xsl:choose>
7741
7912
  </fo:block>
7742
7913
  </xsl:template>
7743
7914
  <!-- =============== -->
@@ -9183,27 +9354,16 @@
9183
9354
  <fo:list-item>
9184
9355
  <fo:list-item-label end-indent="label-end()">
9185
9356
  <fo:block>
9186
- <fo:inline>
9187
-
9188
- <xsl:number format="1." count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
9189
-
9190
- </fo:inline>
9357
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9358
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
9359
+ </xsl:apply-templates>
9191
9360
  </fo:block>
9192
9361
  </fo:list-item-label>
9193
9362
  <fo:list-item-body start-indent="body-start()">
9194
9363
  <fo:block>
9195
- <xsl:variable name="docidentifier">
9196
- <xsl:choose>
9197
- <xsl:when test="rsd:docidentifier/@type = 'metanorma'"/>
9198
- <xsl:otherwise>
9199
- <xsl:value-of select="rsd:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9200
- </xsl:otherwise>
9201
- </xsl:choose>
9202
- </xsl:variable>
9203
- <xsl:value-of select="$docidentifier"/>
9204
- <xsl:if test="normalize-space($docidentifier) != '' and rsd:formattedref">
9205
- <xsl:text>, </xsl:text>
9206
- </xsl:if>
9364
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9365
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
9366
+ </xsl:apply-templates>
9207
9367
  <xsl:apply-templates select="rsd:formattedref"/>
9208
9368
  </fo:block>
9209
9369
  </fo:list-item-body>
@@ -9214,170 +9374,51 @@
9214
9374
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9215
9375
 
9216
9376
  <xsl:template name="processBibitem">
9377
+ <xsl:param name="biblio_tag_part">both</xsl:param>
9217
9378
 
9218
- <!-- start RSD bibitem processing -->
9219
- <xsl:if test=".//rsd:fn">
9379
+ <!-- start bibitem processing -->
9380
+ <xsl:if test=".//*[local-name() = 'fn']">
9220
9381
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
9221
9382
  </xsl:if>
9222
- <xsl:variable name="docidentifier" select="rsd:docidentifier"/>
9223
- <xsl:value-of select="$docidentifier"/>
9224
- <xsl:apply-templates select="rsd:note"/>
9225
- <xsl:if test="normalize-space($docidentifier) != '' and rsd:formattedref">, </xsl:if>
9226
- <xsl:apply-templates select="rsd:formattedref"/>
9227
- <!-- END RSD bibitem processing -->
9383
+
9384
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9385
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
9386
+ </xsl:apply-templates>
9387
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
9388
+ <!-- end bibitem processing -->
9228
9389
 
9229
9390
  </xsl:template> <!-- processBibitem (bibitem) -->
9230
9391
 
9231
- <xsl:template name="processBibitemDocId">
9232
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
9233
- <xsl:choose>
9234
- <xsl:when test="normalize-space($_doc_ident) != ''">
9235
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
9236
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
9237
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
9238
- </xsl:if> -->
9239
- <xsl:value-of select="$_doc_ident"/>
9240
- </xsl:when>
9241
- <xsl:otherwise>
9242
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
9243
- <xsl:if test="$type != ''">
9244
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
9245
- </xsl:if> -->
9246
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
9247
- </xsl:otherwise>
9248
- </xsl:choose>
9249
- </xsl:template> <!-- processBibitemDocId -->
9392
+ <xsl:template match="*[local-name() = 'title']" mode="title">
9393
+ <fo:inline><xsl:apply-templates/></fo:inline>
9394
+ </xsl:template>
9395
+
9396
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
9250
9397
 
9251
- <xsl:template name="processPersonalAuthor">
9398
+ <xsl:template match="*[local-name() = 'formattedref']">
9399
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
9400
+ <xsl:text>, </xsl:text>
9401
+ </xsl:if> -->
9402
+ <xsl:apply-templates/>
9403
+ </xsl:template>
9404
+
9405
+ <xsl:template match="*[local-name() = 'biblio-tag']">
9406
+ <xsl:param name="biblio_tag_part">both</xsl:param>
9252
9407
  <xsl:choose>
9253
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
9254
- <author>
9255
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
9256
- </author>
9257
- </xsl:when>
9258
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
9259
- <author>
9260
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
9261
- <xsl:text> </xsl:text>
9262
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
9263
- </author>
9408
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
9409
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
9264
9410
  </xsl:when>
9265
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
9266
- <author>
9267
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
9268
- <xsl:text> </xsl:text>
9269
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
9270
- </author>
9411
+ <xsl:when test="$biblio_tag_part = 'last'">
9412
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
9271
9413
  </xsl:when>
9272
9414
  <xsl:otherwise>
9273
9415
  <xsl:apply-templates/>
9274
9416
  </xsl:otherwise>
9275
9417
  </xsl:choose>
9276
- </xsl:template> <!-- processPersonalAuthor -->
9277
-
9278
- <xsl:template name="renderDate">
9279
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
9280
- <xsl:value-of select="*[local-name() = 'on']"/>
9281
- </xsl:if>
9282
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
9283
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
9284
- </xsl:if>
9285
- </xsl:template>
9286
-
9287
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
9288
- <xsl:value-of select="translate(.,'. ','')"/>
9289
- </xsl:template>
9290
-
9291
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
9292
- <xsl:value-of select="substring(.,1,1)"/>
9293
- </xsl:template>
9294
-
9295
- <xsl:template match="*[local-name() = 'title']" mode="title">
9296
- <fo:inline><xsl:apply-templates/></fo:inline>
9297
9418
  </xsl:template>
9298
9419
 
9299
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
9300
- <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
9301
- <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
9302
- <xsl:apply-templates/>
9303
- </fo:inline>
9304
- </xsl:template>
9305
-
9306
- <!-- bibitem/note renders as footnote -->
9307
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
9308
-
9309
- <!-- list of footnotes to calculate actual footnotes number -->
9310
- <xsl:variable name="p_fn_">
9311
- <xsl:call-template name="get_fn_list"/>
9312
- </xsl:variable>
9313
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
9314
- <xsl:variable name="gen_id" select="generate-id(.)"/>
9315
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
9316
- <!-- fn sequence number in document -->
9317
- <xsl:variable name="current_fn_number">
9318
- <xsl:choose>
9319
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
9320
- <xsl:otherwise>
9321
- <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
9322
- <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
9323
- </xsl:otherwise>
9324
- </xsl:choose>
9325
- </xsl:variable>
9326
- <fo:footnote>
9327
- <xsl:variable name="number">
9328
-
9329
- <xsl:choose>
9330
- <xsl:when test="ancestor::*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]">
9331
- <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
9332
- </xsl:when>
9333
- <xsl:otherwise>
9334
- <xsl:value-of select="$current_fn_number"/>
9335
- </xsl:otherwise>
9336
- </xsl:choose>
9337
-
9338
- </xsl:variable>
9339
-
9340
- <xsl:variable name="current_fn_number_text">
9341
- <xsl:value-of select="$number"/>
9342
-
9343
- </xsl:variable>
9344
-
9345
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
9346
- <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
9347
- <xsl:value-of select="$current_fn_number_text"/>
9348
- </fo:basic-link>
9349
- </fo:inline>
9350
- <fo:footnote-body>
9351
- <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
9352
- <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
9353
- <xsl:value-of select="$current_fn_number_text"/>
9354
- </fo:inline>
9355
- <xsl:apply-templates/>
9356
- </fo:block>
9357
- </fo:footnote-body>
9358
- </fo:footnote>
9359
- </xsl:template>
9360
-
9361
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
9362
- <xsl:text> edition </xsl:text>
9363
- <xsl:value-of select="."/>
9364
- </xsl:template>
9365
-
9366
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
9367
- <xsl:text> (</xsl:text>
9368
- <fo:inline xsl:use-attribute-sets="link-style">
9369
- <fo:basic-link external-destination="." fox:alt-text=".">
9370
- <xsl:value-of select="."/>
9371
- </fo:basic-link>
9372
- </fo:inline>
9373
- <xsl:text>)</xsl:text>
9374
- </xsl:template>
9375
-
9376
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
9377
-
9378
- <xsl:template match="*[local-name() = 'formattedref']">
9379
-
9380
- <xsl:apply-templates/>
9420
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
9421
+ <xsl:text> </xsl:text>
9381
9422
  </xsl:template>
9382
9423
 
9383
9424
  <!-- ======================= -->
@@ -9806,6 +9847,12 @@
9806
9847
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
9807
9848
  <xsl:apply-templates mode="update_xml_step1"/>
9808
9849
  </xsl:template>
9850
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
9851
+ <xsl:copy>
9852
+ <xsl:copy-of select="@*"/>
9853
+ <xsl:apply-templates mode="update_xml_step1"/>
9854
+ </xsl:copy>
9855
+ </xsl:template>
9809
9856
  <!-- =========================================================================== -->
9810
9857
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9811
9858
  <!-- =========================================================================== -->
@@ -10286,6 +10333,10 @@
10286
10333
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
10287
10334
  </xsl:template>
10288
10335
 
10336
+ <xsl:template name="getDocumentId_fromCurrentNode">
10337
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
10338
+ </xsl:template>
10339
+
10289
10340
  <xsl:template name="namespaceCheck">
10290
10341
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
10291
10342
  <xsl:variable name="XSLNS">
@@ -571,6 +571,11 @@
571
571
  <ref name="MultilingualRenderingType"/>
572
572
  </attribute>
573
573
  </optional>
574
+ <optional>
575
+ <attribute name="linenums">
576
+ <data type="boolean"/>
577
+ </attribute>
578
+ </optional>
574
579
  <optional>
575
580
  <ref name="tname"/>
576
581
  </optional>
@@ -1238,6 +1243,11 @@
1238
1243
  </define>
1239
1244
  <define name="concept">
1240
1245
  <element name="concept">
1246
+ <optional>
1247
+ <attribute name="bold">
1248
+ <data type="boolean"/>
1249
+ </attribute>
1250
+ </optional>
1241
1251
  <optional>
1242
1252
  <attribute name="ital">
1243
1253
  <data type="boolean"/>
@@ -2653,7 +2663,7 @@
2653
2663
  <value>full</value>
2654
2664
  <value>short</value>
2655
2665
  <value>id</value>
2656
- <value>modspec</value>
2666
+ <text/>
2657
2667
  </choice>
2658
2668
  </define>
2659
2669
  <define name="erefTypeWithConnective">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.2.0".freeze
3
+ VERSION = "2.2.2".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.2.0
4
+ version: 2.2.2
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-12-05 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic