metanorma-csa 2.1.6 → 2.1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -1
- data/.github/workflows/release.yml +24 -0
- data/lib/isodoc/csa/csa.standard.xsl +117 -152
- data/lib/metanorma/csa/biblio.rng +8 -5
- data/lib/metanorma/csa/version.rb +1 -1
- data/lib/metanorma-csa.rb +2 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b01c8108d7a67ce80c81d8be6792c03265c1102c3590d17935cff8910a0afd29
|
4
|
+
data.tar.gz: 74b805b5836c1948302472791bb84dc3bc1ec00456afaad4552701d40b96ae26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7c208e3a5e9db5c9cb2bee90fa18a37ee9a52595e4b965d3cc00942bc9098b8ec37371822396cbd29c4617692fa1a0c23de9d5d4676179498bc03ee7cb949df
|
7
|
+
data.tar.gz: a6894c014083095d58bb1e6a0962b4826bc366b2d21ef2ce91f50f16fc0c631e0e7d6967f27990e273f74c4e86d11a8cfc1ae099c774c7dc6b97fe37b17fd022
|
data/.github/workflows/rake.yml
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: release
|
4
|
+
|
5
|
+
on:
|
6
|
+
workflow_dispatch:
|
7
|
+
inputs:
|
8
|
+
next_version:
|
9
|
+
description: |
|
10
|
+
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
11
|
+
required: true
|
12
|
+
default: 'skip'
|
13
|
+
push:
|
14
|
+
tags: [ v* ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
release:
|
18
|
+
uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
|
19
|
+
with:
|
20
|
+
next_version: ${{ github.event.inputs.next_version }}
|
21
|
+
secrets:
|
22
|
+
rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
|
23
|
+
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
24
|
+
|
@@ -599,8 +599,18 @@
|
|
599
599
|
|
600
600
|
<xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
|
601
601
|
|
602
|
+
<xsl:variable name="isApplyAutolayoutAlgorithm_">
|
603
|
+
true
|
604
|
+
</xsl:variable>
|
605
|
+
<xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
|
606
|
+
|
602
607
|
<xsl:variable name="isGenerateTableIF_">
|
603
|
-
|
608
|
+
<xsl:choose>
|
609
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
|
610
|
+
<xsl:value-of select="normalize-space($table_if) = 'true'"/>
|
611
|
+
</xsl:when>
|
612
|
+
<xsl:otherwise>false</xsl:otherwise>
|
613
|
+
</xsl:choose>
|
604
614
|
</xsl:variable>
|
605
615
|
<xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
|
606
616
|
|
@@ -1015,6 +1025,9 @@
|
|
1015
1025
|
<xsl:attribute-set name="import-style">
|
1016
1026
|
</xsl:attribute-set>
|
1017
1027
|
|
1028
|
+
<xsl:attribute-set name="component-style">
|
1029
|
+
</xsl:attribute-set>
|
1030
|
+
|
1018
1031
|
<xsl:attribute-set name="recommendation-style">
|
1019
1032
|
|
1020
1033
|
</xsl:attribute-set>
|
@@ -1192,7 +1205,7 @@
|
|
1192
1205
|
</xsl:attribute-set>
|
1193
1206
|
|
1194
1207
|
<xsl:attribute-set name="dt-block-style">
|
1195
|
-
<xsl:attribute name="margin-top">
|
1208
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
1196
1209
|
|
1197
1210
|
</xsl:attribute-set>
|
1198
1211
|
|
@@ -2166,6 +2179,7 @@
|
|
2166
2179
|
|
2167
2180
|
<xsl:variable name="margin-side">
|
2168
2181
|
<xsl:choose>
|
2182
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
|
2169
2183
|
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
2170
2184
|
<xsl:otherwise>0</xsl:otherwise>
|
2171
2185
|
</xsl:choose>
|
@@ -2234,6 +2248,7 @@
|
|
2234
2248
|
</td>
|
2235
2249
|
</tr>
|
2236
2250
|
-->
|
2251
|
+
<!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
|
2237
2252
|
<xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
|
2238
2253
|
|
2239
2254
|
</xsl:when>
|
@@ -2368,12 +2383,17 @@
|
|
2368
2383
|
<xsl:template name="calculate-column-widths">
|
2369
2384
|
<xsl:param name="table"/>
|
2370
2385
|
<xsl:param name="cols-count"/>
|
2371
|
-
|
2386
|
+
<xsl:choose>
|
2387
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
|
2388
|
+
<xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
|
2389
|
+
</xsl:when>
|
2390
|
+
<xsl:otherwise>
|
2372
2391
|
<xsl:call-template name="calculate-column-widths-proportional">
|
2373
2392
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
2374
2393
|
<xsl:with-param name="table" select="$table"/>
|
2375
2394
|
</xsl:call-template>
|
2376
|
-
|
2395
|
+
</xsl:otherwise>
|
2396
|
+
</xsl:choose>
|
2377
2397
|
</xsl:template>
|
2378
2398
|
|
2379
2399
|
<!-- ================================================== -->
|
@@ -2551,6 +2571,7 @@
|
|
2551
2571
|
<!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
|
2552
2572
|
<!-- ================================================== -->
|
2553
2573
|
|
2574
|
+
<!-- INPUT: table with columns widths, generated by table_if.xsl -->
|
2554
2575
|
<xsl:template name="calculate-column-widths-autolayout-algorithm">
|
2555
2576
|
<xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
|
2556
2577
|
|
@@ -2562,67 +2583,6 @@
|
|
2562
2583
|
|
2563
2584
|
<!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
|
2564
2585
|
|
2565
|
-
<!-- get current table id -->
|
2566
|
-
<xsl:variable name="table_id" select="@id"/>
|
2567
|
-
<!-- find table by id in the file 'table_widths' -->
|
2568
|
-
<!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
|
2569
|
-
<xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
|
2570
|
-
|
2571
|
-
<!-- table='<xsl:copy-of select="$table"/>' -->
|
2572
|
-
<!-- table_id='<xsl:value-of select="$table_id"/>\ -->
|
2573
|
-
<!-- table-if='<xsl:copy-of select="$table-if"/>' -->
|
2574
|
-
<!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
|
2575
|
-
|
2576
|
-
<xsl:variable name="table_with_cell_widths_">
|
2577
|
-
<xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
|
2578
|
-
</xsl:variable>
|
2579
|
-
<xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
|
2580
|
-
|
2581
|
-
<!-- <xsl:if test="$table_if_debug = 'true'">
|
2582
|
-
<xsl:copy-of select="$table_with_cell_widths"/>
|
2583
|
-
</xsl:if> -->
|
2584
|
-
|
2585
|
-
<!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
|
2586
|
-
|
2587
|
-
<xsl:variable name="column_widths_">
|
2588
|
-
<!-- iteration of columns -->
|
2589
|
-
<xsl:for-each select="$table_with_cell_widths//tr[1]/td">
|
2590
|
-
<xsl:variable name="pos" select="position()"/>
|
2591
|
-
<column>
|
2592
|
-
<xsl:attribute name="width_max">
|
2593
|
-
<xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
|
2594
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
2595
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2596
|
-
</xsl:for-each>
|
2597
|
-
</xsl:attribute>
|
2598
|
-
<xsl:attribute name="width_min">
|
2599
|
-
<xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
|
2600
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
2601
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2602
|
-
</xsl:for-each>
|
2603
|
-
</xsl:attribute>
|
2604
|
-
</column>
|
2605
|
-
</xsl:for-each>
|
2606
|
-
</xsl:variable>
|
2607
|
-
<xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
|
2608
|
-
|
2609
|
-
<!-- <column_widths>
|
2610
|
-
<xsl:copy-of select="$column_widths"/>
|
2611
|
-
</column_widths> -->
|
2612
|
-
|
2613
|
-
<!-- These in turn, are used to find the minimum and maximum width for the table. -->
|
2614
|
-
<xsl:variable name="table_widths_">
|
2615
|
-
<table>
|
2616
|
-
<xsl:attribute name="width_max">
|
2617
|
-
<xsl:value-of select="sum($column_widths/column/@width_max)"/>
|
2618
|
-
</xsl:attribute>
|
2619
|
-
<xsl:attribute name="width_min">
|
2620
|
-
<xsl:value-of select="sum($column_widths/column/@width_min)"/>
|
2621
|
-
</xsl:attribute>
|
2622
|
-
</table>
|
2623
|
-
</xsl:variable>
|
2624
|
-
<xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
|
2625
|
-
|
2626
2586
|
<xsl:variable name="page_width">
|
2627
2587
|
<xsl:choose>
|
2628
2588
|
<xsl:when test="$parent_table_page-width != ''">
|
@@ -2635,16 +2595,13 @@
|
|
2635
2595
|
</xsl:variable>
|
2636
2596
|
|
2637
2597
|
<xsl:if test="$table_if_debug = 'true'">
|
2638
|
-
<
|
2639
|
-
<xsl:copy-of select="$table_widths"/>
|
2640
|
-
</table_width>
|
2641
|
-
<debug>$page_width=<xsl:value-of select="$page_width"/></debug>
|
2598
|
+
<page_width><xsl:value-of select="$page_width"/></page_width>
|
2642
2599
|
</xsl:if>
|
2643
2600
|
|
2644
2601
|
<!-- There are three cases: -->
|
2645
2602
|
<xsl:choose>
|
2646
2603
|
<!-- 1. The minimum table width is equal to or wider than the available space -->
|
2647
|
-
<xsl:when test="
|
2604
|
+
<xsl:when test="@width_min >= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
|
2648
2605
|
<!-- call old algorithm -->
|
2649
2606
|
<case1/>
|
2650
2607
|
<!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
|
@@ -2654,10 +2611,10 @@
|
|
2654
2611
|
</xsl:call-template> -->
|
2655
2612
|
</xsl:when>
|
2656
2613
|
<!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
|
2657
|
-
<xsl:when test="
|
2614
|
+
<xsl:when test="@width_max <= $page_width">
|
2658
2615
|
<case2/>
|
2659
2616
|
<autolayout/>
|
2660
|
-
<xsl:for-each select="
|
2617
|
+
<xsl:for-each select="column/@width_max">
|
2661
2618
|
<column divider="100"><xsl:value-of select="."/></column>
|
2662
2619
|
</xsl:for-each>
|
2663
2620
|
</xsl:when>
|
@@ -2667,19 +2624,19 @@
|
|
2667
2624
|
For each column, let d be the difference between maximum and minimum width of that column.
|
2668
2625
|
Now set the column's width to the minimum width plus d times W over D.
|
2669
2626
|
This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
|
2670
|
-
<xsl:when test="(
|
2627
|
+
<xsl:when test="(@width_max > $page_width and @width_min < $page_width) or (@width_min >= $page_width)">
|
2671
2628
|
<!-- difference between the available space and the minimum table width -->
|
2672
|
-
<xsl:variable name="W" select="$page_width -
|
2629
|
+
<xsl:variable name="W" select="$page_width - @width_min"/>
|
2673
2630
|
<W><xsl:value-of select="$W"/></W>
|
2674
2631
|
<!-- difference between maximum and minimum width of the table -->
|
2675
|
-
<xsl:variable name="D" select="
|
2632
|
+
<xsl:variable name="D" select="@width_max - @width_min"/>
|
2676
2633
|
<D><xsl:value-of select="$D"/></D>
|
2677
2634
|
<case3/>
|
2678
2635
|
<autolayout/>
|
2679
|
-
<xsl:if test="
|
2636
|
+
<xsl:if test="@width_min >= $page_width">
|
2680
2637
|
<split_keep-within-line>true</split_keep-within-line>
|
2681
2638
|
</xsl:if>
|
2682
|
-
<xsl:for-each select="
|
2639
|
+
<xsl:for-each select="column">
|
2683
2640
|
<!-- difference between maximum and minimum width of that column. -->
|
2684
2641
|
<xsl:variable name="d" select="@width_max - @width_min"/>
|
2685
2642
|
<d><xsl:value-of select="$d"/></d>
|
@@ -2705,23 +2662,39 @@
|
|
2705
2662
|
|
2706
2663
|
<parent_element><xsl:value-of select="local-name(..)"/></parent_element>
|
2707
2664
|
|
2665
|
+
<ancestor_tree>
|
2666
|
+
<xsl:for-each select="ancestor::*">
|
2667
|
+
<ancestor><xsl:value-of select="local-name()"/></ancestor>
|
2668
|
+
</xsl:for-each>
|
2669
|
+
</ancestor_tree>
|
2670
|
+
|
2708
2671
|
<xsl:variable name="parent_table_page-width_">
|
2709
2672
|
<xsl:if test="$parent_table_id != ''">
|
2710
2673
|
<!-- determine column number in the parent table -->
|
2711
2674
|
<xsl:variable name="parent_table_column_number">
|
2712
2675
|
<xsl:choose>
|
2713
|
-
<xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
|
2676
|
+
<!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
|
2677
|
+
<xsl:when test="(ancestor::*[local-name() = 'dd' or local-name() = 'table' or local-name() = 'dl'])[last()][local-name() = 'dd' or local-name() = 'dl']">2</xsl:when>
|
2714
2678
|
<xsl:otherwise> <!-- parent is table -->
|
2715
2679
|
<xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
|
2716
2680
|
</xsl:otherwise>
|
2717
2681
|
</xsl:choose>
|
2718
2682
|
</xsl:variable>
|
2719
2683
|
<!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
|
2720
|
-
|
2684
|
+
|
2685
|
+
<xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
|
2686
|
+
<xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
|
2687
|
+
<!-- <xsl:variable name="divider">
|
2688
|
+
<xsl:value-of select="$parent_table_column/@divider"/>
|
2689
|
+
<xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
|
2690
|
+
</xsl:variable> -->
|
2691
|
+
<xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
|
2721
2692
|
</xsl:if>
|
2722
2693
|
</xsl:variable>
|
2723
2694
|
<xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
|
2724
2695
|
|
2696
|
+
<parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
|
2697
|
+
|
2725
2698
|
<!-- get current table id -->
|
2726
2699
|
<xsl:variable name="table_id" select="@id"/>
|
2727
2700
|
|
@@ -2742,50 +2715,6 @@
|
|
2742
2715
|
|
2743
2716
|
</xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
|
2744
2717
|
|
2745
|
-
<!-- ============================= -->
|
2746
|
-
<!-- mode: determine_cell_widths-if -->
|
2747
|
-
<!-- ============================= -->
|
2748
|
-
<xsl:template match="@*|node()" mode="determine_cell_widths-if">
|
2749
|
-
<xsl:copy>
|
2750
|
-
<xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
|
2751
|
-
</xsl:copy>
|
2752
|
-
</xsl:template>
|
2753
|
-
|
2754
|
-
<xsl:template match="td | th" mode="determine_cell_widths-if">
|
2755
|
-
<xsl:copy>
|
2756
|
-
<xsl:copy-of select="@*"/>
|
2757
|
-
|
2758
|
-
<!-- The maximum width is given by the widest line. -->
|
2759
|
-
<xsl:attribute name="width_max">
|
2760
|
-
<xsl:for-each select="p_len">
|
2761
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
2762
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2763
|
-
</xsl:for-each>
|
2764
|
-
</xsl:attribute>
|
2765
|
-
|
2766
|
-
<!-- The minimum width is given by the widest text element (word, image, etc.) -->
|
2767
|
-
<xsl:variable name="width_min">
|
2768
|
-
<xsl:for-each select="word_len">
|
2769
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
2770
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2771
|
-
</xsl:for-each>
|
2772
|
-
</xsl:variable>
|
2773
|
-
<xsl:attribute name="width_min">
|
2774
|
-
<xsl:value-of select="$width_min"/>
|
2775
|
-
</xsl:attribute>
|
2776
|
-
|
2777
|
-
<xsl:if test="$width_min = 0">
|
2778
|
-
<xsl:attribute name="width_min">1</xsl:attribute>
|
2779
|
-
</xsl:if>
|
2780
|
-
|
2781
|
-
<xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
|
2782
|
-
|
2783
|
-
</xsl:copy>
|
2784
|
-
</xsl:template>
|
2785
|
-
<!-- ============================= -->
|
2786
|
-
<!-- END mode: determine_cell_widths-if -->
|
2787
|
-
<!-- ============================= -->
|
2788
|
-
|
2789
2718
|
<!-- ================================================== -->
|
2790
2719
|
<!-- Calculate column's width based on HTML4 algorithm -->
|
2791
2720
|
<!-- ================================================== -->
|
@@ -2976,6 +2905,7 @@
|
|
2976
2905
|
<xsl:when test="$table_or_dl = 'table'">
|
2977
2906
|
<xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
|
2978
2907
|
<fo:table-row number-columns-spanned="{$col_count}">
|
2908
|
+
<xsl:copy-of select="../@font-weight"/>
|
2979
2909
|
<!-- <test_table><xsl:copy-of select="."/></test_table> -->
|
2980
2910
|
<xsl:call-template name="td"/>
|
2981
2911
|
</fo:table-row>
|
@@ -3122,7 +3052,7 @@
|
|
3122
3052
|
|
3123
3053
|
<xsl:apply-templates/>
|
3124
3054
|
|
3125
|
-
<xsl:if test="$isGenerateTableIF = 'true'"
|
3055
|
+
<xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
|
3126
3056
|
|
3127
3057
|
</fo:block>
|
3128
3058
|
</fo:table-cell>
|
@@ -3448,6 +3378,7 @@
|
|
3448
3378
|
<xsl:template match="*[local-name()='dl']">
|
3449
3379
|
<xsl:variable name="isAdded" select="@added"/>
|
3450
3380
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
3381
|
+
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
3451
3382
|
<fo:block-container>
|
3452
3383
|
|
3453
3384
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -3981,21 +3912,16 @@
|
|
3981
3912
|
<!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
|
3982
3913
|
<xsl:template match="*[local-name()='dt']" mode="dl_if">
|
3983
3914
|
<xsl:param name="id"/>
|
3984
|
-
<xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
|
3985
3915
|
<tr>
|
3986
3916
|
<td>
|
3987
3917
|
<xsl:copy-of select="node()"/>
|
3988
3918
|
</td>
|
3989
3919
|
<td>
|
3990
|
-
|
3991
|
-
|
3992
|
-
|
3993
|
-
<!-- get paragraphs from nested 'dl' -->
|
3994
|
-
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
3995
|
-
|
3920
|
+
<xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
|
3921
|
+
<!-- get paragraphs from nested 'dl' -->
|
3922
|
+
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
3996
3923
|
</td>
|
3997
3924
|
</tr>
|
3998
|
-
|
3999
3925
|
</xsl:template>
|
4000
3926
|
<xsl:template match="*[local-name()='dd']" mode="dl_if"/>
|
4001
3927
|
|
@@ -4648,6 +4574,9 @@
|
|
4648
4574
|
<xsl:variable name="td">
|
4649
4575
|
<xsl:element name="td">
|
4650
4576
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
4577
|
+
<xsl:if test="local-name()='th'">
|
4578
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4579
|
+
</xsl:if>
|
4651
4580
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4652
4581
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
4653
4582
|
</xsl:element>
|
@@ -4660,6 +4589,9 @@
|
|
4660
4589
|
<xsl:otherwise>
|
4661
4590
|
<xsl:element name="td">
|
4662
4591
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4592
|
+
<xsl:if test="local-name()='th'">
|
4593
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4594
|
+
</xsl:if>
|
4663
4595
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
4664
4596
|
</xsl:element>
|
4665
4597
|
</xsl:otherwise>
|
@@ -4789,8 +4721,14 @@
|
|
4789
4721
|
<xsl:copy-of select="@*"/>
|
4790
4722
|
<xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
|
4791
4723
|
<xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
|
4724
|
+
<xsl:variable name="divide">
|
4725
|
+
<xsl:choose>
|
4726
|
+
<xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
|
4727
|
+
<xsl:otherwise>1</xsl:otherwise>
|
4728
|
+
</xsl:choose>
|
4729
|
+
</xsl:variable>
|
4792
4730
|
<xsl:attribute name="id">
|
4793
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
|
4731
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
|
4794
4732
|
</xsl:attribute>
|
4795
4733
|
|
4796
4734
|
<xsl:for-each select="*[local-name() = 'p']">
|
@@ -4798,10 +4736,12 @@
|
|
4798
4736
|
<xsl:copy-of select="@*"/>
|
4799
4737
|
<xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
|
4800
4738
|
<xsl:attribute name="id">
|
4801
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
|
4739
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
|
4802
4740
|
</xsl:attribute>
|
4803
4741
|
|
4804
|
-
<xsl:copy-of select="node()"/>
|
4742
|
+
<!-- <xsl:copy-of select="node()" /> -->
|
4743
|
+
<xsl:apply-templates mode="simple-table-noid"/>
|
4744
|
+
|
4805
4745
|
</xsl:copy>
|
4806
4746
|
</xsl:for-each>
|
4807
4747
|
|
@@ -4830,7 +4770,7 @@
|
|
4830
4770
|
<xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
|
4831
4771
|
<xsl:copy>
|
4832
4772
|
<xsl:attribute name="id">
|
4833
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
|
4773
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
|
4834
4774
|
</xsl:attribute>
|
4835
4775
|
<xsl:copy-of select="node()"/>
|
4836
4776
|
</xsl:copy>
|
@@ -4839,6 +4779,24 @@
|
|
4839
4779
|
</xsl:copy>
|
4840
4780
|
|
4841
4781
|
</xsl:template>
|
4782
|
+
|
4783
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
|
4784
|
+
<xsl:copy>
|
4785
|
+
<xsl:choose>
|
4786
|
+
<xsl:when test="$isGenerateTableIF = 'true'">
|
4787
|
+
<xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
|
4788
|
+
<!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
|
4789
|
+
<xsl:copy-of select="@id"/>
|
4790
|
+
</xsl:if> -->
|
4791
|
+
</xsl:when>
|
4792
|
+
<xsl:otherwise>
|
4793
|
+
<xsl:copy-of select="@*"/>
|
4794
|
+
</xsl:otherwise>
|
4795
|
+
</xsl:choose>
|
4796
|
+
<xsl:apply-templates select="node()" mode="simple-table-noid"/>
|
4797
|
+
</xsl:copy>
|
4798
|
+
</xsl:template>
|
4799
|
+
|
4842
4800
|
<!-- End mode: simple-table-id -->
|
4843
4801
|
<!-- ===================== -->
|
4844
4802
|
<!-- ===================== -->
|
@@ -4848,7 +4806,7 @@
|
|
4848
4806
|
<!-- =============================== -->
|
4849
4807
|
<xsl:template match="@*|node()" mode="td_text_with_formatting">
|
4850
4808
|
<xsl:copy>
|
4851
|
-
|
4809
|
+
<xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
|
4852
4810
|
</xsl:copy>
|
4853
4811
|
</xsl:template>
|
4854
4812
|
|
@@ -4962,6 +4920,10 @@
|
|
4962
4920
|
|
4963
4921
|
<fo:inline xsl:use-attribute-sets="mathml-style">
|
4964
4922
|
|
4923
|
+
<xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
|
4924
|
+
<!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
|
4925
|
+
</xsl:if>
|
4926
|
+
|
4965
4927
|
<xsl:call-template name="setTrackChangesStyles">
|
4966
4928
|
<xsl:with-param name="isAdded" select="$isAdded"/>
|
4967
4929
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
@@ -6842,41 +6804,47 @@
|
|
6842
6804
|
</fo:block>
|
6843
6805
|
</xsl:template>
|
6844
6806
|
|
6845
|
-
<xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
|
6807
|
+
<xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
|
6846
6808
|
<fo:block xsl:use-attribute-sets="inherit-style">
|
6847
6809
|
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
6848
6810
|
</fo:block>
|
6849
6811
|
</xsl:template>
|
6850
6812
|
|
6851
|
-
<xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
|
6813
|
+
<xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description'] | *[local-name() = 'div'][@type = 'requirement-description'] | *[local-name() = 'div'][@type = 'recommendation-description'] | *[local-name() = 'div'][@type = 'permission-description']">
|
6852
6814
|
<fo:block xsl:use-attribute-sets="description-style">
|
6853
6815
|
<xsl:apply-templates/>
|
6854
6816
|
</fo:block>
|
6855
6817
|
</xsl:template>
|
6856
6818
|
|
6857
|
-
<xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
|
6819
|
+
<xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification'] | *[local-name() = 'div'][@type = 'requirement-specification'] | *[local-name() = 'div'][@type = 'recommendation-specification'] | *[local-name() = 'div'][@type = 'permission-specification']">
|
6858
6820
|
<fo:block xsl:use-attribute-sets="specification-style">
|
6859
6821
|
<xsl:apply-templates/>
|
6860
6822
|
</fo:block>
|
6861
6823
|
</xsl:template>
|
6862
6824
|
|
6863
|
-
<xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
|
6825
|
+
<xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target'] | *[local-name() = 'div'][@type = 'requirement-measurement-target'] | *[local-name() = 'div'][@type = 'recommendation-measurement-target'] | *[local-name() = 'div'][@type = 'permission-measurement-target']">
|
6864
6826
|
<fo:block xsl:use-attribute-sets="measurement-target-style">
|
6865
6827
|
<xsl:apply-templates/>
|
6866
6828
|
</fo:block>
|
6867
6829
|
</xsl:template>
|
6868
6830
|
|
6869
|
-
<xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
|
6831
|
+
<xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification'] | *[local-name() = 'div'][@type = 'requirement-verification'] | *[local-name() = 'div'][@type = 'recommendation-verification'] | *[local-name() = 'div'][@type = 'permission-verification']">
|
6870
6832
|
<fo:block xsl:use-attribute-sets="verification-style">
|
6871
6833
|
<xsl:apply-templates/>
|
6872
6834
|
</fo:block>
|
6873
6835
|
</xsl:template>
|
6874
6836
|
|
6875
|
-
<xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
|
6837
|
+
<xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import'] | *[local-name() = 'div'][@type = 'requirement-import'] | *[local-name() = 'div'][@type = 'recommendation-import'] | *[local-name() = 'div'][@type = 'permission-import']">
|
6876
6838
|
<fo:block xsl:use-attribute-sets="import-style">
|
6877
6839
|
<xsl:apply-templates/>
|
6878
6840
|
</fo:block>
|
6879
6841
|
</xsl:template>
|
6842
|
+
|
6843
|
+
<xsl:template match="*[local-name() = 'div'][starts-with(@type, 'requirement-component')] | *[local-name() = 'div'][starts-with(@type, 'recommendation-component')] | *[local-name() = 'div'][starts-with(@type, 'permission-component')]">
|
6844
|
+
<fo:block xsl:use-attribute-sets="component-style">
|
6845
|
+
<xsl:apply-templates/>
|
6846
|
+
</fo:block>
|
6847
|
+
</xsl:template>
|
6880
6848
|
<!-- ========== -->
|
6881
6849
|
<!-- END -->
|
6882
6850
|
<!-- ========== -->
|
@@ -6932,15 +6900,12 @@
|
|
6932
6900
|
|
6933
6901
|
<xsl:template match="*[local-name()='tr']" mode="requirement">
|
6934
6902
|
<fo:table-row height="7mm" border-bottom="0.5pt solid grey">
|
6935
|
-
|
6936
|
-
|
6937
|
-
|
6938
|
-
|
6939
|
-
<xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
|
6940
|
-
</xsl:if>
|
6941
|
-
<xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
|
6942
|
-
<xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
|
6903
|
+
|
6904
|
+
<xsl:if test="parent::*[local-name()='thead'] or starts-with(*[local-name()='td' or local-name()='th'][1], 'Requirement ') or starts-with(*[local-name()='td' or local-name()='th'][1], 'Recommendation ')">
|
6905
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
6906
|
+
|
6943
6907
|
</xsl:if>
|
6908
|
+
|
6944
6909
|
<xsl:apply-templates mode="requirement"/>
|
6945
6910
|
</fo:table-row>
|
6946
6911
|
</xsl:template>
|
@@ -8451,7 +8416,7 @@
|
|
8451
8416
|
</tbody>
|
8452
8417
|
</xsl:variable>
|
8453
8418
|
<xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
|
8454
|
-
<xsl:call-template name="calculate-column-widths">
|
8419
|
+
<xsl:call-template name="calculate-column-widths-proportional">
|
8455
8420
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
8456
8421
|
<xsl:with-param name="table" select="$toc_table_simple"/>
|
8457
8422
|
</xsl:call-template>
|
@@ -225,9 +225,9 @@
|
|
225
225
|
<zeroOrMore>
|
226
226
|
<ref name="forename"/>
|
227
227
|
</zeroOrMore>
|
228
|
-
<
|
229
|
-
<ref name="
|
230
|
-
</
|
228
|
+
<optional>
|
229
|
+
<ref name="formatted-initials"/>
|
230
|
+
</optional>
|
231
231
|
<ref name="surname"/>
|
232
232
|
<zeroOrMore>
|
233
233
|
<ref name="addition"/>
|
@@ -247,8 +247,8 @@
|
|
247
247
|
<ref name="LocalizedString"/>
|
248
248
|
</element>
|
249
249
|
</define>
|
250
|
-
<define name="
|
251
|
-
<element name="
|
250
|
+
<define name="formatted-initials">
|
251
|
+
<element name="formatted-initials">
|
252
252
|
<ref name="LocalizedString"/>
|
253
253
|
</element>
|
254
254
|
</define>
|
@@ -264,6 +264,9 @@
|
|
264
264
|
</define>
|
265
265
|
<define name="forename">
|
266
266
|
<element name="forename">
|
267
|
+
<optional>
|
268
|
+
<attribute name="initial"/>
|
269
|
+
</optional>
|
267
270
|
<ref name="LocalizedString"/>
|
268
271
|
</element>
|
269
272
|
</define>
|
data/lib/metanorma-csa.rb
CHANGED
@@ -4,8 +4,9 @@ require_relative 'isodoc/csa/html_convert'
|
|
4
4
|
require_relative 'isodoc/csa/pdf_convert'
|
5
5
|
require_relative 'isodoc/csa/word_convert'
|
6
6
|
require_relative 'metanorma/csa/version'
|
7
|
+
require "metanorma"
|
7
8
|
|
8
|
-
if defined? Metanorma
|
9
|
+
if defined? Metanorma::Registry
|
9
10
|
require_relative 'metanorma/csa'
|
10
11
|
Metanorma::Registry.instance.register(Metanorma::Csa::Processor)
|
11
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-csa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|
@@ -177,6 +177,7 @@ extensions: []
|
|
177
177
|
extra_rdoc_files: []
|
178
178
|
files:
|
179
179
|
- ".github/workflows/rake.yml"
|
180
|
+
- ".github/workflows/release.yml"
|
180
181
|
- ".gitignore"
|
181
182
|
- ".hound.yml"
|
182
183
|
- ".rubocop.yml"
|
@@ -232,7 +233,7 @@ homepage: https://github.com/metanorma/metanorma-csa
|
|
232
233
|
licenses:
|
233
234
|
- BSD-2-Clause
|
234
235
|
metadata: {}
|
235
|
-
post_install_message:
|
236
|
+
post_install_message:
|
236
237
|
rdoc_options: []
|
237
238
|
require_paths:
|
238
239
|
- lib
|
@@ -247,8 +248,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
248
|
- !ruby/object:Gem::Version
|
248
249
|
version: '0'
|
249
250
|
requirements: []
|
250
|
-
rubygems_version: 3.
|
251
|
-
signing_key:
|
251
|
+
rubygems_version: 3.1.6
|
252
|
+
signing_key:
|
252
253
|
specification_version: 4
|
253
254
|
summary: metanorma-csa lets you write CSA Normal Documents (CSAND) in AsciiDoc.
|
254
255
|
test_files: []
|