metanorma-m3aawg 2.1.7 → 2.1.8
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/m3aawg/m3aawg.policy.xsl +102 -146
- data/lib/isodoc/m3aawg/m3aawg.report.xsl +102 -146
- data/lib/metanorma/m3aawg/biblio.rng +8 -5
- data/lib/metanorma/m3aawg/version.rb +1 -1
- data/lib/metanorma-m3aawg.rb +2 -1
- metadata +7 -9
- data/lib/isodoc/m3aawg/html/htmlstyle.css +0 -1066
- data/lib/isodoc/m3aawg/html/m3d.css +0 -774
- data/lib/isodoc/m3aawg/html/wordstyle.css +0 -1321
@@ -673,8 +673,18 @@
|
|
673
673
|
|
674
674
|
<xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
|
675
675
|
|
676
|
+
<xsl:variable name="isApplyAutolayoutAlgorithm_">
|
677
|
+
true
|
678
|
+
</xsl:variable>
|
679
|
+
<xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
|
680
|
+
|
676
681
|
<xsl:variable name="isGenerateTableIF_">
|
677
|
-
|
682
|
+
<xsl:choose>
|
683
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
|
684
|
+
<xsl:value-of select="normalize-space($table_if) = 'true'"/>
|
685
|
+
</xsl:when>
|
686
|
+
<xsl:otherwise>false</xsl:otherwise>
|
687
|
+
</xsl:choose>
|
678
688
|
</xsl:variable>
|
679
689
|
<xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
|
680
690
|
|
@@ -1272,7 +1282,7 @@
|
|
1272
1282
|
</xsl:attribute-set>
|
1273
1283
|
|
1274
1284
|
<xsl:attribute-set name="dt-block-style">
|
1275
|
-
<xsl:attribute name="margin-top">
|
1285
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
1276
1286
|
|
1277
1287
|
</xsl:attribute-set>
|
1278
1288
|
|
@@ -2232,6 +2242,7 @@
|
|
2232
2242
|
|
2233
2243
|
<xsl:variable name="margin-side">
|
2234
2244
|
<xsl:choose>
|
2245
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
|
2235
2246
|
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
2236
2247
|
<xsl:otherwise>0</xsl:otherwise>
|
2237
2248
|
</xsl:choose>
|
@@ -2300,6 +2311,7 @@
|
|
2300
2311
|
</td>
|
2301
2312
|
</tr>
|
2302
2313
|
-->
|
2314
|
+
<!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
|
2303
2315
|
<xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
|
2304
2316
|
|
2305
2317
|
</xsl:when>
|
@@ -2434,12 +2446,17 @@
|
|
2434
2446
|
<xsl:template name="calculate-column-widths">
|
2435
2447
|
<xsl:param name="table"/>
|
2436
2448
|
<xsl:param name="cols-count"/>
|
2437
|
-
|
2449
|
+
<xsl:choose>
|
2450
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
|
2451
|
+
<xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
|
2452
|
+
</xsl:when>
|
2453
|
+
<xsl:otherwise>
|
2438
2454
|
<xsl:call-template name="calculate-column-widths-proportional">
|
2439
2455
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
2440
2456
|
<xsl:with-param name="table" select="$table"/>
|
2441
2457
|
</xsl:call-template>
|
2442
|
-
|
2458
|
+
</xsl:otherwise>
|
2459
|
+
</xsl:choose>
|
2443
2460
|
</xsl:template>
|
2444
2461
|
|
2445
2462
|
<!-- ================================================== -->
|
@@ -2617,6 +2634,7 @@
|
|
2617
2634
|
<!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
|
2618
2635
|
<!-- ================================================== -->
|
2619
2636
|
|
2637
|
+
<!-- INPUT: table with columns widths, generated by table_if.xsl -->
|
2620
2638
|
<xsl:template name="calculate-column-widths-autolayout-algorithm">
|
2621
2639
|
<xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
|
2622
2640
|
|
@@ -2628,67 +2646,6 @@
|
|
2628
2646
|
|
2629
2647
|
<!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
|
2630
2648
|
|
2631
|
-
<!-- get current table id -->
|
2632
|
-
<xsl:variable name="table_id" select="@id"/>
|
2633
|
-
<!-- find table by id in the file 'table_widths' -->
|
2634
|
-
<!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
|
2635
|
-
<xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
|
2636
|
-
|
2637
|
-
<!-- table='<xsl:copy-of select="$table"/>' -->
|
2638
|
-
<!-- table_id='<xsl:value-of select="$table_id"/>\ -->
|
2639
|
-
<!-- table-if='<xsl:copy-of select="$table-if"/>' -->
|
2640
|
-
<!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
|
2641
|
-
|
2642
|
-
<xsl:variable name="table_with_cell_widths_">
|
2643
|
-
<xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
|
2644
|
-
</xsl:variable>
|
2645
|
-
<xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
|
2646
|
-
|
2647
|
-
<!-- <xsl:if test="$table_if_debug = 'true'">
|
2648
|
-
<xsl:copy-of select="$table_with_cell_widths"/>
|
2649
|
-
</xsl:if> -->
|
2650
|
-
|
2651
|
-
<!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
|
2652
|
-
|
2653
|
-
<xsl:variable name="column_widths_">
|
2654
|
-
<!-- iteration of columns -->
|
2655
|
-
<xsl:for-each select="$table_with_cell_widths//tr[1]/td">
|
2656
|
-
<xsl:variable name="pos" select="position()"/>
|
2657
|
-
<column>
|
2658
|
-
<xsl:attribute name="width_max">
|
2659
|
-
<xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
|
2660
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
2661
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2662
|
-
</xsl:for-each>
|
2663
|
-
</xsl:attribute>
|
2664
|
-
<xsl:attribute name="width_min">
|
2665
|
-
<xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
|
2666
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
2667
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2668
|
-
</xsl:for-each>
|
2669
|
-
</xsl:attribute>
|
2670
|
-
</column>
|
2671
|
-
</xsl:for-each>
|
2672
|
-
</xsl:variable>
|
2673
|
-
<xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
|
2674
|
-
|
2675
|
-
<!-- <column_widths>
|
2676
|
-
<xsl:copy-of select="$column_widths"/>
|
2677
|
-
</column_widths> -->
|
2678
|
-
|
2679
|
-
<!-- These in turn, are used to find the minimum and maximum width for the table. -->
|
2680
|
-
<xsl:variable name="table_widths_">
|
2681
|
-
<table>
|
2682
|
-
<xsl:attribute name="width_max">
|
2683
|
-
<xsl:value-of select="sum($column_widths/column/@width_max)"/>
|
2684
|
-
</xsl:attribute>
|
2685
|
-
<xsl:attribute name="width_min">
|
2686
|
-
<xsl:value-of select="sum($column_widths/column/@width_min)"/>
|
2687
|
-
</xsl:attribute>
|
2688
|
-
</table>
|
2689
|
-
</xsl:variable>
|
2690
|
-
<xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
|
2691
|
-
|
2692
2649
|
<xsl:variable name="page_width">
|
2693
2650
|
<xsl:choose>
|
2694
2651
|
<xsl:when test="$parent_table_page-width != ''">
|
@@ -2701,16 +2658,13 @@
|
|
2701
2658
|
</xsl:variable>
|
2702
2659
|
|
2703
2660
|
<xsl:if test="$table_if_debug = 'true'">
|
2704
|
-
<
|
2705
|
-
<xsl:copy-of select="$table_widths"/>
|
2706
|
-
</table_width>
|
2707
|
-
<debug>$page_width=<xsl:value-of select="$page_width"/></debug>
|
2661
|
+
<page_width><xsl:value-of select="$page_width"/></page_width>
|
2708
2662
|
</xsl:if>
|
2709
2663
|
|
2710
2664
|
<!-- There are three cases: -->
|
2711
2665
|
<xsl:choose>
|
2712
2666
|
<!-- 1. The minimum table width is equal to or wider than the available space -->
|
2713
|
-
<xsl:when test="
|
2667
|
+
<xsl:when test="@width_min >= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
|
2714
2668
|
<!-- call old algorithm -->
|
2715
2669
|
<case1/>
|
2716
2670
|
<!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
|
@@ -2720,10 +2674,10 @@
|
|
2720
2674
|
</xsl:call-template> -->
|
2721
2675
|
</xsl:when>
|
2722
2676
|
<!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
|
2723
|
-
<xsl:when test="
|
2677
|
+
<xsl:when test="@width_max <= $page_width">
|
2724
2678
|
<case2/>
|
2725
2679
|
<autolayout/>
|
2726
|
-
<xsl:for-each select="
|
2680
|
+
<xsl:for-each select="column/@width_max">
|
2727
2681
|
<column divider="100"><xsl:value-of select="."/></column>
|
2728
2682
|
</xsl:for-each>
|
2729
2683
|
</xsl:when>
|
@@ -2733,19 +2687,19 @@
|
|
2733
2687
|
For each column, let d be the difference between maximum and minimum width of that column.
|
2734
2688
|
Now set the column's width to the minimum width plus d times W over D.
|
2735
2689
|
This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
|
2736
|
-
<xsl:when test="(
|
2690
|
+
<xsl:when test="(@width_max > $page_width and @width_min < $page_width) or (@width_min >= $page_width)">
|
2737
2691
|
<!-- difference between the available space and the minimum table width -->
|
2738
|
-
<xsl:variable name="W" select="$page_width -
|
2692
|
+
<xsl:variable name="W" select="$page_width - @width_min"/>
|
2739
2693
|
<W><xsl:value-of select="$W"/></W>
|
2740
2694
|
<!-- difference between maximum and minimum width of the table -->
|
2741
|
-
<xsl:variable name="D" select="
|
2695
|
+
<xsl:variable name="D" select="@width_max - @width_min"/>
|
2742
2696
|
<D><xsl:value-of select="$D"/></D>
|
2743
2697
|
<case3/>
|
2744
2698
|
<autolayout/>
|
2745
|
-
<xsl:if test="
|
2699
|
+
<xsl:if test="@width_min >= $page_width">
|
2746
2700
|
<split_keep-within-line>true</split_keep-within-line>
|
2747
2701
|
</xsl:if>
|
2748
|
-
<xsl:for-each select="
|
2702
|
+
<xsl:for-each select="column">
|
2749
2703
|
<!-- difference between maximum and minimum width of that column. -->
|
2750
2704
|
<xsl:variable name="d" select="@width_max - @width_min"/>
|
2751
2705
|
<d><xsl:value-of select="$d"/></d>
|
@@ -2771,23 +2725,39 @@
|
|
2771
2725
|
|
2772
2726
|
<parent_element><xsl:value-of select="local-name(..)"/></parent_element>
|
2773
2727
|
|
2728
|
+
<ancestor_tree>
|
2729
|
+
<xsl:for-each select="ancestor::*">
|
2730
|
+
<ancestor><xsl:value-of select="local-name()"/></ancestor>
|
2731
|
+
</xsl:for-each>
|
2732
|
+
</ancestor_tree>
|
2733
|
+
|
2774
2734
|
<xsl:variable name="parent_table_page-width_">
|
2775
2735
|
<xsl:if test="$parent_table_id != ''">
|
2776
2736
|
<!-- determine column number in the parent table -->
|
2777
2737
|
<xsl:variable name="parent_table_column_number">
|
2778
2738
|
<xsl:choose>
|
2779
|
-
<xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
|
2739
|
+
<!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
|
2740
|
+
<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>
|
2780
2741
|
<xsl:otherwise> <!-- parent is table -->
|
2781
2742
|
<xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
|
2782
2743
|
</xsl:otherwise>
|
2783
2744
|
</xsl:choose>
|
2784
2745
|
</xsl:variable>
|
2785
2746
|
<!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
|
2786
|
-
|
2747
|
+
|
2748
|
+
<xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
|
2749
|
+
<xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
|
2750
|
+
<!-- <xsl:variable name="divider">
|
2751
|
+
<xsl:value-of select="$parent_table_column/@divider"/>
|
2752
|
+
<xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
|
2753
|
+
</xsl:variable> -->
|
2754
|
+
<xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
|
2787
2755
|
</xsl:if>
|
2788
2756
|
</xsl:variable>
|
2789
2757
|
<xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
|
2790
2758
|
|
2759
|
+
<parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
|
2760
|
+
|
2791
2761
|
<!-- get current table id -->
|
2792
2762
|
<xsl:variable name="table_id" select="@id"/>
|
2793
2763
|
|
@@ -2808,50 +2778,6 @@
|
|
2808
2778
|
|
2809
2779
|
</xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
|
2810
2780
|
|
2811
|
-
<!-- ============================= -->
|
2812
|
-
<!-- mode: determine_cell_widths-if -->
|
2813
|
-
<!-- ============================= -->
|
2814
|
-
<xsl:template match="@*|node()" mode="determine_cell_widths-if">
|
2815
|
-
<xsl:copy>
|
2816
|
-
<xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
|
2817
|
-
</xsl:copy>
|
2818
|
-
</xsl:template>
|
2819
|
-
|
2820
|
-
<xsl:template match="td | th" mode="determine_cell_widths-if">
|
2821
|
-
<xsl:copy>
|
2822
|
-
<xsl:copy-of select="@*"/>
|
2823
|
-
|
2824
|
-
<!-- The maximum width is given by the widest line. -->
|
2825
|
-
<xsl:attribute name="width_max">
|
2826
|
-
<xsl:for-each select="p_len">
|
2827
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
2828
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2829
|
-
</xsl:for-each>
|
2830
|
-
</xsl:attribute>
|
2831
|
-
|
2832
|
-
<!-- The minimum width is given by the widest text element (word, image, etc.) -->
|
2833
|
-
<xsl:variable name="width_min">
|
2834
|
-
<xsl:for-each select="word_len">
|
2835
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
2836
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2837
|
-
</xsl:for-each>
|
2838
|
-
</xsl:variable>
|
2839
|
-
<xsl:attribute name="width_min">
|
2840
|
-
<xsl:value-of select="$width_min"/>
|
2841
|
-
</xsl:attribute>
|
2842
|
-
|
2843
|
-
<xsl:if test="$width_min = 0">
|
2844
|
-
<xsl:attribute name="width_min">1</xsl:attribute>
|
2845
|
-
</xsl:if>
|
2846
|
-
|
2847
|
-
<xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
|
2848
|
-
|
2849
|
-
</xsl:copy>
|
2850
|
-
</xsl:template>
|
2851
|
-
<!-- ============================= -->
|
2852
|
-
<!-- END mode: determine_cell_widths-if -->
|
2853
|
-
<!-- ============================= -->
|
2854
|
-
|
2855
2781
|
<!-- ================================================== -->
|
2856
2782
|
<!-- Calculate column's width based on HTML4 algorithm -->
|
2857
2783
|
<!-- ================================================== -->
|
@@ -3042,6 +2968,7 @@
|
|
3042
2968
|
<xsl:when test="$table_or_dl = 'table'">
|
3043
2969
|
<xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
|
3044
2970
|
<fo:table-row number-columns-spanned="{$col_count}">
|
2971
|
+
<xsl:copy-of select="../@font-weight"/>
|
3045
2972
|
<!-- <test_table><xsl:copy-of select="."/></test_table> -->
|
3046
2973
|
<xsl:call-template name="td"/>
|
3047
2974
|
</fo:table-row>
|
@@ -3188,7 +3115,7 @@
|
|
3188
3115
|
|
3189
3116
|
<xsl:apply-templates/>
|
3190
3117
|
|
3191
|
-
<xsl:if test="$isGenerateTableIF = 'true'"
|
3118
|
+
<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"/> -->
|
3192
3119
|
|
3193
3120
|
</fo:block>
|
3194
3121
|
</fo:table-cell>
|
@@ -3514,6 +3441,7 @@
|
|
3514
3441
|
<xsl:template match="*[local-name()='dl']">
|
3515
3442
|
<xsl:variable name="isAdded" select="@added"/>
|
3516
3443
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
3444
|
+
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
3517
3445
|
<fo:block-container>
|
3518
3446
|
|
3519
3447
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -4047,21 +3975,16 @@
|
|
4047
3975
|
<!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
|
4048
3976
|
<xsl:template match="*[local-name()='dt']" mode="dl_if">
|
4049
3977
|
<xsl:param name="id"/>
|
4050
|
-
<xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
|
4051
3978
|
<tr>
|
4052
3979
|
<td>
|
4053
3980
|
<xsl:copy-of select="node()"/>
|
4054
3981
|
</td>
|
4055
3982
|
<td>
|
4056
|
-
|
4057
|
-
|
4058
|
-
|
4059
|
-
<!-- get paragraphs from nested 'dl' -->
|
4060
|
-
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
4061
|
-
|
3983
|
+
<xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
|
3984
|
+
<!-- get paragraphs from nested 'dl' -->
|
3985
|
+
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
4062
3986
|
</td>
|
4063
3987
|
</tr>
|
4064
|
-
|
4065
3988
|
</xsl:template>
|
4066
3989
|
<xsl:template match="*[local-name()='dd']" mode="dl_if"/>
|
4067
3990
|
|
@@ -4717,6 +4640,9 @@
|
|
4717
4640
|
<xsl:variable name="td">
|
4718
4641
|
<xsl:element name="td">
|
4719
4642
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
4643
|
+
<xsl:if test="local-name()='th'">
|
4644
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4645
|
+
</xsl:if>
|
4720
4646
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4721
4647
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
4722
4648
|
</xsl:element>
|
@@ -4729,6 +4655,9 @@
|
|
4729
4655
|
<xsl:otherwise>
|
4730
4656
|
<xsl:element name="td">
|
4731
4657
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4658
|
+
<xsl:if test="local-name()='th'">
|
4659
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4660
|
+
</xsl:if>
|
4732
4661
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
4733
4662
|
</xsl:element>
|
4734
4663
|
</xsl:otherwise>
|
@@ -4858,8 +4787,14 @@
|
|
4858
4787
|
<xsl:copy-of select="@*"/>
|
4859
4788
|
<xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
|
4860
4789
|
<xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
|
4790
|
+
<xsl:variable name="divide">
|
4791
|
+
<xsl:choose>
|
4792
|
+
<xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
|
4793
|
+
<xsl:otherwise>1</xsl:otherwise>
|
4794
|
+
</xsl:choose>
|
4795
|
+
</xsl:variable>
|
4861
4796
|
<xsl:attribute name="id">
|
4862
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
|
4797
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
|
4863
4798
|
</xsl:attribute>
|
4864
4799
|
|
4865
4800
|
<xsl:for-each select="*[local-name() = 'p']">
|
@@ -4867,10 +4802,12 @@
|
|
4867
4802
|
<xsl:copy-of select="@*"/>
|
4868
4803
|
<xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
|
4869
4804
|
<xsl:attribute name="id">
|
4870
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
|
4805
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
|
4871
4806
|
</xsl:attribute>
|
4872
4807
|
|
4873
|
-
<xsl:copy-of select="node()"/>
|
4808
|
+
<!-- <xsl:copy-of select="node()" /> -->
|
4809
|
+
<xsl:apply-templates mode="simple-table-noid"/>
|
4810
|
+
|
4874
4811
|
</xsl:copy>
|
4875
4812
|
</xsl:for-each>
|
4876
4813
|
|
@@ -4899,7 +4836,7 @@
|
|
4899
4836
|
<xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
|
4900
4837
|
<xsl:copy>
|
4901
4838
|
<xsl:attribute name="id">
|
4902
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
|
4839
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
|
4903
4840
|
</xsl:attribute>
|
4904
4841
|
<xsl:copy-of select="node()"/>
|
4905
4842
|
</xsl:copy>
|
@@ -4908,6 +4845,24 @@
|
|
4908
4845
|
</xsl:copy>
|
4909
4846
|
|
4910
4847
|
</xsl:template>
|
4848
|
+
|
4849
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
|
4850
|
+
<xsl:copy>
|
4851
|
+
<xsl:choose>
|
4852
|
+
<xsl:when test="$isGenerateTableIF = 'true'">
|
4853
|
+
<xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
|
4854
|
+
<!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
|
4855
|
+
<xsl:copy-of select="@id"/>
|
4856
|
+
</xsl:if> -->
|
4857
|
+
</xsl:when>
|
4858
|
+
<xsl:otherwise>
|
4859
|
+
<xsl:copy-of select="@*"/>
|
4860
|
+
</xsl:otherwise>
|
4861
|
+
</xsl:choose>
|
4862
|
+
<xsl:apply-templates select="node()" mode="simple-table-noid"/>
|
4863
|
+
</xsl:copy>
|
4864
|
+
</xsl:template>
|
4865
|
+
|
4911
4866
|
<!-- End mode: simple-table-id -->
|
4912
4867
|
<!-- ===================== -->
|
4913
4868
|
<!-- ===================== -->
|
@@ -4917,7 +4872,7 @@
|
|
4917
4872
|
<!-- =============================== -->
|
4918
4873
|
<xsl:template match="@*|node()" mode="td_text_with_formatting">
|
4919
4874
|
<xsl:copy>
|
4920
|
-
|
4875
|
+
<xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
|
4921
4876
|
</xsl:copy>
|
4922
4877
|
</xsl:template>
|
4923
4878
|
|
@@ -5031,6 +4986,10 @@
|
|
5031
4986
|
|
5032
4987
|
<fo:inline xsl:use-attribute-sets="mathml-style">
|
5033
4988
|
|
4989
|
+
<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 -->
|
4990
|
+
<!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
|
4991
|
+
</xsl:if>
|
4992
|
+
|
5034
4993
|
<xsl:call-template name="setTrackChangesStyles">
|
5035
4994
|
<xsl:with-param name="isAdded" select="$isAdded"/>
|
5036
4995
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
@@ -7007,15 +6966,12 @@
|
|
7007
6966
|
|
7008
6967
|
<xsl:template match="*[local-name()='tr']" mode="requirement">
|
7009
6968
|
<fo:table-row height="7mm" border-bottom="0.5pt solid grey">
|
7010
|
-
|
7011
|
-
|
7012
|
-
|
7013
|
-
|
7014
|
-
<xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
|
7015
|
-
</xsl:if>
|
7016
|
-
<xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
|
7017
|
-
<xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
|
6969
|
+
|
6970
|
+
<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 ')">
|
6971
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
6972
|
+
|
7018
6973
|
</xsl:if>
|
6974
|
+
|
7019
6975
|
<xsl:apply-templates mode="requirement"/>
|
7020
6976
|
</fo:table-row>
|
7021
6977
|
</xsl:template>
|
@@ -8539,7 +8495,7 @@
|
|
8539
8495
|
</tbody>
|
8540
8496
|
</xsl:variable>
|
8541
8497
|
<xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
|
8542
|
-
<xsl:call-template name="calculate-column-widths">
|
8498
|
+
<xsl:call-template name="calculate-column-widths-proportional">
|
8543
8499
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
8544
8500
|
<xsl:with-param name="table" select="$toc_table_simple"/>
|
8545
8501
|
</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-m3aawg.rb
CHANGED
@@ -5,8 +5,9 @@ require_relative "isodoc/m3aawg/word_convert"
|
|
5
5
|
require_relative "isodoc/m3aawg/pdf_convert"
|
6
6
|
require_relative "isodoc/m3aawg/presentation_xml_convert"
|
7
7
|
require_relative "metanorma/m3aawg/version"
|
8
|
+
require "metanorma"
|
8
9
|
|
9
|
-
if defined? Metanorma
|
10
|
+
if defined? Metanorma::Registry
|
10
11
|
require_relative "metanorma/m3aawg"
|
11
12
|
Metanorma::Registry.instance.register(Metanorma::M3AAWG::Processor)
|
12
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-m3aawg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.8
|
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-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -205,6 +205,7 @@ extensions: []
|
|
205
205
|
extra_rdoc_files: []
|
206
206
|
files:
|
207
207
|
- ".github/workflows/rake.yml"
|
208
|
+
- ".github/workflows/release.yml"
|
208
209
|
- ".gitignore"
|
209
210
|
- ".hound.yml"
|
210
211
|
- ".rubocop.yml"
|
@@ -222,16 +223,13 @@ files:
|
|
222
223
|
- lib/isodoc/m3aawg/html/header.html
|
223
224
|
- lib/isodoc/m3aawg/html/html_m3d_intro.html
|
224
225
|
- lib/isodoc/m3aawg/html/html_m3d_titlepage.html
|
225
|
-
- lib/isodoc/m3aawg/html/htmlstyle.css
|
226
226
|
- lib/isodoc/m3aawg/html/htmlstyle.scss
|
227
227
|
- lib/isodoc/m3aawg/html/logo.jpg
|
228
228
|
- lib/isodoc/m3aawg/html/m3-logo.png
|
229
|
-
- lib/isodoc/m3aawg/html/m3d.css
|
230
229
|
- lib/isodoc/m3aawg/html/m3d.scss
|
231
230
|
- lib/isodoc/m3aawg/html/scripts.html
|
232
231
|
- lib/isodoc/m3aawg/html/word_m3d_intro.html
|
233
232
|
- lib/isodoc/m3aawg/html/word_m3d_titlepage.html
|
234
|
-
- lib/isodoc/m3aawg/html/wordstyle.css
|
235
233
|
- lib/isodoc/m3aawg/html/wordstyle.scss
|
236
234
|
- lib/isodoc/m3aawg/html_convert.rb
|
237
235
|
- lib/isodoc/m3aawg/i18n-en.yaml
|
@@ -261,7 +259,7 @@ homepage: https://github.com/metanorma/metanorma-m3aawg
|
|
261
259
|
licenses:
|
262
260
|
- BSD-2-Clause
|
263
261
|
metadata: {}
|
264
|
-
post_install_message:
|
262
|
+
post_install_message:
|
265
263
|
rdoc_options: []
|
266
264
|
require_paths:
|
267
265
|
- lib
|
@@ -276,8 +274,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
276
274
|
- !ruby/object:Gem::Version
|
277
275
|
version: '0'
|
278
276
|
requirements: []
|
279
|
-
rubygems_version: 3.
|
280
|
-
signing_key:
|
277
|
+
rubygems_version: 3.1.6
|
278
|
+
signing_key:
|
281
279
|
specification_version: 4
|
282
280
|
summary: metanorma-m3d lets you write M3AAWG Documents in AsciiDoc.
|
283
281
|
test_files: []
|