metanorma-iho 0.9.5 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iho/iho.specification.xsl +220 -53
- data/lib/isodoc/iho/iho.standard.xsl +220 -53
- data/lib/isodoc/iho/word_convert.rb +0 -14
- data/lib/metanorma/iho/biblio.rng +22 -23
- data/lib/metanorma/iho/isodoc.rng +37 -116
- data/lib/metanorma/iho/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 980367d23b8e5e15a1fa402561a174dc117cfded136f264f6df42c137d469ef0
|
4
|
+
data.tar.gz: 319d58da4f503c91519863780682e882e417ba304cfe920313a4f7b62a292152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 384862118a46f6fbab0812abd66a4e3b372906d8218ce22a3e269946c341656c1eb2c7fa91ecd07fc7425e6a2b45e7f45f0db0d26b00d3158888e5398ff00e87
|
7
|
+
data.tar.gz: 0f0c45715251c14a942add184f470cb5af3d5e7fab7888157e3674d816a8b3dc3d5a3719f73b0d4e703f5ba0d9e953031c1b8dec748a1b8191f5534db9c035ba
|
@@ -854,17 +854,30 @@
|
|
854
854
|
<xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
|
855
855
|
|
856
856
|
<xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm -->
|
857
|
-
<xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
|
857
|
+
<xsl:param name="table_widths"/> <!-- (debug: path to) xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
|
858
858
|
<!-- Example: <tables>
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
859
|
+
<table page-width="509103" id="table1" width_max="223561" width_min="223560">
|
860
|
+
<column width_max="39354" width_min="39354"/>
|
861
|
+
<column width_max="75394" width_min="75394"/>
|
862
|
+
<column width_max="108813" width_min="108813"/>
|
863
|
+
<tbody>
|
864
|
+
<tr>
|
865
|
+
<td width_max="39354" width_min="39354">
|
866
|
+
<p_len>39354</p_len>
|
867
|
+
<word_len>39354</word_len>
|
868
|
+
</td>
|
869
|
+
|
870
|
+
OLD:
|
871
|
+
<tables>
|
872
|
+
<table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
|
873
|
+
<tbody>
|
874
|
+
<tr>
|
875
|
+
<td id="tab-symdu_1_1">
|
876
|
+
<p_len>6</p_len>
|
877
|
+
<p_len>100</p_len> for 2nd paragraph
|
878
|
+
<word_len>6</word_len>
|
879
|
+
<word_len>20</word_len>
|
880
|
+
...
|
868
881
|
-->
|
869
882
|
|
870
883
|
<!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> -->
|
@@ -1084,6 +1097,9 @@
|
|
1084
1097
|
<xsl:variable name="hair_space"> </xsl:variable>
|
1085
1098
|
<xsl:variable name="en_dash">–</xsl:variable>
|
1086
1099
|
<xsl:variable name="em_dash">—</xsl:variable>
|
1100
|
+
<xsl:variable name="cr"> </xsl:variable>
|
1101
|
+
<xsl:variable name="lf">
|
1102
|
+
</xsl:variable>
|
1087
1103
|
|
1088
1104
|
<xsl:template name="getTitle">
|
1089
1105
|
<xsl:param name="name"/>
|
@@ -2751,6 +2767,20 @@
|
|
2751
2767
|
</xsl:for-each>
|
2752
2768
|
</xsl:template>
|
2753
2769
|
|
2770
|
+
<xsl:param name="table_only_with_id"/><!-- Example: table1, for table auto-layout algorithm -->
|
2771
|
+
|
2772
|
+
<xsl:template match="*[local-name()='table']" priority="2">
|
2773
|
+
<xsl:choose>
|
2774
|
+
<xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
|
2775
|
+
<xsl:call-template name="table"/>
|
2776
|
+
</xsl:when>
|
2777
|
+
<xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
|
2778
|
+
<xsl:otherwise>
|
2779
|
+
<xsl:call-template name="table"/>
|
2780
|
+
</xsl:otherwise>
|
2781
|
+
</xsl:choose>
|
2782
|
+
</xsl:template>
|
2783
|
+
|
2754
2784
|
<xsl:template match="*[local-name()='table']" name="table">
|
2755
2785
|
|
2756
2786
|
<xsl:variable name="table-preamble">
|
@@ -2760,9 +2790,11 @@
|
|
2760
2790
|
<xsl:variable name="table">
|
2761
2791
|
|
2762
2792
|
<xsl:variable name="simple-table">
|
2763
|
-
<xsl:
|
2764
|
-
<xsl:
|
2765
|
-
|
2793
|
+
<xsl:if test="$isGenerateTableIF = 'true' and $isApplyAutolayoutAlgorithm = 'true'">
|
2794
|
+
<xsl:call-template name="getSimpleTable">
|
2795
|
+
<xsl:with-param name="id" select="@id"/>
|
2796
|
+
</xsl:call-template>
|
2797
|
+
</xsl:if>
|
2766
2798
|
</xsl:variable>
|
2767
2799
|
<!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
|
2768
2800
|
|
@@ -2858,9 +2890,9 @@
|
|
2858
2890
|
</xsl:attribute>
|
2859
2891
|
</xsl:for-each>
|
2860
2892
|
|
2861
|
-
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
|
2893
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'][not(@type = 'units')] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
|
2862
2894
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
2863
|
-
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute
|
2895
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
|
2864
2896
|
</xsl:if>
|
2865
2897
|
|
2866
2898
|
<xsl:choose>
|
@@ -3013,9 +3045,28 @@
|
|
3013
3045
|
|
3014
3046
|
</fo:block>
|
3015
3047
|
|
3048
|
+
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
3049
|
+
<xsl:if test="$continued = 'true'">
|
3050
|
+
<fo:block text-align="right">
|
3051
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
3052
|
+
</fo:block>
|
3053
|
+
</xsl:if>
|
3054
|
+
<!-- </xsl:if> -->
|
3055
|
+
|
3016
3056
|
</xsl:if>
|
3017
3057
|
</xsl:template> <!-- table/name -->
|
3018
3058
|
|
3059
|
+
<!-- workaround solution for https://github.com/metanorma/metanorma-iso/issues/1151#issuecomment-2033087938 -->
|
3060
|
+
<xsl:template match="*[local-name()='table']/*[local-name() = 'note'][@type = 'units']/*[local-name() = 'p']/text()" priority="4">
|
3061
|
+
<xsl:choose>
|
3062
|
+
<xsl:when test="preceding-sibling::*[local-name() = 'br']">
|
3063
|
+
<!-- remove CR or LF at start -->
|
3064
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'^( | | )', '')"/>
|
3065
|
+
</xsl:when>
|
3066
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
3067
|
+
</xsl:choose>
|
3068
|
+
</xsl:template>
|
3069
|
+
|
3019
3070
|
<!-- SOURCE: ... -->
|
3020
3071
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
|
3021
3072
|
<xsl:call-template name="termsource"/>
|
@@ -3426,7 +3477,7 @@
|
|
3426
3477
|
<xsl:param name="colwidths"/>
|
3427
3478
|
<xsl:param name="colgroup"/>
|
3428
3479
|
|
3429
|
-
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
|
3480
|
+
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
|
3430
3481
|
|
3431
3482
|
<xsl:variable name="isNoteOrFnExistShowAfterTable">
|
3432
3483
|
|
@@ -3498,7 +3549,7 @@
|
|
3498
3549
|
|
3499
3550
|
<xsl:apply-templates select="../*[local-name()='p']"/>
|
3500
3551
|
<xsl:apply-templates select="../*[local-name()='dl']"/>
|
3501
|
-
<xsl:apply-templates select="../*[local-name()='note']"/>
|
3552
|
+
<xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
|
3502
3553
|
<xsl:apply-templates select="../*[local-name()='example']"/>
|
3503
3554
|
<xsl:apply-templates select="../*[local-name()='source']"/>
|
3504
3555
|
|
@@ -3508,7 +3559,7 @@
|
|
3508
3559
|
|
3509
3560
|
<!-- horizontal row separator -->
|
3510
3561
|
<xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
|
3511
|
-
<xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
|
3562
|
+
<xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
|
3512
3563
|
<fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
|
3513
3564
|
|
3514
3565
|
<xsl:call-template name="setBordersTableArray"/>
|
@@ -4173,7 +4224,20 @@
|
|
4173
4224
|
<!-- Definition List -->
|
4174
4225
|
<!-- ===================== -->
|
4175
4226
|
|
4176
|
-
|
4227
|
+
<!-- for table auto-layout algorithm -->
|
4228
|
+
<xsl:template match="*[local-name()='dl']" priority="2">
|
4229
|
+
<xsl:choose>
|
4230
|
+
<xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
|
4231
|
+
<xsl:call-template name="dl"/>
|
4232
|
+
</xsl:when>
|
4233
|
+
<xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
|
4234
|
+
<xsl:otherwise>
|
4235
|
+
<xsl:call-template name="dl"/>
|
4236
|
+
</xsl:otherwise>
|
4237
|
+
</xsl:choose>
|
4238
|
+
</xsl:template>
|
4239
|
+
|
4240
|
+
<xsl:template match="*[local-name()='dl']" name="dl">
|
4177
4241
|
<xsl:variable name="isAdded" select="@added"/>
|
4178
4242
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
4179
4243
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
@@ -6180,7 +6244,13 @@
|
|
6180
6244
|
<xsl:value-of select="$language_current_2"/>
|
6181
6245
|
</xsl:when>
|
6182
6246
|
<xsl:otherwise>
|
6183
|
-
<xsl:
|
6247
|
+
<xsl:variable name="language_current_3" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'])"/>
|
6248
|
+
<xsl:choose>
|
6249
|
+
<xsl:when test="$language_current_3 != ''">
|
6250
|
+
<xsl:value-of select="$language_current_3"/>
|
6251
|
+
</xsl:when>
|
6252
|
+
<xsl:otherwise>en</xsl:otherwise>
|
6253
|
+
</xsl:choose>
|
6184
6254
|
</xsl:otherwise>
|
6185
6255
|
</xsl:choose>
|
6186
6256
|
</xsl:otherwise>
|
@@ -7044,10 +7114,11 @@
|
|
7044
7114
|
</xsl:template>
|
7045
7115
|
|
7046
7116
|
<xsl:template match="*[local-name() = 'image']">
|
7117
|
+
<xsl:param name="indent">0</xsl:param>
|
7047
7118
|
<xsl:variable name="isAdded" select="../@added"/>
|
7048
7119
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
7049
7120
|
<xsl:choose>
|
7050
|
-
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
7121
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']"> <!-- inline image ( 'image:path' in adoc, with one colon after image) -->
|
7051
7122
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
7052
7123
|
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
7053
7124
|
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
@@ -7056,7 +7127,43 @@
|
|
7056
7127
|
<xsl:variable name="src">
|
7057
7128
|
<xsl:call-template name="image_src"/>
|
7058
7129
|
</xsl:variable>
|
7059
|
-
|
7130
|
+
|
7131
|
+
<xsl:variable name="scale">
|
7132
|
+
<xsl:call-template name="getImageScale">
|
7133
|
+
<xsl:with-param name="indent" select="$indent"/>
|
7134
|
+
</xsl:call-template>
|
7135
|
+
</xsl:variable>
|
7136
|
+
|
7137
|
+
<!-- debug scale='<xsl:value-of select="$scale"/>', indent='<xsl:value-of select="$indent"/>' -->
|
7138
|
+
|
7139
|
+
<!-- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/> -->
|
7140
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
|
7141
|
+
|
7142
|
+
<xsl:variable name="width">
|
7143
|
+
<xsl:call-template name="setImageWidth"/>
|
7144
|
+
</xsl:variable>
|
7145
|
+
<xsl:if test="$width != ''">
|
7146
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
|
7147
|
+
</xsl:if>
|
7148
|
+
<xsl:variable name="height">
|
7149
|
+
<xsl:call-template name="setImageHeight"/>
|
7150
|
+
</xsl:variable>
|
7151
|
+
<xsl:if test="$height != ''">
|
7152
|
+
<xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
|
7153
|
+
</xsl:if>
|
7154
|
+
|
7155
|
+
<xsl:if test="$width = '' and $height = ''">
|
7156
|
+
<xsl:if test="number($scale) < 100">
|
7157
|
+
<xsl:attribute name="content-width"><xsl:value-of select="number($scale)"/>%</xsl:attribute>
|
7158
|
+
<!-- <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
|
7159
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
7160
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
7161
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute> -->
|
7162
|
+
</xsl:if>
|
7163
|
+
</xsl:if>
|
7164
|
+
|
7165
|
+
</fo:external-graphic>
|
7166
|
+
|
7060
7167
|
</fo:inline>
|
7061
7168
|
</xsl:when>
|
7062
7169
|
<xsl:otherwise>
|
@@ -7077,25 +7184,23 @@
|
|
7077
7184
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
7078
7185
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
7079
7186
|
|
7080
|
-
|
7187
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
7081
7188
|
|
7082
7189
|
</fo:instream-foreign-object>
|
7083
7190
|
</xsl:when>
|
7084
7191
|
<xsl:otherwise>
|
7192
|
+
<!-- <fo:block>debug block image:
|
7193
|
+
<xsl:variable name="scale">
|
7194
|
+
<xsl:call-template name="getImageScale">
|
7195
|
+
<xsl:with-param name="indent" select="$indent"/>
|
7196
|
+
</xsl:call-template>
|
7197
|
+
</xsl:variable>
|
7198
|
+
<xsl:value-of select="concat('scale=', $scale,', indent=', $indent)"/>
|
7199
|
+
</fo:block> -->
|
7085
7200
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
7086
|
-
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
7087
|
-
|
7088
|
-
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
7089
|
-
<xsl:attribute name="width">
|
7090
|
-
<xsl:value-of select="@width"/>
|
7091
|
-
</xsl:attribute>
|
7092
|
-
</xsl:if>
|
7201
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and (../*[local-name() = 'name'] or parent::*[local-name() = 'figure'][@unnumbered = 'true']) and not(ancestor::*[local-name() = 'table'])">
|
7093
7202
|
|
7094
|
-
<xsl:
|
7095
|
-
<xsl:attribute name="height">
|
7096
|
-
<xsl:value-of select="@height"/>
|
7097
|
-
</xsl:attribute>
|
7098
|
-
</xsl:if>
|
7203
|
+
<xsl:call-template name="setImageWidthHeight"/>
|
7099
7204
|
|
7100
7205
|
<xsl:choose>
|
7101
7206
|
<xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
|
@@ -7103,24 +7208,18 @@
|
|
7103
7208
|
</xsl:when>
|
7104
7209
|
<xsl:otherwise>
|
7105
7210
|
|
7106
|
-
<xsl:variable name="
|
7107
|
-
<xsl:
|
7108
|
-
<xsl:
|
7109
|
-
|
7110
|
-
</xsl:choose>
|
7211
|
+
<xsl:variable name="scale">
|
7212
|
+
<xsl:call-template name="getImageScale">
|
7213
|
+
<xsl:with-param name="indent" select="$indent"/>
|
7214
|
+
</xsl:call-template>
|
7111
7215
|
</xsl:variable>
|
7112
7216
|
|
7113
|
-
<xsl:variable name="
|
7114
|
-
|
7115
|
-
<xsl:value-of select="$width_effective"/>
|
7116
|
-
|
7217
|
+
<xsl:variable name="scaleRatio">
|
7218
|
+
1
|
7117
7219
|
</xsl:variable>
|
7118
7220
|
|
7119
|
-
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
7120
7221
|
<xsl:if test="number($scale) < 100">
|
7121
|
-
|
7122
|
-
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
7123
|
-
|
7222
|
+
<xsl:attribute name="content-width"><xsl:value-of select="number($scale) * number($scaleRatio)"/>%</xsl:attribute>
|
7124
7223
|
</xsl:if>
|
7125
7224
|
</xsl:otherwise>
|
7126
7225
|
</xsl:choose>
|
@@ -7136,6 +7235,62 @@
|
|
7136
7235
|
</xsl:choose>
|
7137
7236
|
</xsl:template>
|
7138
7237
|
|
7238
|
+
<xsl:template name="setImageWidth">
|
7239
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
7240
|
+
<xsl:value-of select="@width"/>
|
7241
|
+
</xsl:if>
|
7242
|
+
</xsl:template>
|
7243
|
+
<xsl:template name="setImageHeight">
|
7244
|
+
<xsl:if test="@height != '' and @height != 'auto'">
|
7245
|
+
<xsl:value-of select="@height"/>
|
7246
|
+
</xsl:if>
|
7247
|
+
</xsl:template>
|
7248
|
+
<xsl:template name="setImageWidthHeight">
|
7249
|
+
<xsl:variable name="width">
|
7250
|
+
<xsl:call-template name="setImageWidth"/>
|
7251
|
+
</xsl:variable>
|
7252
|
+
<xsl:if test="$width != ''">
|
7253
|
+
<xsl:attribute name="width">
|
7254
|
+
<xsl:value-of select="$width"/>
|
7255
|
+
</xsl:attribute>
|
7256
|
+
</xsl:if>
|
7257
|
+
<xsl:variable name="height">
|
7258
|
+
<xsl:call-template name="setImageHeight"/>
|
7259
|
+
</xsl:variable>
|
7260
|
+
<xsl:if test="$height != ''">
|
7261
|
+
<xsl:attribute name="height">
|
7262
|
+
<xsl:value-of select="$height"/>
|
7263
|
+
</xsl:attribute>
|
7264
|
+
</xsl:if>
|
7265
|
+
</xsl:template>
|
7266
|
+
|
7267
|
+
<xsl:template name="getImageScale">
|
7268
|
+
<xsl:param name="indent"/>
|
7269
|
+
<xsl:variable name="indent_left">
|
7270
|
+
<xsl:choose>
|
7271
|
+
<xsl:when test="$indent != ''"><xsl:value-of select="$indent"/></xsl:when>
|
7272
|
+
<xsl:otherwise>0</xsl:otherwise>
|
7273
|
+
</xsl:choose>
|
7274
|
+
</xsl:variable>
|
7275
|
+
<xsl:variable name="img_src">
|
7276
|
+
<xsl:choose>
|
7277
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
7278
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
7279
|
+
</xsl:choose>
|
7280
|
+
</xsl:variable>
|
7281
|
+
|
7282
|
+
<xsl:variable name="image_width_effective">
|
7283
|
+
|
7284
|
+
<xsl:value-of select="$width_effective - number($indent_left)"/>
|
7285
|
+
|
7286
|
+
</xsl:variable>
|
7287
|
+
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
7288
|
+
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
7289
|
+
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
7290
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
7291
|
+
<xsl:value-of select="$scale"/>
|
7292
|
+
</xsl:template>
|
7293
|
+
|
7139
7294
|
<xsl:template name="image_src">
|
7140
7295
|
<xsl:choose>
|
7141
7296
|
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
@@ -9811,6 +9966,7 @@
|
|
9811
9966
|
</xsl:template>
|
9812
9967
|
|
9813
9968
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
9969
|
+
<xsl:param name="indent">0</xsl:param>
|
9814
9970
|
<xsl:choose>
|
9815
9971
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
9816
9972
|
<fo:block-container role="SKIP">
|
@@ -9825,7 +9981,9 @@
|
|
9825
9981
|
|
9826
9982
|
<fo:block-container margin-left="0mm" role="SKIP">
|
9827
9983
|
<fo:block>
|
9828
|
-
<xsl:apply-templates select="." mode="list"
|
9984
|
+
<xsl:apply-templates select="." mode="list">
|
9985
|
+
<xsl:with-param name="indent" select="$indent"/>
|
9986
|
+
</xsl:apply-templates>
|
9829
9987
|
</fo:block>
|
9830
9988
|
</fo:block-container>
|
9831
9989
|
</fo:block-container>
|
@@ -9833,7 +9991,9 @@
|
|
9833
9991
|
<xsl:otherwise>
|
9834
9992
|
|
9835
9993
|
<fo:block role="SKIP">
|
9836
|
-
<xsl:apply-templates select="." mode="list"
|
9994
|
+
<xsl:apply-templates select="." mode="list">
|
9995
|
+
<xsl:with-param name="indent" select="$indent"/>
|
9996
|
+
</xsl:apply-templates>
|
9837
9997
|
</fo:block>
|
9838
9998
|
|
9839
9999
|
</xsl:otherwise>
|
@@ -9918,6 +10078,13 @@
|
|
9918
10078
|
</xsl:template>
|
9919
10079
|
|
9920
10080
|
<xsl:template match="*[local-name()='li']">
|
10081
|
+
<xsl:param name="indent">0</xsl:param>
|
10082
|
+
<!-- <fo:list-item xsl:use-attribute-sets="list-item-style">
|
10083
|
+
<fo:list-item-label end-indent="label-end()"><fo:block>x</fo:block></fo:list-item-label>
|
10084
|
+
<fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
|
10085
|
+
<fo:block>debug li indent=<xsl:value-of select="$indent"/></fo:block>
|
10086
|
+
</fo:list-item-body>
|
10087
|
+
</fo:list-item> -->
|
9921
10088
|
<fo:list-item xsl:use-attribute-sets="list-item-style">
|
9922
10089
|
<xsl:copy-of select="@id"/>
|
9923
10090
|
|
@@ -9942,7 +10109,9 @@
|
|
9942
10109
|
|
9943
10110
|
<xsl:call-template name="refine_list-item-body-style"/>
|
9944
10111
|
|
9945
|
-
<xsl:apply-templates
|
10112
|
+
<xsl:apply-templates>
|
10113
|
+
<xsl:with-param name="indent" select="$indent"/>
|
10114
|
+
</xsl:apply-templates>
|
9946
10115
|
|
9947
10116
|
<!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
|
9948
10117
|
|
@@ -12105,6 +12274,4 @@
|
|
12105
12274
|
</xsl:if>
|
12106
12275
|
</xsl:template>
|
12107
12276
|
|
12108
|
-
<!-- update -->
|
12109
|
-
|
12110
12277
|
</xsl:stylesheet>
|
@@ -854,17 +854,30 @@
|
|
854
854
|
<xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
|
855
855
|
|
856
856
|
<xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm -->
|
857
|
-
<xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
|
857
|
+
<xsl:param name="table_widths"/> <!-- (debug: path to) xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
|
858
858
|
<!-- Example: <tables>
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
859
|
+
<table page-width="509103" id="table1" width_max="223561" width_min="223560">
|
860
|
+
<column width_max="39354" width_min="39354"/>
|
861
|
+
<column width_max="75394" width_min="75394"/>
|
862
|
+
<column width_max="108813" width_min="108813"/>
|
863
|
+
<tbody>
|
864
|
+
<tr>
|
865
|
+
<td width_max="39354" width_min="39354">
|
866
|
+
<p_len>39354</p_len>
|
867
|
+
<word_len>39354</word_len>
|
868
|
+
</td>
|
869
|
+
|
870
|
+
OLD:
|
871
|
+
<tables>
|
872
|
+
<table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
|
873
|
+
<tbody>
|
874
|
+
<tr>
|
875
|
+
<td id="tab-symdu_1_1">
|
876
|
+
<p_len>6</p_len>
|
877
|
+
<p_len>100</p_len> for 2nd paragraph
|
878
|
+
<word_len>6</word_len>
|
879
|
+
<word_len>20</word_len>
|
880
|
+
...
|
868
881
|
-->
|
869
882
|
|
870
883
|
<!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> -->
|
@@ -1084,6 +1097,9 @@
|
|
1084
1097
|
<xsl:variable name="hair_space"> </xsl:variable>
|
1085
1098
|
<xsl:variable name="en_dash">–</xsl:variable>
|
1086
1099
|
<xsl:variable name="em_dash">—</xsl:variable>
|
1100
|
+
<xsl:variable name="cr"> </xsl:variable>
|
1101
|
+
<xsl:variable name="lf">
|
1102
|
+
</xsl:variable>
|
1087
1103
|
|
1088
1104
|
<xsl:template name="getTitle">
|
1089
1105
|
<xsl:param name="name"/>
|
@@ -2751,6 +2767,20 @@
|
|
2751
2767
|
</xsl:for-each>
|
2752
2768
|
</xsl:template>
|
2753
2769
|
|
2770
|
+
<xsl:param name="table_only_with_id"/><!-- Example: table1, for table auto-layout algorithm -->
|
2771
|
+
|
2772
|
+
<xsl:template match="*[local-name()='table']" priority="2">
|
2773
|
+
<xsl:choose>
|
2774
|
+
<xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
|
2775
|
+
<xsl:call-template name="table"/>
|
2776
|
+
</xsl:when>
|
2777
|
+
<xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
|
2778
|
+
<xsl:otherwise>
|
2779
|
+
<xsl:call-template name="table"/>
|
2780
|
+
</xsl:otherwise>
|
2781
|
+
</xsl:choose>
|
2782
|
+
</xsl:template>
|
2783
|
+
|
2754
2784
|
<xsl:template match="*[local-name()='table']" name="table">
|
2755
2785
|
|
2756
2786
|
<xsl:variable name="table-preamble">
|
@@ -2760,9 +2790,11 @@
|
|
2760
2790
|
<xsl:variable name="table">
|
2761
2791
|
|
2762
2792
|
<xsl:variable name="simple-table">
|
2763
|
-
<xsl:
|
2764
|
-
<xsl:
|
2765
|
-
|
2793
|
+
<xsl:if test="$isGenerateTableIF = 'true' and $isApplyAutolayoutAlgorithm = 'true'">
|
2794
|
+
<xsl:call-template name="getSimpleTable">
|
2795
|
+
<xsl:with-param name="id" select="@id"/>
|
2796
|
+
</xsl:call-template>
|
2797
|
+
</xsl:if>
|
2766
2798
|
</xsl:variable>
|
2767
2799
|
<!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
|
2768
2800
|
|
@@ -2858,9 +2890,9 @@
|
|
2858
2890
|
</xsl:attribute>
|
2859
2891
|
</xsl:for-each>
|
2860
2892
|
|
2861
|
-
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
|
2893
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'][not(@type = 'units')] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
|
2862
2894
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
2863
|
-
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute
|
2895
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
|
2864
2896
|
</xsl:if>
|
2865
2897
|
|
2866
2898
|
<xsl:choose>
|
@@ -3013,9 +3045,28 @@
|
|
3013
3045
|
|
3014
3046
|
</fo:block>
|
3015
3047
|
|
3048
|
+
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
3049
|
+
<xsl:if test="$continued = 'true'">
|
3050
|
+
<fo:block text-align="right">
|
3051
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
3052
|
+
</fo:block>
|
3053
|
+
</xsl:if>
|
3054
|
+
<!-- </xsl:if> -->
|
3055
|
+
|
3016
3056
|
</xsl:if>
|
3017
3057
|
</xsl:template> <!-- table/name -->
|
3018
3058
|
|
3059
|
+
<!-- workaround solution for https://github.com/metanorma/metanorma-iso/issues/1151#issuecomment-2033087938 -->
|
3060
|
+
<xsl:template match="*[local-name()='table']/*[local-name() = 'note'][@type = 'units']/*[local-name() = 'p']/text()" priority="4">
|
3061
|
+
<xsl:choose>
|
3062
|
+
<xsl:when test="preceding-sibling::*[local-name() = 'br']">
|
3063
|
+
<!-- remove CR or LF at start -->
|
3064
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'^( | | )', '')"/>
|
3065
|
+
</xsl:when>
|
3066
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
3067
|
+
</xsl:choose>
|
3068
|
+
</xsl:template>
|
3069
|
+
|
3019
3070
|
<!-- SOURCE: ... -->
|
3020
3071
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
|
3021
3072
|
<xsl:call-template name="termsource"/>
|
@@ -3426,7 +3477,7 @@
|
|
3426
3477
|
<xsl:param name="colwidths"/>
|
3427
3478
|
<xsl:param name="colgroup"/>
|
3428
3479
|
|
3429
|
-
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
|
3480
|
+
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
|
3430
3481
|
|
3431
3482
|
<xsl:variable name="isNoteOrFnExistShowAfterTable">
|
3432
3483
|
|
@@ -3498,7 +3549,7 @@
|
|
3498
3549
|
|
3499
3550
|
<xsl:apply-templates select="../*[local-name()='p']"/>
|
3500
3551
|
<xsl:apply-templates select="../*[local-name()='dl']"/>
|
3501
|
-
<xsl:apply-templates select="../*[local-name()='note']"/>
|
3552
|
+
<xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
|
3502
3553
|
<xsl:apply-templates select="../*[local-name()='example']"/>
|
3503
3554
|
<xsl:apply-templates select="../*[local-name()='source']"/>
|
3504
3555
|
|
@@ -3508,7 +3559,7 @@
|
|
3508
3559
|
|
3509
3560
|
<!-- horizontal row separator -->
|
3510
3561
|
<xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
|
3511
|
-
<xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
|
3562
|
+
<xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
|
3512
3563
|
<fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
|
3513
3564
|
|
3514
3565
|
<xsl:call-template name="setBordersTableArray"/>
|
@@ -4173,7 +4224,20 @@
|
|
4173
4224
|
<!-- Definition List -->
|
4174
4225
|
<!-- ===================== -->
|
4175
4226
|
|
4176
|
-
|
4227
|
+
<!-- for table auto-layout algorithm -->
|
4228
|
+
<xsl:template match="*[local-name()='dl']" priority="2">
|
4229
|
+
<xsl:choose>
|
4230
|
+
<xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
|
4231
|
+
<xsl:call-template name="dl"/>
|
4232
|
+
</xsl:when>
|
4233
|
+
<xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
|
4234
|
+
<xsl:otherwise>
|
4235
|
+
<xsl:call-template name="dl"/>
|
4236
|
+
</xsl:otherwise>
|
4237
|
+
</xsl:choose>
|
4238
|
+
</xsl:template>
|
4239
|
+
|
4240
|
+
<xsl:template match="*[local-name()='dl']" name="dl">
|
4177
4241
|
<xsl:variable name="isAdded" select="@added"/>
|
4178
4242
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
4179
4243
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
@@ -6180,7 +6244,13 @@
|
|
6180
6244
|
<xsl:value-of select="$language_current_2"/>
|
6181
6245
|
</xsl:when>
|
6182
6246
|
<xsl:otherwise>
|
6183
|
-
<xsl:
|
6247
|
+
<xsl:variable name="language_current_3" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'])"/>
|
6248
|
+
<xsl:choose>
|
6249
|
+
<xsl:when test="$language_current_3 != ''">
|
6250
|
+
<xsl:value-of select="$language_current_3"/>
|
6251
|
+
</xsl:when>
|
6252
|
+
<xsl:otherwise>en</xsl:otherwise>
|
6253
|
+
</xsl:choose>
|
6184
6254
|
</xsl:otherwise>
|
6185
6255
|
</xsl:choose>
|
6186
6256
|
</xsl:otherwise>
|
@@ -7044,10 +7114,11 @@
|
|
7044
7114
|
</xsl:template>
|
7045
7115
|
|
7046
7116
|
<xsl:template match="*[local-name() = 'image']">
|
7117
|
+
<xsl:param name="indent">0</xsl:param>
|
7047
7118
|
<xsl:variable name="isAdded" select="../@added"/>
|
7048
7119
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
7049
7120
|
<xsl:choose>
|
7050
|
-
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
7121
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']"> <!-- inline image ( 'image:path' in adoc, with one colon after image) -->
|
7051
7122
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
7052
7123
|
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
7053
7124
|
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
@@ -7056,7 +7127,43 @@
|
|
7056
7127
|
<xsl:variable name="src">
|
7057
7128
|
<xsl:call-template name="image_src"/>
|
7058
7129
|
</xsl:variable>
|
7059
|
-
|
7130
|
+
|
7131
|
+
<xsl:variable name="scale">
|
7132
|
+
<xsl:call-template name="getImageScale">
|
7133
|
+
<xsl:with-param name="indent" select="$indent"/>
|
7134
|
+
</xsl:call-template>
|
7135
|
+
</xsl:variable>
|
7136
|
+
|
7137
|
+
<!-- debug scale='<xsl:value-of select="$scale"/>', indent='<xsl:value-of select="$indent"/>' -->
|
7138
|
+
|
7139
|
+
<!-- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/> -->
|
7140
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
|
7141
|
+
|
7142
|
+
<xsl:variable name="width">
|
7143
|
+
<xsl:call-template name="setImageWidth"/>
|
7144
|
+
</xsl:variable>
|
7145
|
+
<xsl:if test="$width != ''">
|
7146
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
|
7147
|
+
</xsl:if>
|
7148
|
+
<xsl:variable name="height">
|
7149
|
+
<xsl:call-template name="setImageHeight"/>
|
7150
|
+
</xsl:variable>
|
7151
|
+
<xsl:if test="$height != ''">
|
7152
|
+
<xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
|
7153
|
+
</xsl:if>
|
7154
|
+
|
7155
|
+
<xsl:if test="$width = '' and $height = ''">
|
7156
|
+
<xsl:if test="number($scale) < 100">
|
7157
|
+
<xsl:attribute name="content-width"><xsl:value-of select="number($scale)"/>%</xsl:attribute>
|
7158
|
+
<!-- <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
|
7159
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
7160
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
7161
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute> -->
|
7162
|
+
</xsl:if>
|
7163
|
+
</xsl:if>
|
7164
|
+
|
7165
|
+
</fo:external-graphic>
|
7166
|
+
|
7060
7167
|
</fo:inline>
|
7061
7168
|
</xsl:when>
|
7062
7169
|
<xsl:otherwise>
|
@@ -7077,25 +7184,23 @@
|
|
7077
7184
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
7078
7185
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
7079
7186
|
|
7080
|
-
|
7187
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
7081
7188
|
|
7082
7189
|
</fo:instream-foreign-object>
|
7083
7190
|
</xsl:when>
|
7084
7191
|
<xsl:otherwise>
|
7192
|
+
<!-- <fo:block>debug block image:
|
7193
|
+
<xsl:variable name="scale">
|
7194
|
+
<xsl:call-template name="getImageScale">
|
7195
|
+
<xsl:with-param name="indent" select="$indent"/>
|
7196
|
+
</xsl:call-template>
|
7197
|
+
</xsl:variable>
|
7198
|
+
<xsl:value-of select="concat('scale=', $scale,', indent=', $indent)"/>
|
7199
|
+
</fo:block> -->
|
7085
7200
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
7086
|
-
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
7087
|
-
|
7088
|
-
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
7089
|
-
<xsl:attribute name="width">
|
7090
|
-
<xsl:value-of select="@width"/>
|
7091
|
-
</xsl:attribute>
|
7092
|
-
</xsl:if>
|
7201
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and (../*[local-name() = 'name'] or parent::*[local-name() = 'figure'][@unnumbered = 'true']) and not(ancestor::*[local-name() = 'table'])">
|
7093
7202
|
|
7094
|
-
<xsl:
|
7095
|
-
<xsl:attribute name="height">
|
7096
|
-
<xsl:value-of select="@height"/>
|
7097
|
-
</xsl:attribute>
|
7098
|
-
</xsl:if>
|
7203
|
+
<xsl:call-template name="setImageWidthHeight"/>
|
7099
7204
|
|
7100
7205
|
<xsl:choose>
|
7101
7206
|
<xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
|
@@ -7103,24 +7208,18 @@
|
|
7103
7208
|
</xsl:when>
|
7104
7209
|
<xsl:otherwise>
|
7105
7210
|
|
7106
|
-
<xsl:variable name="
|
7107
|
-
<xsl:
|
7108
|
-
<xsl:
|
7109
|
-
|
7110
|
-
</xsl:choose>
|
7211
|
+
<xsl:variable name="scale">
|
7212
|
+
<xsl:call-template name="getImageScale">
|
7213
|
+
<xsl:with-param name="indent" select="$indent"/>
|
7214
|
+
</xsl:call-template>
|
7111
7215
|
</xsl:variable>
|
7112
7216
|
|
7113
|
-
<xsl:variable name="
|
7114
|
-
|
7115
|
-
<xsl:value-of select="$width_effective"/>
|
7116
|
-
|
7217
|
+
<xsl:variable name="scaleRatio">
|
7218
|
+
1
|
7117
7219
|
</xsl:variable>
|
7118
7220
|
|
7119
|
-
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
7120
7221
|
<xsl:if test="number($scale) < 100">
|
7121
|
-
|
7122
|
-
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
7123
|
-
|
7222
|
+
<xsl:attribute name="content-width"><xsl:value-of select="number($scale) * number($scaleRatio)"/>%</xsl:attribute>
|
7124
7223
|
</xsl:if>
|
7125
7224
|
</xsl:otherwise>
|
7126
7225
|
</xsl:choose>
|
@@ -7136,6 +7235,62 @@
|
|
7136
7235
|
</xsl:choose>
|
7137
7236
|
</xsl:template>
|
7138
7237
|
|
7238
|
+
<xsl:template name="setImageWidth">
|
7239
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
7240
|
+
<xsl:value-of select="@width"/>
|
7241
|
+
</xsl:if>
|
7242
|
+
</xsl:template>
|
7243
|
+
<xsl:template name="setImageHeight">
|
7244
|
+
<xsl:if test="@height != '' and @height != 'auto'">
|
7245
|
+
<xsl:value-of select="@height"/>
|
7246
|
+
</xsl:if>
|
7247
|
+
</xsl:template>
|
7248
|
+
<xsl:template name="setImageWidthHeight">
|
7249
|
+
<xsl:variable name="width">
|
7250
|
+
<xsl:call-template name="setImageWidth"/>
|
7251
|
+
</xsl:variable>
|
7252
|
+
<xsl:if test="$width != ''">
|
7253
|
+
<xsl:attribute name="width">
|
7254
|
+
<xsl:value-of select="$width"/>
|
7255
|
+
</xsl:attribute>
|
7256
|
+
</xsl:if>
|
7257
|
+
<xsl:variable name="height">
|
7258
|
+
<xsl:call-template name="setImageHeight"/>
|
7259
|
+
</xsl:variable>
|
7260
|
+
<xsl:if test="$height != ''">
|
7261
|
+
<xsl:attribute name="height">
|
7262
|
+
<xsl:value-of select="$height"/>
|
7263
|
+
</xsl:attribute>
|
7264
|
+
</xsl:if>
|
7265
|
+
</xsl:template>
|
7266
|
+
|
7267
|
+
<xsl:template name="getImageScale">
|
7268
|
+
<xsl:param name="indent"/>
|
7269
|
+
<xsl:variable name="indent_left">
|
7270
|
+
<xsl:choose>
|
7271
|
+
<xsl:when test="$indent != ''"><xsl:value-of select="$indent"/></xsl:when>
|
7272
|
+
<xsl:otherwise>0</xsl:otherwise>
|
7273
|
+
</xsl:choose>
|
7274
|
+
</xsl:variable>
|
7275
|
+
<xsl:variable name="img_src">
|
7276
|
+
<xsl:choose>
|
7277
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
7278
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
7279
|
+
</xsl:choose>
|
7280
|
+
</xsl:variable>
|
7281
|
+
|
7282
|
+
<xsl:variable name="image_width_effective">
|
7283
|
+
|
7284
|
+
<xsl:value-of select="$width_effective - number($indent_left)"/>
|
7285
|
+
|
7286
|
+
</xsl:variable>
|
7287
|
+
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
7288
|
+
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
7289
|
+
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
7290
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
7291
|
+
<xsl:value-of select="$scale"/>
|
7292
|
+
</xsl:template>
|
7293
|
+
|
7139
7294
|
<xsl:template name="image_src">
|
7140
7295
|
<xsl:choose>
|
7141
7296
|
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
@@ -9811,6 +9966,7 @@
|
|
9811
9966
|
</xsl:template>
|
9812
9967
|
|
9813
9968
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
9969
|
+
<xsl:param name="indent">0</xsl:param>
|
9814
9970
|
<xsl:choose>
|
9815
9971
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
9816
9972
|
<fo:block-container role="SKIP">
|
@@ -9825,7 +9981,9 @@
|
|
9825
9981
|
|
9826
9982
|
<fo:block-container margin-left="0mm" role="SKIP">
|
9827
9983
|
<fo:block>
|
9828
|
-
<xsl:apply-templates select="." mode="list"
|
9984
|
+
<xsl:apply-templates select="." mode="list">
|
9985
|
+
<xsl:with-param name="indent" select="$indent"/>
|
9986
|
+
</xsl:apply-templates>
|
9829
9987
|
</fo:block>
|
9830
9988
|
</fo:block-container>
|
9831
9989
|
</fo:block-container>
|
@@ -9833,7 +9991,9 @@
|
|
9833
9991
|
<xsl:otherwise>
|
9834
9992
|
|
9835
9993
|
<fo:block role="SKIP">
|
9836
|
-
<xsl:apply-templates select="." mode="list"
|
9994
|
+
<xsl:apply-templates select="." mode="list">
|
9995
|
+
<xsl:with-param name="indent" select="$indent"/>
|
9996
|
+
</xsl:apply-templates>
|
9837
9997
|
</fo:block>
|
9838
9998
|
|
9839
9999
|
</xsl:otherwise>
|
@@ -9918,6 +10078,13 @@
|
|
9918
10078
|
</xsl:template>
|
9919
10079
|
|
9920
10080
|
<xsl:template match="*[local-name()='li']">
|
10081
|
+
<xsl:param name="indent">0</xsl:param>
|
10082
|
+
<!-- <fo:list-item xsl:use-attribute-sets="list-item-style">
|
10083
|
+
<fo:list-item-label end-indent="label-end()"><fo:block>x</fo:block></fo:list-item-label>
|
10084
|
+
<fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
|
10085
|
+
<fo:block>debug li indent=<xsl:value-of select="$indent"/></fo:block>
|
10086
|
+
</fo:list-item-body>
|
10087
|
+
</fo:list-item> -->
|
9921
10088
|
<fo:list-item xsl:use-attribute-sets="list-item-style">
|
9922
10089
|
<xsl:copy-of select="@id"/>
|
9923
10090
|
|
@@ -9942,7 +10109,9 @@
|
|
9942
10109
|
|
9943
10110
|
<xsl:call-template name="refine_list-item-body-style"/>
|
9944
10111
|
|
9945
|
-
<xsl:apply-templates
|
10112
|
+
<xsl:apply-templates>
|
10113
|
+
<xsl:with-param name="indent" select="$indent"/>
|
10114
|
+
</xsl:apply-templates>
|
9946
10115
|
|
9947
10116
|
<!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
|
9948
10117
|
|
@@ -12105,6 +12274,4 @@
|
|
12105
12274
|
</xsl:if>
|
12106
12275
|
</xsl:template>
|
12107
12276
|
|
12108
|
-
<!-- update -->
|
12109
|
-
|
12110
12277
|
</xsl:stylesheet>
|
@@ -20,20 +20,6 @@ module IsoDoc
|
|
20
20
|
section_break(body)
|
21
21
|
end
|
22
22
|
|
23
|
-
# def make_body2(body, docxml)
|
24
|
-
# body.div **{ class: "WordSection2" } do |div2|
|
25
|
-
# boilerplate docxml, div2
|
26
|
-
# preface_block docxml, div2
|
27
|
-
# abstract docxml, div2
|
28
|
-
# foreword docxml, div2
|
29
|
-
# introduction docxml, div2
|
30
|
-
# preface docxml, div2
|
31
|
-
# acknowledgements docxml, div2
|
32
|
-
# div2.p { |p| p << " " } # placeholder
|
33
|
-
# end
|
34
|
-
# section_break(body)
|
35
|
-
# end
|
36
|
-
|
37
23
|
def authority_cleanup(docxml)
|
38
24
|
super
|
39
25
|
docxml.xpath("//div[@class = 'boilerplate-feedback']/p").each do |p|
|
@@ -95,7 +95,7 @@
|
|
95
95
|
<text/>
|
96
96
|
</element>
|
97
97
|
</define>
|
98
|
-
<define name="
|
98
|
+
<define name="LocalizedStringAttrs">
|
99
99
|
<optional>
|
100
100
|
<!-- multiple languages and scripts possible: comma delimit them if so -->
|
101
101
|
<attribute name="language"/>
|
@@ -106,6 +106,10 @@
|
|
106
106
|
<optional>
|
107
107
|
<attribute name="script"/>
|
108
108
|
</optional>
|
109
|
+
</define>
|
110
|
+
<define name="LocalizedString1">
|
111
|
+
<!-- multiple languages and scripts possible: comma delimit them if so -->
|
112
|
+
<ref name="LocalizedStringAttrs"/>
|
109
113
|
<text/>
|
110
114
|
</define>
|
111
115
|
<define name="LocalizedString">
|
@@ -142,16 +146,8 @@
|
|
142
146
|
<ref name="LocalizedStringOrXsAny"/>
|
143
147
|
</define>
|
144
148
|
<define name="LocalizedStringOrXsAny1">
|
145
|
-
|
146
|
-
|
147
|
-
<attribute name="language"/>
|
148
|
-
</optional>
|
149
|
-
<optional>
|
150
|
-
<attribute name="locale"/>
|
151
|
-
</optional>
|
152
|
-
<optional>
|
153
|
-
<attribute name="script"/>
|
154
|
-
</optional>
|
149
|
+
<!-- multiple languages and scripts possible: comma delimit them if so -->
|
150
|
+
<ref name="LocalizedStringAttrs"/>
|
155
151
|
<oneOrMore>
|
156
152
|
<choice>
|
157
153
|
<text/>
|
@@ -208,6 +204,7 @@
|
|
208
204
|
</define>
|
209
205
|
<define name="roledescription">
|
210
206
|
<element name="description">
|
207
|
+
<ref name="LocalizedStringAttrs"/>
|
211
208
|
<oneOrMore>
|
212
209
|
<ref name="TextElement"/>
|
213
210
|
</oneOrMore>
|
@@ -335,6 +332,7 @@
|
|
335
332
|
</define>
|
336
333
|
<define name="affiliationdescription">
|
337
334
|
<element name="description">
|
335
|
+
<ref name="LocalizedStringAttrs"/>
|
338
336
|
<oneOrMore>
|
339
337
|
<ref name="TextElement"/>
|
340
338
|
</oneOrMore>
|
@@ -948,6 +946,7 @@
|
|
948
946
|
<optional>
|
949
947
|
<attribute name="type"/>
|
950
948
|
</optional>
|
949
|
+
<ref name="LocalizedStringAttrs"/>
|
951
950
|
<zeroOrMore>
|
952
951
|
<ref name="TextElement"/>
|
953
952
|
</zeroOrMore>
|
@@ -1041,15 +1040,7 @@
|
|
1041
1040
|
<data type="boolean"/>
|
1042
1041
|
</attribute>
|
1043
1042
|
</optional>
|
1044
|
-
<
|
1045
|
-
<attribute name="language"/>
|
1046
|
-
</optional>
|
1047
|
-
<optional>
|
1048
|
-
<attribute name="locale"/>
|
1049
|
-
</optional>
|
1050
|
-
<optional>
|
1051
|
-
<attribute name="script"/>
|
1052
|
-
</optional>
|
1043
|
+
<ref name="LocalizedStringAttrs"/>
|
1053
1044
|
<oneOrMore>
|
1054
1045
|
<ref name="TextElement"/>
|
1055
1046
|
</oneOrMore>
|
@@ -1277,6 +1268,7 @@
|
|
1277
1268
|
<optional>
|
1278
1269
|
<attribute name="type"/>
|
1279
1270
|
</optional>
|
1271
|
+
<ref name="LocalizedStringAttrs"/>
|
1280
1272
|
<oneOrMore>
|
1281
1273
|
<ref name="TextElement"/>
|
1282
1274
|
</oneOrMore>
|
@@ -1284,9 +1276,15 @@
|
|
1284
1276
|
</define>
|
1285
1277
|
<define name="bibabstract">
|
1286
1278
|
<element name="abstract">
|
1287
|
-
<
|
1288
|
-
|
1289
|
-
|
1279
|
+
<ref name="LocalizedStringAttrs"/>
|
1280
|
+
<choice>
|
1281
|
+
<oneOrMore>
|
1282
|
+
<ref name="BasicBlock"/>
|
1283
|
+
</oneOrMore>
|
1284
|
+
<oneOrMore>
|
1285
|
+
<ref name="TextElement"/>
|
1286
|
+
</oneOrMore>
|
1287
|
+
</choice>
|
1290
1288
|
</element>
|
1291
1289
|
</define>
|
1292
1290
|
<define name="copyright">
|
@@ -1391,6 +1389,7 @@
|
|
1391
1389
|
</attribute>
|
1392
1390
|
<optional>
|
1393
1391
|
<element name="description">
|
1392
|
+
<ref name="LocalizedStringAttrs"/>
|
1394
1393
|
<oneOrMore>
|
1395
1394
|
<ref name="TextElement"/>
|
1396
1395
|
</oneOrMore>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.3.
|
20
|
+
<!-- VERSION v1.3.1 -->
|
21
21
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
22
22
|
<include href="reqt.rng"/>
|
23
23
|
<include href="basicdoc.rng">
|
@@ -1346,38 +1346,41 @@
|
|
1346
1346
|
</oneOrMore>
|
1347
1347
|
</element>
|
1348
1348
|
</define>
|
1349
|
+
<define name="Section-Attributes">
|
1350
|
+
<optional>
|
1351
|
+
<attribute name="id">
|
1352
|
+
<data type="ID"/>
|
1353
|
+
</attribute>
|
1354
|
+
</optional>
|
1355
|
+
<optional>
|
1356
|
+
<attribute name="language"/>
|
1357
|
+
</optional>
|
1358
|
+
<optional>
|
1359
|
+
<attribute name="script"/>
|
1360
|
+
</optional>
|
1361
|
+
<optional>
|
1362
|
+
<attribute name="inline-header">
|
1363
|
+
<data type="boolean"/>
|
1364
|
+
</attribute>
|
1365
|
+
</optional>
|
1366
|
+
<optional>
|
1367
|
+
<attribute name="number"/>
|
1368
|
+
</optional>
|
1369
|
+
<optional>
|
1370
|
+
<attribute name="branch-number"/>
|
1371
|
+
</optional>
|
1372
|
+
<optional>
|
1373
|
+
<attribute name="obligation">
|
1374
|
+
<choice>
|
1375
|
+
<value>normative</value>
|
1376
|
+
<value>informative</value>
|
1377
|
+
</choice>
|
1378
|
+
</attribute>
|
1379
|
+
</optional>
|
1380
|
+
</define>
|
1349
1381
|
<define name="reference-clause">
|
1350
1382
|
<element name="clause">
|
1351
|
-
<
|
1352
|
-
<attribute name="id">
|
1353
|
-
<data type="ID"/>
|
1354
|
-
</attribute>
|
1355
|
-
</optional>
|
1356
|
-
<optional>
|
1357
|
-
<attribute name="language"/>
|
1358
|
-
</optional>
|
1359
|
-
<optional>
|
1360
|
-
<attribute name="script"/>
|
1361
|
-
</optional>
|
1362
|
-
<optional>
|
1363
|
-
<attribute name="inline-header">
|
1364
|
-
<data type="boolean"/>
|
1365
|
-
</attribute>
|
1366
|
-
</optional>
|
1367
|
-
<optional>
|
1368
|
-
<attribute name="number"/>
|
1369
|
-
</optional>
|
1370
|
-
<optional>
|
1371
|
-
<attribute name="branch-number"/>
|
1372
|
-
</optional>
|
1373
|
-
<optional>
|
1374
|
-
<attribute name="obligation">
|
1375
|
-
<choice>
|
1376
|
-
<value>normative</value>
|
1377
|
-
<value>informative</value>
|
1378
|
-
</choice>
|
1379
|
-
</attribute>
|
1380
|
-
</optional>
|
1383
|
+
<ref name="Section-Attributes"/>
|
1381
1384
|
<optional>
|
1382
1385
|
<ref name="section-title"/>
|
1383
1386
|
</optional>
|
@@ -1566,36 +1569,7 @@
|
|
1566
1569
|
</element>
|
1567
1570
|
</define>
|
1568
1571
|
<define name="Content-Section">
|
1569
|
-
<
|
1570
|
-
<attribute name="id">
|
1571
|
-
<data type="ID"/>
|
1572
|
-
</attribute>
|
1573
|
-
</optional>
|
1574
|
-
<optional>
|
1575
|
-
<attribute name="language"/>
|
1576
|
-
</optional>
|
1577
|
-
<optional>
|
1578
|
-
<attribute name="script"/>
|
1579
|
-
</optional>
|
1580
|
-
<optional>
|
1581
|
-
<attribute name="inline-header">
|
1582
|
-
<data type="boolean"/>
|
1583
|
-
</attribute>
|
1584
|
-
</optional>
|
1585
|
-
<optional>
|
1586
|
-
<attribute name="obligation">
|
1587
|
-
<choice>
|
1588
|
-
<value>normative</value>
|
1589
|
-
<value>informative</value>
|
1590
|
-
</choice>
|
1591
|
-
</attribute>
|
1592
|
-
</optional>
|
1593
|
-
<optional>
|
1594
|
-
<attribute name="number"/>
|
1595
|
-
</optional>
|
1596
|
-
<optional>
|
1597
|
-
<attribute name="branch-number"/>
|
1598
|
-
</optional>
|
1572
|
+
<ref name="Section-Attributes"/>
|
1599
1573
|
<optional>
|
1600
1574
|
<attribute name="type"/>
|
1601
1575
|
</optional>
|
@@ -1617,39 +1591,10 @@
|
|
1617
1591
|
</element>
|
1618
1592
|
</define>
|
1619
1593
|
<define name="Clause-Section">
|
1620
|
-
<
|
1621
|
-
<attribute name="id">
|
1622
|
-
<data type="ID"/>
|
1623
|
-
</attribute>
|
1624
|
-
</optional>
|
1625
|
-
<optional>
|
1626
|
-
<attribute name="language"/>
|
1627
|
-
</optional>
|
1628
|
-
<optional>
|
1629
|
-
<attribute name="script"/>
|
1630
|
-
</optional>
|
1631
|
-
<optional>
|
1632
|
-
<attribute name="inline-header">
|
1633
|
-
<data type="boolean"/>
|
1634
|
-
</attribute>
|
1635
|
-
</optional>
|
1636
|
-
<optional>
|
1637
|
-
<attribute name="obligation">
|
1638
|
-
<choice>
|
1639
|
-
<value>normative</value>
|
1640
|
-
<value>informative</value>
|
1641
|
-
</choice>
|
1642
|
-
</attribute>
|
1643
|
-
</optional>
|
1594
|
+
<ref name="Section-Attributes"/>
|
1644
1595
|
<optional>
|
1645
1596
|
<attribute name="type"/>
|
1646
1597
|
</optional>
|
1647
|
-
<optional>
|
1648
|
-
<attribute name="number"/>
|
1649
|
-
</optional>
|
1650
|
-
<optional>
|
1651
|
-
<attribute name="branch-number"/>
|
1652
|
-
</optional>
|
1653
1598
|
<optional>
|
1654
1599
|
<ref name="section-title"/>
|
1655
1600
|
</optional>
|
@@ -1730,34 +1675,10 @@
|
|
1730
1675
|
</define>
|
1731
1676
|
<define name="terms">
|
1732
1677
|
<element name="terms">
|
1733
|
-
<
|
1734
|
-
<attribute name="id">
|
1735
|
-
<data type="ID"/>
|
1736
|
-
</attribute>
|
1737
|
-
</optional>
|
1738
|
-
<optional>
|
1739
|
-
<attribute name="language"/>
|
1740
|
-
</optional>
|
1741
|
-
<optional>
|
1742
|
-
<attribute name="script"/>
|
1743
|
-
</optional>
|
1678
|
+
<ref name="Section-Attributes"/>
|
1744
1679
|
<optional>
|
1745
1680
|
<attribute name="type"/>
|
1746
1681
|
</optional>
|
1747
|
-
<optional>
|
1748
|
-
<attribute name="number"/>
|
1749
|
-
</optional>
|
1750
|
-
<optional>
|
1751
|
-
<attribute name="branch-number"/>
|
1752
|
-
</optional>
|
1753
|
-
<optional>
|
1754
|
-
<attribute name="obligation">
|
1755
|
-
<choice>
|
1756
|
-
<value>normative</value>
|
1757
|
-
<value>informative</value>
|
1758
|
-
</choice>
|
1759
|
-
</attribute>
|
1760
|
-
</optional>
|
1761
1682
|
<optional>
|
1762
1683
|
<ref name="section-title"/>
|
1763
1684
|
</optional>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|