metanorma-itu 2.4.5 → 2.4.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/itu/itu.implementers-guide.xsl +220 -53
- data/lib/isodoc/itu/itu.in-force.xsl +220 -53
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +220 -53
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +220 -53
- data/lib/isodoc/itu/itu.recommendation.xsl +220 -53
- data/lib/isodoc/itu/itu.resolution.xsl +220 -53
- data/lib/isodoc/itu/itu.service-publication.xsl +220 -53
- data/lib/isodoc/itu/itu.technical-paper.xsl +220 -53
- data/lib/isodoc/itu/itu.technical-report.xsl +220 -53
- data/lib/isodoc/itu/word_cleanup.rb +21 -12
- data/lib/metanorma/itu/biblio.rng +22 -23
- data/lib/metanorma/itu/isodoc.rng +37 -116
- data/lib/metanorma/itu/version.rb +1 -1
- data/metanorma-itu.gemspec +1 -1
- metadata +3 -3
@@ -2747,17 +2747,30 @@
|
|
2747
2747
|
<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 -->
|
2748
2748
|
|
2749
2749
|
<xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm -->
|
2750
|
-
<xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
|
2750
|
+
<xsl:param name="table_widths"/> <!-- (debug: path to) xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
|
2751
2751
|
<!-- Example: <tables>
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
|
2760
|
-
|
2752
|
+
<table page-width="509103" id="table1" width_max="223561" width_min="223560">
|
2753
|
+
<column width_max="39354" width_min="39354"/>
|
2754
|
+
<column width_max="75394" width_min="75394"/>
|
2755
|
+
<column width_max="108813" width_min="108813"/>
|
2756
|
+
<tbody>
|
2757
|
+
<tr>
|
2758
|
+
<td width_max="39354" width_min="39354">
|
2759
|
+
<p_len>39354</p_len>
|
2760
|
+
<word_len>39354</word_len>
|
2761
|
+
</td>
|
2762
|
+
|
2763
|
+
OLD:
|
2764
|
+
<tables>
|
2765
|
+
<table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
|
2766
|
+
<tbody>
|
2767
|
+
<tr>
|
2768
|
+
<td id="tab-symdu_1_1">
|
2769
|
+
<p_len>6</p_len>
|
2770
|
+
<p_len>100</p_len> for 2nd paragraph
|
2771
|
+
<word_len>6</word_len>
|
2772
|
+
<word_len>20</word_len>
|
2773
|
+
...
|
2761
2774
|
-->
|
2762
2775
|
|
2763
2776
|
<!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> -->
|
@@ -2977,6 +2990,9 @@
|
|
2977
2990
|
<xsl:variable name="hair_space"> </xsl:variable>
|
2978
2991
|
<xsl:variable name="en_dash">–</xsl:variable>
|
2979
2992
|
<xsl:variable name="em_dash">—</xsl:variable>
|
2993
|
+
<xsl:variable name="cr"> </xsl:variable>
|
2994
|
+
<xsl:variable name="lf">
|
2995
|
+
</xsl:variable>
|
2980
2996
|
|
2981
2997
|
<xsl:template name="getTitle">
|
2982
2998
|
<xsl:param name="name"/>
|
@@ -4670,6 +4686,20 @@
|
|
4670
4686
|
</xsl:for-each>
|
4671
4687
|
</xsl:template>
|
4672
4688
|
|
4689
|
+
<xsl:param name="table_only_with_id"/><!-- Example: table1, for table auto-layout algorithm -->
|
4690
|
+
|
4691
|
+
<xsl:template match="*[local-name()='table']" priority="2">
|
4692
|
+
<xsl:choose>
|
4693
|
+
<xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
|
4694
|
+
<xsl:call-template name="table"/>
|
4695
|
+
</xsl:when>
|
4696
|
+
<xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
|
4697
|
+
<xsl:otherwise>
|
4698
|
+
<xsl:call-template name="table"/>
|
4699
|
+
</xsl:otherwise>
|
4700
|
+
</xsl:choose>
|
4701
|
+
</xsl:template>
|
4702
|
+
|
4673
4703
|
<xsl:template match="*[local-name()='table']" name="table">
|
4674
4704
|
|
4675
4705
|
<xsl:variable name="table-preamble">
|
@@ -4683,9 +4713,11 @@
|
|
4683
4713
|
<xsl:variable name="table">
|
4684
4714
|
|
4685
4715
|
<xsl:variable name="simple-table">
|
4686
|
-
<xsl:
|
4687
|
-
<xsl:
|
4688
|
-
|
4716
|
+
<xsl:if test="$isGenerateTableIF = 'true' and $isApplyAutolayoutAlgorithm = 'true'">
|
4717
|
+
<xsl:call-template name="getSimpleTable">
|
4718
|
+
<xsl:with-param name="id" select="@id"/>
|
4719
|
+
</xsl:call-template>
|
4720
|
+
</xsl:if>
|
4689
4721
|
</xsl:variable>
|
4690
4722
|
<!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
|
4691
4723
|
|
@@ -4781,9 +4813,9 @@
|
|
4781
4813
|
</xsl:attribute>
|
4782
4814
|
</xsl:for-each>
|
4783
4815
|
|
4784
|
-
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
|
4816
|
+
<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']"/>
|
4785
4817
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
4786
|
-
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute
|
4818
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
|
4787
4819
|
</xsl:if>
|
4788
4820
|
|
4789
4821
|
<xsl:choose>
|
@@ -4936,9 +4968,28 @@
|
|
4936
4968
|
|
4937
4969
|
</fo:block>
|
4938
4970
|
|
4971
|
+
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
4972
|
+
<xsl:if test="$continued = 'true'">
|
4973
|
+
<fo:block text-align="right">
|
4974
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
4975
|
+
</fo:block>
|
4976
|
+
</xsl:if>
|
4977
|
+
<!-- </xsl:if> -->
|
4978
|
+
|
4939
4979
|
</xsl:if>
|
4940
4980
|
</xsl:template> <!-- table/name -->
|
4941
4981
|
|
4982
|
+
<!-- workaround solution for https://github.com/metanorma/metanorma-iso/issues/1151#issuecomment-2033087938 -->
|
4983
|
+
<xsl:template match="*[local-name()='table']/*[local-name() = 'note'][@type = 'units']/*[local-name() = 'p']/text()" priority="4">
|
4984
|
+
<xsl:choose>
|
4985
|
+
<xsl:when test="preceding-sibling::*[local-name() = 'br']">
|
4986
|
+
<!-- remove CR or LF at start -->
|
4987
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'^( | | )', '')"/>
|
4988
|
+
</xsl:when>
|
4989
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
4990
|
+
</xsl:choose>
|
4991
|
+
</xsl:template>
|
4992
|
+
|
4942
4993
|
<!-- SOURCE: ... -->
|
4943
4994
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
|
4944
4995
|
<xsl:call-template name="termsource"/>
|
@@ -5349,7 +5400,7 @@
|
|
5349
5400
|
<xsl:param name="colwidths"/>
|
5350
5401
|
<xsl:param name="colgroup"/>
|
5351
5402
|
|
5352
|
-
<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']"/>
|
5403
|
+
<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']"/>
|
5353
5404
|
|
5354
5405
|
<xsl:variable name="isNoteOrFnExistShowAfterTable">
|
5355
5406
|
|
@@ -5431,7 +5482,7 @@
|
|
5431
5482
|
|
5432
5483
|
<xsl:apply-templates select="../*[local-name()='p']"/>
|
5433
5484
|
<xsl:apply-templates select="../*[local-name()='dl']"/>
|
5434
|
-
<xsl:apply-templates select="../*[local-name()='note']"/>
|
5485
|
+
<xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
|
5435
5486
|
<xsl:apply-templates select="../*[local-name()='example']"/>
|
5436
5487
|
<xsl:apply-templates select="../*[local-name()='source']"/>
|
5437
5488
|
|
@@ -5441,7 +5492,7 @@
|
|
5441
5492
|
|
5442
5493
|
<!-- horizontal row separator -->
|
5443
5494
|
<xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
|
5444
|
-
<xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
|
5495
|
+
<xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
|
5445
5496
|
<fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
|
5446
5497
|
|
5447
5498
|
<xsl:call-template name="setBordersTableArray"/>
|
@@ -6150,7 +6201,20 @@
|
|
6150
6201
|
</xsl:element>
|
6151
6202
|
</xsl:template>
|
6152
6203
|
|
6153
|
-
|
6204
|
+
<!-- for table auto-layout algorithm -->
|
6205
|
+
<xsl:template match="*[local-name()='dl']" priority="2">
|
6206
|
+
<xsl:choose>
|
6207
|
+
<xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
|
6208
|
+
<xsl:call-template name="dl"/>
|
6209
|
+
</xsl:when>
|
6210
|
+
<xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
|
6211
|
+
<xsl:otherwise>
|
6212
|
+
<xsl:call-template name="dl"/>
|
6213
|
+
</xsl:otherwise>
|
6214
|
+
</xsl:choose>
|
6215
|
+
</xsl:template>
|
6216
|
+
|
6217
|
+
<xsl:template match="*[local-name()='dl']" name="dl">
|
6154
6218
|
<xsl:variable name="isAdded" select="@added"/>
|
6155
6219
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
6156
6220
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
@@ -8091,7 +8155,13 @@
|
|
8091
8155
|
<xsl:value-of select="$language_current_2"/>
|
8092
8156
|
</xsl:when>
|
8093
8157
|
<xsl:otherwise>
|
8094
|
-
<xsl:
|
8158
|
+
<xsl:variable name="language_current_3" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'])"/>
|
8159
|
+
<xsl:choose>
|
8160
|
+
<xsl:when test="$language_current_3 != ''">
|
8161
|
+
<xsl:value-of select="$language_current_3"/>
|
8162
|
+
</xsl:when>
|
8163
|
+
<xsl:otherwise>en</xsl:otherwise>
|
8164
|
+
</xsl:choose>
|
8095
8165
|
</xsl:otherwise>
|
8096
8166
|
</xsl:choose>
|
8097
8167
|
</xsl:otherwise>
|
@@ -8961,10 +9031,11 @@
|
|
8961
9031
|
</xsl:template>
|
8962
9032
|
|
8963
9033
|
<xsl:template match="*[local-name() = 'image']">
|
9034
|
+
<xsl:param name="indent">0</xsl:param>
|
8964
9035
|
<xsl:variable name="isAdded" select="../@added"/>
|
8965
9036
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
8966
9037
|
<xsl:choose>
|
8967
|
-
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
9038
|
+
<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) -->
|
8968
9039
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
8969
9040
|
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
8970
9041
|
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
@@ -8973,7 +9044,43 @@
|
|
8973
9044
|
<xsl:variable name="src">
|
8974
9045
|
<xsl:call-template name="image_src"/>
|
8975
9046
|
</xsl:variable>
|
8976
|
-
|
9047
|
+
|
9048
|
+
<xsl:variable name="scale">
|
9049
|
+
<xsl:call-template name="getImageScale">
|
9050
|
+
<xsl:with-param name="indent" select="$indent"/>
|
9051
|
+
</xsl:call-template>
|
9052
|
+
</xsl:variable>
|
9053
|
+
|
9054
|
+
<!-- debug scale='<xsl:value-of select="$scale"/>', indent='<xsl:value-of select="$indent"/>' -->
|
9055
|
+
|
9056
|
+
<!-- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/> -->
|
9057
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
|
9058
|
+
|
9059
|
+
<xsl:variable name="width">
|
9060
|
+
<xsl:call-template name="setImageWidth"/>
|
9061
|
+
</xsl:variable>
|
9062
|
+
<xsl:if test="$width != ''">
|
9063
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
|
9064
|
+
</xsl:if>
|
9065
|
+
<xsl:variable name="height">
|
9066
|
+
<xsl:call-template name="setImageHeight"/>
|
9067
|
+
</xsl:variable>
|
9068
|
+
<xsl:if test="$height != ''">
|
9069
|
+
<xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
|
9070
|
+
</xsl:if>
|
9071
|
+
|
9072
|
+
<xsl:if test="$width = '' and $height = ''">
|
9073
|
+
<xsl:if test="number($scale) < 100">
|
9074
|
+
<xsl:attribute name="content-width"><xsl:value-of select="number($scale)"/>%</xsl:attribute>
|
9075
|
+
<!-- <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
|
9076
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
9077
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
9078
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute> -->
|
9079
|
+
</xsl:if>
|
9080
|
+
</xsl:if>
|
9081
|
+
|
9082
|
+
</fo:external-graphic>
|
9083
|
+
|
8977
9084
|
</fo:inline>
|
8978
9085
|
</xsl:when>
|
8979
9086
|
<xsl:otherwise>
|
@@ -8994,25 +9101,23 @@
|
|
8994
9101
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
8995
9102
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
8996
9103
|
|
8997
|
-
|
9104
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
8998
9105
|
|
8999
9106
|
</fo:instream-foreign-object>
|
9000
9107
|
</xsl:when>
|
9001
9108
|
<xsl:otherwise>
|
9109
|
+
<!-- <fo:block>debug block image:
|
9110
|
+
<xsl:variable name="scale">
|
9111
|
+
<xsl:call-template name="getImageScale">
|
9112
|
+
<xsl:with-param name="indent" select="$indent"/>
|
9113
|
+
</xsl:call-template>
|
9114
|
+
</xsl:variable>
|
9115
|
+
<xsl:value-of select="concat('scale=', $scale,', indent=', $indent)"/>
|
9116
|
+
</fo:block> -->
|
9002
9117
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
9003
|
-
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
9118
|
+
<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'])">
|
9004
9119
|
|
9005
|
-
<xsl:
|
9006
|
-
<xsl:attribute name="width">
|
9007
|
-
<xsl:value-of select="@width"/>
|
9008
|
-
</xsl:attribute>
|
9009
|
-
</xsl:if>
|
9010
|
-
|
9011
|
-
<xsl:if test="@height != '' and @height != 'auto'">
|
9012
|
-
<xsl:attribute name="height">
|
9013
|
-
<xsl:value-of select="@height"/>
|
9014
|
-
</xsl:attribute>
|
9015
|
-
</xsl:if>
|
9120
|
+
<xsl:call-template name="setImageWidthHeight"/>
|
9016
9121
|
|
9017
9122
|
<xsl:choose>
|
9018
9123
|
<xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
|
@@ -9020,24 +9125,18 @@
|
|
9020
9125
|
</xsl:when>
|
9021
9126
|
<xsl:otherwise>
|
9022
9127
|
|
9023
|
-
<xsl:variable name="
|
9024
|
-
<xsl:
|
9025
|
-
<xsl:
|
9026
|
-
|
9027
|
-
</xsl:choose>
|
9128
|
+
<xsl:variable name="scale">
|
9129
|
+
<xsl:call-template name="getImageScale">
|
9130
|
+
<xsl:with-param name="indent" select="$indent"/>
|
9131
|
+
</xsl:call-template>
|
9028
9132
|
</xsl:variable>
|
9029
9133
|
|
9030
|
-
<xsl:variable name="
|
9031
|
-
|
9032
|
-
<xsl:value-of select="$width_effective"/>
|
9033
|
-
|
9134
|
+
<xsl:variable name="scaleRatio">
|
9135
|
+
1
|
9034
9136
|
</xsl:variable>
|
9035
9137
|
|
9036
|
-
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
9037
9138
|
<xsl:if test="number($scale) < 100">
|
9038
|
-
|
9039
|
-
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
9040
|
-
|
9139
|
+
<xsl:attribute name="content-width"><xsl:value-of select="number($scale) * number($scaleRatio)"/>%</xsl:attribute>
|
9041
9140
|
</xsl:if>
|
9042
9141
|
</xsl:otherwise>
|
9043
9142
|
</xsl:choose>
|
@@ -9053,6 +9152,62 @@
|
|
9053
9152
|
</xsl:choose>
|
9054
9153
|
</xsl:template>
|
9055
9154
|
|
9155
|
+
<xsl:template name="setImageWidth">
|
9156
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
9157
|
+
<xsl:value-of select="@width"/>
|
9158
|
+
</xsl:if>
|
9159
|
+
</xsl:template>
|
9160
|
+
<xsl:template name="setImageHeight">
|
9161
|
+
<xsl:if test="@height != '' and @height != 'auto'">
|
9162
|
+
<xsl:value-of select="@height"/>
|
9163
|
+
</xsl:if>
|
9164
|
+
</xsl:template>
|
9165
|
+
<xsl:template name="setImageWidthHeight">
|
9166
|
+
<xsl:variable name="width">
|
9167
|
+
<xsl:call-template name="setImageWidth"/>
|
9168
|
+
</xsl:variable>
|
9169
|
+
<xsl:if test="$width != ''">
|
9170
|
+
<xsl:attribute name="width">
|
9171
|
+
<xsl:value-of select="$width"/>
|
9172
|
+
</xsl:attribute>
|
9173
|
+
</xsl:if>
|
9174
|
+
<xsl:variable name="height">
|
9175
|
+
<xsl:call-template name="setImageHeight"/>
|
9176
|
+
</xsl:variable>
|
9177
|
+
<xsl:if test="$height != ''">
|
9178
|
+
<xsl:attribute name="height">
|
9179
|
+
<xsl:value-of select="$height"/>
|
9180
|
+
</xsl:attribute>
|
9181
|
+
</xsl:if>
|
9182
|
+
</xsl:template>
|
9183
|
+
|
9184
|
+
<xsl:template name="getImageScale">
|
9185
|
+
<xsl:param name="indent"/>
|
9186
|
+
<xsl:variable name="indent_left">
|
9187
|
+
<xsl:choose>
|
9188
|
+
<xsl:when test="$indent != ''"><xsl:value-of select="$indent"/></xsl:when>
|
9189
|
+
<xsl:otherwise>0</xsl:otherwise>
|
9190
|
+
</xsl:choose>
|
9191
|
+
</xsl:variable>
|
9192
|
+
<xsl:variable name="img_src">
|
9193
|
+
<xsl:choose>
|
9194
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
9195
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
9196
|
+
</xsl:choose>
|
9197
|
+
</xsl:variable>
|
9198
|
+
|
9199
|
+
<xsl:variable name="image_width_effective">
|
9200
|
+
|
9201
|
+
<xsl:value-of select="$width_effective - number($indent_left)"/>
|
9202
|
+
|
9203
|
+
</xsl:variable>
|
9204
|
+
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
9205
|
+
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
9206
|
+
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
9207
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
9208
|
+
<xsl:value-of select="$scale"/>
|
9209
|
+
</xsl:template>
|
9210
|
+
|
9056
9211
|
<xsl:template name="image_src">
|
9057
9212
|
<xsl:choose>
|
9058
9213
|
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
@@ -11738,6 +11893,7 @@
|
|
11738
11893
|
</xsl:template>
|
11739
11894
|
|
11740
11895
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
11896
|
+
<xsl:param name="indent">0</xsl:param>
|
11741
11897
|
<xsl:choose>
|
11742
11898
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
11743
11899
|
<fo:block-container role="SKIP">
|
@@ -11752,7 +11908,9 @@
|
|
11752
11908
|
|
11753
11909
|
<fo:block-container margin-left="0mm" role="SKIP">
|
11754
11910
|
<fo:block>
|
11755
|
-
<xsl:apply-templates select="." mode="list"
|
11911
|
+
<xsl:apply-templates select="." mode="list">
|
11912
|
+
<xsl:with-param name="indent" select="$indent"/>
|
11913
|
+
</xsl:apply-templates>
|
11756
11914
|
</fo:block>
|
11757
11915
|
</fo:block-container>
|
11758
11916
|
</fo:block-container>
|
@@ -11760,7 +11918,9 @@
|
|
11760
11918
|
<xsl:otherwise>
|
11761
11919
|
|
11762
11920
|
<fo:block role="SKIP">
|
11763
|
-
<xsl:apply-templates select="." mode="list"
|
11921
|
+
<xsl:apply-templates select="." mode="list">
|
11922
|
+
<xsl:with-param name="indent" select="$indent"/>
|
11923
|
+
</xsl:apply-templates>
|
11764
11924
|
</fo:block>
|
11765
11925
|
|
11766
11926
|
</xsl:otherwise>
|
@@ -11845,6 +12005,13 @@
|
|
11845
12005
|
</xsl:template>
|
11846
12006
|
|
11847
12007
|
<xsl:template match="*[local-name()='li']">
|
12008
|
+
<xsl:param name="indent">0</xsl:param>
|
12009
|
+
<!-- <fo:list-item xsl:use-attribute-sets="list-item-style">
|
12010
|
+
<fo:list-item-label end-indent="label-end()"><fo:block>x</fo:block></fo:list-item-label>
|
12011
|
+
<fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
|
12012
|
+
<fo:block>debug li indent=<xsl:value-of select="$indent"/></fo:block>
|
12013
|
+
</fo:list-item-body>
|
12014
|
+
</fo:list-item> -->
|
11848
12015
|
<fo:list-item xsl:use-attribute-sets="list-item-style">
|
11849
12016
|
<xsl:copy-of select="@id"/>
|
11850
12017
|
|
@@ -11869,7 +12036,9 @@
|
|
11869
12036
|
|
11870
12037
|
<xsl:call-template name="refine_list-item-body-style"/>
|
11871
12038
|
|
11872
|
-
<xsl:apply-templates
|
12039
|
+
<xsl:apply-templates>
|
12040
|
+
<xsl:with-param name="indent" select="$indent"/>
|
12041
|
+
</xsl:apply-templates>
|
11873
12042
|
|
11874
12043
|
<!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
|
11875
12044
|
|
@@ -14058,6 +14227,4 @@
|
|
14058
14227
|
</xsl:if>
|
14059
14228
|
</xsl:template>
|
14060
14229
|
|
14061
|
-
<!-- update -->
|
14062
|
-
|
14063
14230
|
</xsl:stylesheet>
|
@@ -4,9 +4,9 @@ module IsoDoc
|
|
4
4
|
def word_preface_cleanup(docxml)
|
5
5
|
docxml.xpath("//h1[@class = 'AbstractTitle'] | "\
|
6
6
|
"//h1[@class = 'IntroTitle']").each do |h2|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
h2.name = "p"
|
8
|
+
h2["class"] = "h1Preface"
|
9
|
+
end
|
10
10
|
end
|
11
11
|
|
12
12
|
def word_term_cleanup(docxml); end
|
@@ -68,23 +68,32 @@ module IsoDoc
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def toWord(result, filename, dir, header)
|
71
|
+
Html2Doc.new(
|
72
|
+
filename: filename, imagedir: @localdir,
|
73
|
+
stylesheet: @wordstylesheet&.path,
|
74
|
+
header_file: header&.path, dir: dir,
|
75
|
+
asciimathdelims: [@openmathdelim, @closemathdelim],
|
76
|
+
liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" }
|
77
|
+
).process(result)
|
78
|
+
header&.unlink
|
79
|
+
@wordstylesheet&.unlink if @wordstylesheet.is_a?(Tempfile)
|
80
|
+
end
|
81
|
+
|
82
|
+
def postprocess_cleanup(result)
|
83
|
+
result = from_xhtml(cleanup(to_xhtml(textcleanup(result))))
|
71
84
|
result = populate_template(result, :word)
|
72
85
|
result = from_xhtml(word_cleanup(to_xhtml(result)))
|
73
86
|
.gsub(/-DOUBLE_HYPHEN_ESCAPE-/, "--")
|
87
|
+
end
|
88
|
+
|
89
|
+
def wordstylesheet_update
|
90
|
+
super
|
74
91
|
unless @landscapestyle.nil? || @landscapestyle.empty?
|
75
92
|
@wordstylesheet&.open
|
76
93
|
@wordstylesheet&.write(@landscapestyle)
|
77
94
|
@wordstylesheet&.close
|
78
95
|
end
|
79
|
-
|
80
|
-
filename: filename,
|
81
|
-
stylesheet: @wordstylesheet&.path,
|
82
|
-
header_file: header&.path, dir: dir,
|
83
|
-
asciimathdelims: [@openmathdelim, @closemathdelim],
|
84
|
-
liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" }
|
85
|
-
).process(result)
|
86
|
-
header&.unlink
|
87
|
-
@wordstylesheet&.unlink
|
96
|
+
@wordstylesheet
|
88
97
|
end
|
89
98
|
|
90
99
|
def authority_hdr_cleanup(docxml)
|
@@ -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>
|