metanorma-ieee 0.0.5 → 0.0.6
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 +4 -2
- data/.github/workflows/release.yml +24 -0
- data/.hound.yml +5 -0
- data/lib/isodoc/ieee/ieee.amendment.xsl +104 -148
- data/lib/isodoc/ieee/ieee.standard.xsl +104 -148
- data/lib/metanorma/ieee/biblio.rng +8 -5
- data/lib/metanorma/ieee/front.rb +0 -11
- data/lib/metanorma/ieee/validate.rb +8 -8
- data/lib/metanorma/ieee/version.rb +1 -1
- data/lib/metanorma-ieee.rb +1 -1
- metadata +8 -9
- data/lib/isodoc/ieee/html/htmlstyle.css +0 -1028
- data/lib/isodoc/ieee/html/ieee.css +0 -3376
- data/lib/isodoc/ieee/html/wordstyle.css +0 -5307
@@ -3760,10 +3760,18 @@
|
|
3760
3760
|
|
3761
3761
|
<xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
|
3762
3762
|
|
3763
|
-
<xsl:variable name="
|
3763
|
+
<xsl:variable name="isApplyAutolayoutAlgorithm_">
|
3764
|
+
true
|
3765
|
+
</xsl:variable>
|
3766
|
+
<xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
|
3764
3767
|
|
3768
|
+
<xsl:variable name="isGenerateTableIF_">
|
3769
|
+
<xsl:choose>
|
3770
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
|
3765
3771
|
<xsl:value-of select="normalize-space($table_if) = 'true'"/>
|
3766
|
-
|
3772
|
+
</xsl:when>
|
3773
|
+
<xsl:otherwise>false</xsl:otherwise>
|
3774
|
+
</xsl:choose>
|
3767
3775
|
</xsl:variable>
|
3768
3776
|
<xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
|
3769
3777
|
|
@@ -4390,10 +4398,9 @@
|
|
4390
4398
|
</xsl:attribute-set>
|
4391
4399
|
|
4392
4400
|
<xsl:attribute-set name="dt-block-style">
|
4393
|
-
<xsl:attribute name="margin-top">
|
4401
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
4394
4402
|
|
4395
4403
|
<xsl:attribute name="margin-left">2mm</xsl:attribute>
|
4396
|
-
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
4397
4404
|
<xsl:attribute name="line-height">1.2</xsl:attribute>
|
4398
4405
|
|
4399
4406
|
</xsl:attribute-set>
|
@@ -5347,6 +5354,7 @@
|
|
5347
5354
|
|
5348
5355
|
<xsl:variable name="margin-side">
|
5349
5356
|
<xsl:choose>
|
5357
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
|
5350
5358
|
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
5351
5359
|
<xsl:otherwise>0</xsl:otherwise>
|
5352
5360
|
</xsl:choose>
|
@@ -5431,6 +5439,7 @@
|
|
5431
5439
|
</td>
|
5432
5440
|
</tr>
|
5433
5441
|
-->
|
5442
|
+
<!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
|
5434
5443
|
<xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
|
5435
5444
|
|
5436
5445
|
</xsl:when>
|
@@ -5542,9 +5551,17 @@
|
|
5542
5551
|
<xsl:template name="calculate-column-widths">
|
5543
5552
|
<xsl:param name="table"/>
|
5544
5553
|
<xsl:param name="cols-count"/>
|
5545
|
-
|
5554
|
+
<xsl:choose>
|
5555
|
+
<xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
|
5546
5556
|
<xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
|
5547
|
-
|
5557
|
+
</xsl:when>
|
5558
|
+
<xsl:otherwise>
|
5559
|
+
<xsl:call-template name="calculate-column-widths-proportional">
|
5560
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
5561
|
+
<xsl:with-param name="table" select="$table"/>
|
5562
|
+
</xsl:call-template>
|
5563
|
+
</xsl:otherwise>
|
5564
|
+
</xsl:choose>
|
5548
5565
|
</xsl:template>
|
5549
5566
|
|
5550
5567
|
<!-- ================================================== -->
|
@@ -5722,6 +5739,7 @@
|
|
5722
5739
|
<!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
|
5723
5740
|
<!-- ================================================== -->
|
5724
5741
|
|
5742
|
+
<!-- INPUT: table with columns widths, generated by table_if.xsl -->
|
5725
5743
|
<xsl:template name="calculate-column-widths-autolayout-algorithm">
|
5726
5744
|
<xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
|
5727
5745
|
|
@@ -5733,67 +5751,6 @@
|
|
5733
5751
|
|
5734
5752
|
<!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
|
5735
5753
|
|
5736
|
-
<!-- get current table id -->
|
5737
|
-
<xsl:variable name="table_id" select="@id"/>
|
5738
|
-
<!-- find table by id in the file 'table_widths' -->
|
5739
|
-
<!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
|
5740
|
-
<xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
|
5741
|
-
|
5742
|
-
<!-- table='<xsl:copy-of select="$table"/>' -->
|
5743
|
-
<!-- table_id='<xsl:value-of select="$table_id"/>\ -->
|
5744
|
-
<!-- table-if='<xsl:copy-of select="$table-if"/>' -->
|
5745
|
-
<!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
|
5746
|
-
|
5747
|
-
<xsl:variable name="table_with_cell_widths_">
|
5748
|
-
<xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
|
5749
|
-
</xsl:variable>
|
5750
|
-
<xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
|
5751
|
-
|
5752
|
-
<!-- <xsl:if test="$table_if_debug = 'true'">
|
5753
|
-
<xsl:copy-of select="$table_with_cell_widths"/>
|
5754
|
-
</xsl:if> -->
|
5755
|
-
|
5756
|
-
<!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
|
5757
|
-
|
5758
|
-
<xsl:variable name="column_widths_">
|
5759
|
-
<!-- iteration of columns -->
|
5760
|
-
<xsl:for-each select="$table_with_cell_widths//tr[1]/td">
|
5761
|
-
<xsl:variable name="pos" select="position()"/>
|
5762
|
-
<column>
|
5763
|
-
<xsl:attribute name="width_max">
|
5764
|
-
<xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
|
5765
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
5766
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
5767
|
-
</xsl:for-each>
|
5768
|
-
</xsl:attribute>
|
5769
|
-
<xsl:attribute name="width_min">
|
5770
|
-
<xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
|
5771
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
5772
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
5773
|
-
</xsl:for-each>
|
5774
|
-
</xsl:attribute>
|
5775
|
-
</column>
|
5776
|
-
</xsl:for-each>
|
5777
|
-
</xsl:variable>
|
5778
|
-
<xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
|
5779
|
-
|
5780
|
-
<!-- <column_widths>
|
5781
|
-
<xsl:copy-of select="$column_widths"/>
|
5782
|
-
</column_widths> -->
|
5783
|
-
|
5784
|
-
<!-- These in turn, are used to find the minimum and maximum width for the table. -->
|
5785
|
-
<xsl:variable name="table_widths_">
|
5786
|
-
<table>
|
5787
|
-
<xsl:attribute name="width_max">
|
5788
|
-
<xsl:value-of select="sum($column_widths/column/@width_max)"/>
|
5789
|
-
</xsl:attribute>
|
5790
|
-
<xsl:attribute name="width_min">
|
5791
|
-
<xsl:value-of select="sum($column_widths/column/@width_min)"/>
|
5792
|
-
</xsl:attribute>
|
5793
|
-
</table>
|
5794
|
-
</xsl:variable>
|
5795
|
-
<xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
|
5796
|
-
|
5797
5754
|
<xsl:variable name="page_width">
|
5798
5755
|
<xsl:choose>
|
5799
5756
|
<xsl:when test="$parent_table_page-width != ''">
|
@@ -5806,16 +5763,13 @@
|
|
5806
5763
|
</xsl:variable>
|
5807
5764
|
|
5808
5765
|
<xsl:if test="$table_if_debug = 'true'">
|
5809
|
-
<
|
5810
|
-
<xsl:copy-of select="$table_widths"/>
|
5811
|
-
</table_width>
|
5812
|
-
<debug>$page_width=<xsl:value-of select="$page_width"/></debug>
|
5766
|
+
<page_width><xsl:value-of select="$page_width"/></page_width>
|
5813
5767
|
</xsl:if>
|
5814
5768
|
|
5815
5769
|
<!-- There are three cases: -->
|
5816
5770
|
<xsl:choose>
|
5817
5771
|
<!-- 1. The minimum table width is equal to or wider than the available space -->
|
5818
|
-
<xsl:when test="
|
5772
|
+
<xsl:when test="@width_min >= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
|
5819
5773
|
<!-- call old algorithm -->
|
5820
5774
|
<case1/>
|
5821
5775
|
<!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
|
@@ -5825,10 +5779,10 @@
|
|
5825
5779
|
</xsl:call-template> -->
|
5826
5780
|
</xsl:when>
|
5827
5781
|
<!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
|
5828
|
-
<xsl:when test="
|
5782
|
+
<xsl:when test="@width_max <= $page_width">
|
5829
5783
|
<case2/>
|
5830
5784
|
<autolayout/>
|
5831
|
-
<xsl:for-each select="
|
5785
|
+
<xsl:for-each select="column/@width_max">
|
5832
5786
|
<column divider="100"><xsl:value-of select="."/></column>
|
5833
5787
|
</xsl:for-each>
|
5834
5788
|
</xsl:when>
|
@@ -5838,19 +5792,19 @@
|
|
5838
5792
|
For each column, let d be the difference between maximum and minimum width of that column.
|
5839
5793
|
Now set the column's width to the minimum width plus d times W over D.
|
5840
5794
|
This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
|
5841
|
-
<xsl:when test="(
|
5795
|
+
<xsl:when test="(@width_max > $page_width and @width_min < $page_width) or (@width_min >= $page_width)">
|
5842
5796
|
<!-- difference between the available space and the minimum table width -->
|
5843
|
-
<xsl:variable name="W" select="$page_width -
|
5797
|
+
<xsl:variable name="W" select="$page_width - @width_min"/>
|
5844
5798
|
<W><xsl:value-of select="$W"/></W>
|
5845
5799
|
<!-- difference between maximum and minimum width of the table -->
|
5846
|
-
<xsl:variable name="D" select="
|
5800
|
+
<xsl:variable name="D" select="@width_max - @width_min"/>
|
5847
5801
|
<D><xsl:value-of select="$D"/></D>
|
5848
5802
|
<case3/>
|
5849
5803
|
<autolayout/>
|
5850
|
-
<xsl:if test="
|
5804
|
+
<xsl:if test="@width_min >= $page_width">
|
5851
5805
|
<split_keep-within-line>true</split_keep-within-line>
|
5852
5806
|
</xsl:if>
|
5853
|
-
<xsl:for-each select="
|
5807
|
+
<xsl:for-each select="column">
|
5854
5808
|
<!-- difference between maximum and minimum width of that column. -->
|
5855
5809
|
<xsl:variable name="d" select="@width_max - @width_min"/>
|
5856
5810
|
<d><xsl:value-of select="$d"/></d>
|
@@ -5876,23 +5830,39 @@
|
|
5876
5830
|
|
5877
5831
|
<parent_element><xsl:value-of select="local-name(..)"/></parent_element>
|
5878
5832
|
|
5833
|
+
<ancestor_tree>
|
5834
|
+
<xsl:for-each select="ancestor::*">
|
5835
|
+
<ancestor><xsl:value-of select="local-name()"/></ancestor>
|
5836
|
+
</xsl:for-each>
|
5837
|
+
</ancestor_tree>
|
5838
|
+
|
5879
5839
|
<xsl:variable name="parent_table_page-width_">
|
5880
5840
|
<xsl:if test="$parent_table_id != ''">
|
5881
5841
|
<!-- determine column number in the parent table -->
|
5882
5842
|
<xsl:variable name="parent_table_column_number">
|
5883
5843
|
<xsl:choose>
|
5884
|
-
<xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
|
5844
|
+
<!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
|
5845
|
+
<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>
|
5885
5846
|
<xsl:otherwise> <!-- parent is table -->
|
5886
5847
|
<xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
|
5887
5848
|
</xsl:otherwise>
|
5888
5849
|
</xsl:choose>
|
5889
5850
|
</xsl:variable>
|
5890
5851
|
<!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
|
5891
|
-
|
5852
|
+
|
5853
|
+
<xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
|
5854
|
+
<xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
|
5855
|
+
<!-- <xsl:variable name="divider">
|
5856
|
+
<xsl:value-of select="$parent_table_column/@divider"/>
|
5857
|
+
<xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
|
5858
|
+
</xsl:variable> -->
|
5859
|
+
<xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
|
5892
5860
|
</xsl:if>
|
5893
5861
|
</xsl:variable>
|
5894
5862
|
<xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
|
5895
5863
|
|
5864
|
+
<parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
|
5865
|
+
|
5896
5866
|
<!-- get current table id -->
|
5897
5867
|
<xsl:variable name="table_id" select="@id"/>
|
5898
5868
|
|
@@ -5913,50 +5883,6 @@
|
|
5913
5883
|
|
5914
5884
|
</xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
|
5915
5885
|
|
5916
|
-
<!-- ============================= -->
|
5917
|
-
<!-- mode: determine_cell_widths-if -->
|
5918
|
-
<!-- ============================= -->
|
5919
|
-
<xsl:template match="@*|node()" mode="determine_cell_widths-if">
|
5920
|
-
<xsl:copy>
|
5921
|
-
<xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
|
5922
|
-
</xsl:copy>
|
5923
|
-
</xsl:template>
|
5924
|
-
|
5925
|
-
<xsl:template match="td | th" mode="determine_cell_widths-if">
|
5926
|
-
<xsl:copy>
|
5927
|
-
<xsl:copy-of select="@*"/>
|
5928
|
-
|
5929
|
-
<!-- The maximum width is given by the widest line. -->
|
5930
|
-
<xsl:attribute name="width_max">
|
5931
|
-
<xsl:for-each select="p_len">
|
5932
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
5933
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
5934
|
-
</xsl:for-each>
|
5935
|
-
</xsl:attribute>
|
5936
|
-
|
5937
|
-
<!-- The minimum width is given by the widest text element (word, image, etc.) -->
|
5938
|
-
<xsl:variable name="width_min">
|
5939
|
-
<xsl:for-each select="word_len">
|
5940
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
5941
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
5942
|
-
</xsl:for-each>
|
5943
|
-
</xsl:variable>
|
5944
|
-
<xsl:attribute name="width_min">
|
5945
|
-
<xsl:value-of select="$width_min"/>
|
5946
|
-
</xsl:attribute>
|
5947
|
-
|
5948
|
-
<xsl:if test="$width_min = 0">
|
5949
|
-
<xsl:attribute name="width_min">1</xsl:attribute>
|
5950
|
-
</xsl:if>
|
5951
|
-
|
5952
|
-
<xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
|
5953
|
-
|
5954
|
-
</xsl:copy>
|
5955
|
-
</xsl:template>
|
5956
|
-
<!-- ============================= -->
|
5957
|
-
<!-- END mode: determine_cell_widths-if -->
|
5958
|
-
<!-- ============================= -->
|
5959
|
-
|
5960
5886
|
<!-- ================================================== -->
|
5961
5887
|
<!-- Calculate column's width based on HTML4 algorithm -->
|
5962
5888
|
<!-- ================================================== -->
|
@@ -6204,6 +6130,7 @@
|
|
6204
6130
|
<xsl:when test="$table_or_dl = 'table'">
|
6205
6131
|
<xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
|
6206
6132
|
<fo:table-row number-columns-spanned="{$col_count}">
|
6133
|
+
<xsl:copy-of select="../@font-weight"/>
|
6207
6134
|
<!-- <test_table><xsl:copy-of select="."/></test_table> -->
|
6208
6135
|
<xsl:call-template name="td"/>
|
6209
6136
|
</fo:table-row>
|
@@ -6368,7 +6295,7 @@
|
|
6368
6295
|
|
6369
6296
|
<xsl:apply-templates/>
|
6370
6297
|
|
6371
|
-
<xsl:if test="$isGenerateTableIF = 'true'"
|
6298
|
+
<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"/> -->
|
6372
6299
|
|
6373
6300
|
</fo:block>
|
6374
6301
|
</fo:table-cell>
|
@@ -6703,6 +6630,7 @@
|
|
6703
6630
|
<xsl:template match="*[local-name()='dl']">
|
6704
6631
|
<xsl:variable name="isAdded" select="@added"/>
|
6705
6632
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
6633
|
+
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
6706
6634
|
<fo:block-container>
|
6707
6635
|
|
6708
6636
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -7236,21 +7164,16 @@
|
|
7236
7164
|
<!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
|
7237
7165
|
<xsl:template match="*[local-name()='dt']" mode="dl_if">
|
7238
7166
|
<xsl:param name="id"/>
|
7239
|
-
<xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
|
7240
7167
|
<tr>
|
7241
7168
|
<td>
|
7242
7169
|
<xsl:copy-of select="node()"/>
|
7243
7170
|
</td>
|
7244
7171
|
<td>
|
7245
|
-
|
7246
|
-
|
7247
|
-
|
7248
|
-
<!-- get paragraphs from nested 'dl' -->
|
7249
|
-
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
7250
|
-
|
7172
|
+
<xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
|
7173
|
+
<!-- get paragraphs from nested 'dl' -->
|
7174
|
+
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
7251
7175
|
</td>
|
7252
7176
|
</tr>
|
7253
|
-
|
7254
7177
|
</xsl:template>
|
7255
7178
|
<xsl:template match="*[local-name()='dd']" mode="dl_if"/>
|
7256
7179
|
|
@@ -7901,6 +7824,9 @@
|
|
7901
7824
|
<xsl:variable name="td">
|
7902
7825
|
<xsl:element name="td">
|
7903
7826
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
7827
|
+
<xsl:if test="local-name()='th'">
|
7828
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
7829
|
+
</xsl:if>
|
7904
7830
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
7905
7831
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
7906
7832
|
</xsl:element>
|
@@ -7913,6 +7839,9 @@
|
|
7913
7839
|
<xsl:otherwise>
|
7914
7840
|
<xsl:element name="td">
|
7915
7841
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
7842
|
+
<xsl:if test="local-name()='th'">
|
7843
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
7844
|
+
</xsl:if>
|
7916
7845
|
<xsl:apply-templates mode="simple-table-colspan"/>
|
7917
7846
|
</xsl:element>
|
7918
7847
|
</xsl:otherwise>
|
@@ -8042,8 +7971,14 @@
|
|
8042
7971
|
<xsl:copy-of select="@*"/>
|
8043
7972
|
<xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
|
8044
7973
|
<xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
|
7974
|
+
<xsl:variable name="divide">
|
7975
|
+
<xsl:choose>
|
7976
|
+
<xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
|
7977
|
+
<xsl:otherwise>1</xsl:otherwise>
|
7978
|
+
</xsl:choose>
|
7979
|
+
</xsl:variable>
|
8045
7980
|
<xsl:attribute name="id">
|
8046
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
|
7981
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
|
8047
7982
|
</xsl:attribute>
|
8048
7983
|
|
8049
7984
|
<xsl:for-each select="*[local-name() = 'p']">
|
@@ -8051,10 +7986,12 @@
|
|
8051
7986
|
<xsl:copy-of select="@*"/>
|
8052
7987
|
<xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
|
8053
7988
|
<xsl:attribute name="id">
|
8054
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
|
7989
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
|
8055
7990
|
</xsl:attribute>
|
8056
7991
|
|
8057
|
-
<xsl:copy-of select="node()"/>
|
7992
|
+
<!-- <xsl:copy-of select="node()" /> -->
|
7993
|
+
<xsl:apply-templates mode="simple-table-noid"/>
|
7994
|
+
|
8058
7995
|
</xsl:copy>
|
8059
7996
|
</xsl:for-each>
|
8060
7997
|
|
@@ -8083,7 +8020,7 @@
|
|
8083
8020
|
<xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
|
8084
8021
|
<xsl:copy>
|
8085
8022
|
<xsl:attribute name="id">
|
8086
|
-
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
|
8023
|
+
<xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
|
8087
8024
|
</xsl:attribute>
|
8088
8025
|
<xsl:copy-of select="node()"/>
|
8089
8026
|
</xsl:copy>
|
@@ -8092,6 +8029,24 @@
|
|
8092
8029
|
</xsl:copy>
|
8093
8030
|
|
8094
8031
|
</xsl:template>
|
8032
|
+
|
8033
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
|
8034
|
+
<xsl:copy>
|
8035
|
+
<xsl:choose>
|
8036
|
+
<xsl:when test="$isGenerateTableIF = 'true'">
|
8037
|
+
<xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
|
8038
|
+
<!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
|
8039
|
+
<xsl:copy-of select="@id"/>
|
8040
|
+
</xsl:if> -->
|
8041
|
+
</xsl:when>
|
8042
|
+
<xsl:otherwise>
|
8043
|
+
<xsl:copy-of select="@*"/>
|
8044
|
+
</xsl:otherwise>
|
8045
|
+
</xsl:choose>
|
8046
|
+
<xsl:apply-templates select="node()" mode="simple-table-noid"/>
|
8047
|
+
</xsl:copy>
|
8048
|
+
</xsl:template>
|
8049
|
+
|
8095
8050
|
<!-- End mode: simple-table-id -->
|
8096
8051
|
<!-- ===================== -->
|
8097
8052
|
<!-- ===================== -->
|
@@ -8101,7 +8056,7 @@
|
|
8101
8056
|
<!-- =============================== -->
|
8102
8057
|
<xsl:template match="@*|node()" mode="td_text_with_formatting">
|
8103
8058
|
<xsl:copy>
|
8104
|
-
|
8059
|
+
<xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
|
8105
8060
|
</xsl:copy>
|
8106
8061
|
</xsl:template>
|
8107
8062
|
|
@@ -8215,6 +8170,10 @@
|
|
8215
8170
|
|
8216
8171
|
<fo:inline xsl:use-attribute-sets="mathml-style">
|
8217
8172
|
|
8173
|
+
<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 -->
|
8174
|
+
<!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
|
8175
|
+
</xsl:if>
|
8176
|
+
|
8218
8177
|
<xsl:call-template name="setTrackChangesStyles">
|
8219
8178
|
<xsl:with-param name="isAdded" select="$isAdded"/>
|
8220
8179
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
@@ -10208,15 +10167,12 @@
|
|
10208
10167
|
|
10209
10168
|
<xsl:template match="*[local-name()='tr']" mode="requirement">
|
10210
10169
|
<fo:table-row height="7mm" border-bottom="0.5pt solid grey">
|
10211
|
-
|
10212
|
-
|
10213
|
-
|
10214
|
-
|
10215
|
-
<xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
|
10216
|
-
</xsl:if>
|
10217
|
-
<xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
|
10218
|
-
<xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
|
10170
|
+
|
10171
|
+
<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 ')">
|
10172
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
10173
|
+
|
10219
10174
|
</xsl:if>
|
10175
|
+
|
10220
10176
|
<xsl:apply-templates mode="requirement"/>
|
10221
10177
|
</fo:table-row>
|
10222
10178
|
</xsl:template>
|
@@ -11764,7 +11720,7 @@
|
|
11764
11720
|
</tbody>
|
11765
11721
|
</xsl:variable>
|
11766
11722
|
<xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
|
11767
|
-
<xsl:call-template name="calculate-column-widths">
|
11723
|
+
<xsl:call-template name="calculate-column-widths-proportional">
|
11768
11724
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
11769
11725
|
<xsl:with-param name="table" select="$toc_table_simple"/>
|
11770
11726
|
</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/ieee/front.rb
CHANGED
@@ -89,17 +89,6 @@ module Metanorma
|
|
89
89
|
super + %w(merges updates)
|
90
90
|
end
|
91
91
|
|
92
|
-
def metadata_ics(node, xml)
|
93
|
-
ics = node.attr("library-ics")
|
94
|
-
ics&.split(/,\s*/)&.each do |i|
|
95
|
-
xml.ics {
|
96
|
-
|elem| elem.code i
|
97
|
-
icsdata = Isoics.fetch i
|
98
|
-
elem.text_ icsdata.description
|
99
|
-
}
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
92
|
def metadata_ext(node, xml)
|
104
93
|
super
|
105
94
|
structured_id(node, xml)
|
@@ -149,13 +149,13 @@ module Metanorma
|
|
149
149
|
pref = image_name_prefix(xmldoc)
|
150
150
|
(xmldoc.xpath("//figure") - xmldoc.xpath("//table//figure"))
|
151
151
|
.each do |f|
|
152
|
-
i = f.at("./image") or next
|
153
|
-
next if i["src"].start_with?("data:")
|
152
|
+
(i = f.at("./image") and !i["src"]&.start_with?("data:")) or next
|
154
153
|
|
155
154
|
num = xrefs.anchor(f["id"], :label)
|
156
|
-
File.basename(i["src"], ".*")
|
155
|
+
base = File.basename(i["src"], ".*")
|
156
|
+
base == "#{pref}_fig#{num}" or
|
157
157
|
@log.add("Style", i,
|
158
|
-
"Image name #{
|
158
|
+
"Image name #{base} is expected to be #{pref}_fig#{num}")
|
159
159
|
end
|
160
160
|
end
|
161
161
|
|
@@ -170,13 +170,13 @@ module Metanorma
|
|
170
170
|
def table_figure_name_validate(xmldoc, xrefs)
|
171
171
|
xmldoc.xpath("//table[.//figure]").each do |t|
|
172
172
|
xmldoc.xpath(".//figure").each do |f|
|
173
|
-
i = f.at("./image") or next
|
174
|
-
next if i["src"].start_with?("data:")
|
173
|
+
(i = f.at("./image") and !i["src"]&.start_with?("data:")) or next
|
175
174
|
|
176
175
|
num = tablefigurenumber(t, f, xrefs)
|
177
|
-
File.basename(i["src"])
|
176
|
+
base = File.basename(i["src"])
|
177
|
+
base == num or
|
178
178
|
@log.add("Style", i,
|
179
|
-
"Image name #{
|
179
|
+
"Image name #{base} is expected to be #{num}")
|
180
180
|
end
|
181
181
|
end
|
182
182
|
end
|
data/lib/metanorma-ieee.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-ieee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
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: metanorma-standoc
|
@@ -202,6 +202,8 @@ extensions: []
|
|
202
202
|
extra_rdoc_files: []
|
203
203
|
files:
|
204
204
|
- ".github/workflows/rake.yml"
|
205
|
+
- ".github/workflows/release.yml"
|
206
|
+
- ".hound.yml"
|
205
207
|
- ".rubocop.yml"
|
206
208
|
- CODE_OF_CONDUCT.md
|
207
209
|
- Gemfile
|
@@ -220,14 +222,11 @@ files:
|
|
220
222
|
- lib/isodoc/ieee/html/header_amd.html
|
221
223
|
- lib/isodoc/ieee/html/html_ieee_intro.html
|
222
224
|
- lib/isodoc/ieee/html/html_ieee_titlepage.html
|
223
|
-
- lib/isodoc/ieee/html/htmlstyle.css
|
224
225
|
- lib/isodoc/ieee/html/htmlstyle.scss
|
225
|
-
- lib/isodoc/ieee/html/ieee.css
|
226
226
|
- lib/isodoc/ieee/html/ieee.scss
|
227
227
|
- lib/isodoc/ieee/html/scripts.html
|
228
228
|
- lib/isodoc/ieee/html/word_ieee_intro.html
|
229
229
|
- lib/isodoc/ieee/html/word_ieee_titlepage.html
|
230
|
-
- lib/isodoc/ieee/html/wordstyle.css
|
231
230
|
- lib/isodoc/ieee/html/wordstyle.scss
|
232
231
|
- lib/isodoc/ieee/html_convert.rb
|
233
232
|
- lib/isodoc/ieee/i18n-en.yaml
|
@@ -271,7 +270,7 @@ homepage: https://github.com/metanorma/metanorma-ieee
|
|
271
270
|
licenses:
|
272
271
|
- BSD-2-Clause
|
273
272
|
metadata: {}
|
274
|
-
post_install_message:
|
273
|
+
post_install_message:
|
275
274
|
rdoc_options: []
|
276
275
|
require_paths:
|
277
276
|
- lib
|
@@ -286,8 +285,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
285
|
- !ruby/object:Gem::Version
|
287
286
|
version: '0'
|
288
287
|
requirements: []
|
289
|
-
rubygems_version: 3.
|
290
|
-
signing_key:
|
288
|
+
rubygems_version: 3.1.6
|
289
|
+
signing_key:
|
291
290
|
specification_version: 4
|
292
291
|
summary: Metanorma for the IEEE
|
293
292
|
test_files: []
|