metanorma-ogc 2.3.2 → 2.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ogc/base_convert.rb +11 -11
- data/lib/isodoc/ogc/html/htmlstyle.css +4 -0
- data/lib/isodoc/ogc/html/htmlstyle.scss +6 -0
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +166 -55
- data/lib/isodoc/ogc/ogc.best-practice.xsl +166 -55
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +166 -55
- data/lib/isodoc/ogc/ogc.community-practice.xsl +166 -55
- data/lib/isodoc/ogc/ogc.community-standard.xsl +166 -55
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +166 -55
- data/lib/isodoc/ogc/ogc.draft-standard.xsl +166 -55
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +166 -55
- data/lib/isodoc/ogc/ogc.other.xsl +166 -55
- data/lib/isodoc/ogc/ogc.policy.xsl +166 -55
- data/lib/isodoc/ogc/ogc.reference-model.xsl +166 -55
- data/lib/isodoc/ogc/ogc.release-notes.xsl +166 -55
- data/lib/isodoc/ogc/ogc.standard.xsl +166 -55
- data/lib/isodoc/ogc/ogc.test-suite.xsl +166 -55
- data/lib/isodoc/ogc/ogc.user-guide.xsl +166 -55
- data/lib/isodoc/ogc/ogc.white-paper.xsl +166 -55
- data/lib/isodoc/ogc/presentation_xml_convert.rb +2 -2
- data/lib/metanorma/ogc/basicdoc.rng +0 -1
- data/lib/metanorma/ogc/biblio.rng +12 -2
- data/lib/metanorma/ogc/cleanup.rb +3 -5
- data/lib/metanorma/ogc/front.rb +10 -11
- data/lib/metanorma/ogc/isodoc.rng +12 -1
- data/lib/metanorma/ogc/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: e8f16660dc4e9b8e16ea11cfddfc8b40fd617a9b7c8848c31f8fdfeb6d02835d
|
4
|
+
data.tar.gz: 9e2c89ee7f4caa6c115a02f18eb8a3e4704ab460307b25cf624ea6eabd697cb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1236035fa414f29a2f2cd82a982d9aca23a36bf50c405729710f9a954276cf67d581945f3c7a747a53fb0a30338a155c5331fcdda69885f0c55bc2894dc03c7f
|
7
|
+
data.tar.gz: b75a75e64a73e7f1fd33d36007304f83ed4254e5ac90a6c4df38fd9187c31662c97374236ce2e98ea31fb9c4aa4aa3fc65981db8e9243860102c2c8ef1e2968e
|
@@ -14,7 +14,7 @@ module IsoDoc
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def hi_parse(node, out)
|
17
|
-
out.span
|
17
|
+
out.span class: "hi" do |e|
|
18
18
|
node.children.each { |n| parse(n, e) }
|
19
19
|
end
|
20
20
|
end
|
@@ -41,7 +41,7 @@ module IsoDoc
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def term_cleanup_merge_admitted(term)
|
44
|
-
term.xpath("./following-sibling::p[@class = 'AltTerms' or "\
|
44
|
+
term.xpath("./following-sibling::p[@class = 'AltTerms' or " \
|
45
45
|
"@class = 'DeprecatedTerms']").each do |a|
|
46
46
|
term << " "
|
47
47
|
term << a.children
|
@@ -50,20 +50,20 @@ module IsoDoc
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def deprecated_term_parse(node, out)
|
53
|
-
out.p
|
53
|
+
out.p class: "DeprecatedTerms" do |p|
|
54
54
|
node.children.each { |c| parse(c, p) }
|
55
55
|
p << " "
|
56
|
-
p.span
|
56
|
+
p.span class: "AdmittedLabel" do |s|
|
57
57
|
s << l10n(@i18n.deprecated)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
62
|
def admitted_term_parse(node, out)
|
63
|
-
out.p
|
63
|
+
out.p class: "AltTerms" do |p|
|
64
64
|
node.children.each { |c| parse(c, p) }
|
65
65
|
p << " "
|
66
|
-
p.span
|
66
|
+
p.span class: "AdmittedLabel" do |s|
|
67
67
|
s << l10n(@i18n.admitted)
|
68
68
|
end
|
69
69
|
end
|
@@ -78,13 +78,13 @@ module IsoDoc
|
|
78
78
|
def example_label(node, div, name); end
|
79
79
|
|
80
80
|
def example_name_parse(_node, div, name)
|
81
|
-
div.p
|
81
|
+
div.p class: "SourceTitle", style: "text-align:center;" do |p|
|
82
82
|
name&.children&.each { |n| parse(n, p) }
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
86
|
def middle_clause(_docxml)
|
87
|
-
"//clause[parent::sections][not(@type = 'scope' or "\
|
87
|
+
"//clause[parent::sections][not(@type = 'scope' or " \
|
88
88
|
"@type = 'conformance')][not(descendant::terms)]"
|
89
89
|
end
|
90
90
|
|
@@ -111,15 +111,15 @@ module IsoDoc
|
|
111
111
|
ret = super
|
112
112
|
%w(recommendation requirement permission).include?(node["class"]) and
|
113
113
|
ret = ret.merge(class: node["type"], style:
|
114
|
-
"border-collapse:collapse;border-spacing:0;"\
|
114
|
+
"border-collapse:collapse;border-spacing:0;" \
|
115
115
|
"#{keep_style(node)}")
|
116
116
|
ret
|
117
117
|
end
|
118
118
|
|
119
119
|
def make_tr_attr(cell, row, totalrows, header, bordered)
|
120
120
|
ret = super
|
121
|
-
if cell.at("./ancestor::xmlns:table[@class = 'recommendation'] | "\
|
122
|
-
"./ancestor::xmlns:table[@class = 'requirement'] | "\
|
121
|
+
if cell.at("./ancestor::xmlns:table[@class = 'recommendation'] | " \
|
122
|
+
"./ancestor::xmlns:table[@class = 'requirement'] | " \
|
123
123
|
"./ancestor::xmlns:table[@class = 'permission']")
|
124
124
|
ret[:style] = "vertical-align:top;"
|
125
125
|
ret[:class] = "recommend"
|
@@ -1515,14 +1515,14 @@
|
|
1515
1515
|
BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
|
1516
1516
|
|
1517
1517
|
<!--
|
1518
|
-
<
|
1518
|
+
<metanorma-extension>
|
1519
1519
|
<presentation-metadata>
|
1520
1520
|
<papersize>letter</papersize>
|
1521
1521
|
</presentation-metadata>
|
1522
|
-
</
|
1522
|
+
</metanorma-extension>
|
1523
1523
|
-->
|
1524
1524
|
|
1525
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1525
|
+
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
|
1526
1526
|
<xsl:variable name="papersize_width_">
|
1527
1527
|
<xsl:choose>
|
1528
1528
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -1639,7 +1639,7 @@
|
|
1639
1639
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
1640
1640
|
|
1641
1641
|
<xsl:variable name="title-list-tables">
|
1642
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1642
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
1643
1643
|
<xsl:value-of select="$toc_table_title"/>
|
1644
1644
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
1645
1645
|
<xsl:call-template name="getTitle">
|
@@ -1649,7 +1649,7 @@
|
|
1649
1649
|
</xsl:variable>
|
1650
1650
|
|
1651
1651
|
<xsl:variable name="title-list-figures">
|
1652
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1652
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
1653
1653
|
<xsl:value-of select="$toc_figure_title"/>
|
1654
1654
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
1655
1655
|
<xsl:call-template name="getTitle">
|
@@ -1659,7 +1659,7 @@
|
|
1659
1659
|
</xsl:variable>
|
1660
1660
|
|
1661
1661
|
<xsl:variable name="title-list-recommendations">
|
1662
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1662
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
1663
1663
|
<xsl:value-of select="$toc_requirement_title"/>
|
1664
1664
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
1665
1665
|
<xsl:call-template name="getTitle">
|
@@ -1732,7 +1732,7 @@
|
|
1732
1732
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
1733
1733
|
|
1734
1734
|
<xsl:variable name="additional_fonts_">
|
1735
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
1735
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
1736
1736
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
1737
1737
|
</xsl:for-each>
|
1738
1738
|
</xsl:variable>
|
@@ -2895,10 +2895,10 @@
|
|
2895
2895
|
|
2896
2896
|
<xsl:template name="processTablesFigures_Contents">
|
2897
2897
|
<xsl:param name="always"/>
|
2898
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2898
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
2899
2899
|
<xsl:call-template name="processTables_Contents"/>
|
2900
2900
|
</xsl:if>
|
2901
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2901
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
2902
2902
|
<xsl:call-template name="processFigures_Contents"/>
|
2903
2903
|
</xsl:if>
|
2904
2904
|
</xsl:template>
|
@@ -3232,6 +3232,7 @@
|
|
3232
3232
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
3233
3233
|
|
3234
3234
|
<xsl:choose>
|
3235
|
+
<xsl:when test="@width = 'full-page-width' or @width = 'text-width'">100%</xsl:when>
|
3235
3236
|
<xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
|
3236
3237
|
<xsl:otherwise><xsl:value-of select="$table_width_default"/></xsl:otherwise>
|
3237
3238
|
</xsl:choose>
|
@@ -3249,6 +3250,8 @@
|
|
3249
3250
|
|
3250
3251
|
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
|
3251
3252
|
|
3253
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3254
|
+
|
3252
3255
|
</xsl:element>
|
3253
3256
|
</xsl:variable>
|
3254
3257
|
|
@@ -3346,7 +3349,7 @@
|
|
3346
3349
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
3347
3350
|
|
3348
3351
|
<xsl:choose>
|
3349
|
-
<xsl:when test="@width">
|
3352
|
+
<xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
|
3350
3353
|
|
3351
3354
|
<!-- centered table when table name is centered (see table-name-style) -->
|
3352
3355
|
|
@@ -3390,6 +3393,10 @@
|
|
3390
3393
|
|
3391
3394
|
</xsl:template>
|
3392
3395
|
|
3396
|
+
<xsl:template name="setBordersTableArray">
|
3397
|
+
|
3398
|
+
</xsl:template>
|
3399
|
+
|
3393
3400
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
3394
3401
|
<xsl:param name="continued"/>
|
3395
3402
|
<xsl:if test="normalize-space() != ''">
|
@@ -3664,6 +3671,7 @@
|
|
3664
3671
|
This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
|
3665
3672
|
<xsl:when test="(@width_max > $page_width and @width_min < $page_width) or (@width_min >= $page_width)">
|
3666
3673
|
<!-- difference between the available space and the minimum table width -->
|
3674
|
+
<_width_min><xsl:value-of select="@width_min"/></_width_min>
|
3667
3675
|
<xsl:variable name="W" select="$page_width - @width_min"/>
|
3668
3676
|
<W><xsl:value-of select="$W"/></W>
|
3669
3677
|
<!-- difference between maximum and minimum width of the table -->
|
@@ -3864,6 +3872,8 @@
|
|
3864
3872
|
<fo:table-row>
|
3865
3873
|
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
3866
3874
|
|
3875
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3876
|
+
|
3867
3877
|
<!-- fn will be processed inside 'note' processing -->
|
3868
3878
|
|
3869
3879
|
<!-- for BSI (not PAS) display Notes before footnotes -->
|
@@ -3985,6 +3995,8 @@
|
|
3985
3995
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
3986
3996
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
3987
3997
|
|
3998
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3999
|
+
|
3988
4000
|
<xsl:call-template name="setTableRowAttributes"/>
|
3989
4001
|
|
3990
4002
|
<xsl:apply-templates/>
|
@@ -4008,6 +4020,8 @@
|
|
4008
4020
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
4009
4021
|
</xsl:if>
|
4010
4022
|
|
4023
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4024
|
+
|
4011
4025
|
<xsl:variable name="number"><xsl:number/></xsl:variable>
|
4012
4026
|
<xsl:attribute name="background-color">
|
4013
4027
|
<xsl:choose>
|
@@ -4035,6 +4049,8 @@
|
|
4035
4049
|
<xsl:with-param name="default">center</xsl:with-param>
|
4036
4050
|
</xsl:call-template>
|
4037
4051
|
|
4052
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4053
|
+
|
4038
4054
|
<xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend') and normalize-space(@align) = ''">
|
4039
4055
|
<xsl:call-template name="setTextAlignment">
|
4040
4056
|
<xsl:with-param name="default">left</xsl:with-param>
|
@@ -4093,6 +4109,8 @@
|
|
4093
4109
|
|
4094
4110
|
<!-- bsi -->
|
4095
4111
|
|
4112
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4113
|
+
|
4096
4114
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
4097
4115
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
4098
4116
|
</xsl:if>
|
@@ -4285,17 +4303,20 @@
|
|
4285
4303
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
4286
4304
|
<xsl:variable name="reference" select="@reference"/>
|
4287
4305
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
4288
|
-
<fo:block xsl:use-attribute-sets="table-fn-style">
|
4289
4306
|
|
4290
|
-
|
4307
|
+
<fo:block xsl:use-attribute-sets="table-fn-style">
|
4291
4308
|
|
4292
|
-
|
4309
|
+
<fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
|
4310
|
+
|
4311
|
+
<xsl:value-of select="@reference"/>
|
4312
|
+
|
4313
|
+
</fo:inline>
|
4314
|
+
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
4315
|
+
<xsl:copy-of select="./node()"/>
|
4316
|
+
</fo:inline>
|
4317
|
+
|
4318
|
+
</fo:block>
|
4293
4319
|
|
4294
|
-
</fo:inline>
|
4295
|
-
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
4296
|
-
<xsl:copy-of select="./node()"/>
|
4297
|
-
</fo:inline>
|
4298
|
-
</fo:block>
|
4299
4320
|
</xsl:if>
|
4300
4321
|
</xsl:for-each>
|
4301
4322
|
</xsl:template>
|
@@ -5247,12 +5268,12 @@
|
|
5247
5268
|
<xsl:param name="value"/>
|
5248
5269
|
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
5249
5270
|
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
5250
|
-
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-
|
5251
|
-
<xsl:attribute name="height">5mm</xsl:attribute>
|
5271
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
|
5272
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
|
5252
5273
|
<xsl:attribute name="content-width">100%</xsl:attribute>
|
5253
5274
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5254
5275
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5255
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
5276
|
+
<!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
5256
5277
|
<g>
|
5257
5278
|
<xsl:if test="$type = 'closing' or $type = 'end'">
|
5258
5279
|
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
@@ -5266,6 +5287,27 @@
|
|
5266
5287
|
</xsl:if>
|
5267
5288
|
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
5268
5289
|
</text>
|
5290
|
+
</svg> -->
|
5291
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
5292
|
+
<g>
|
5293
|
+
<xsl:if test="$type = 'closing' or $type = 'end'">
|
5294
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
5295
|
+
</xsl:if>
|
5296
|
+
<polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
|
5297
|
+
<line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
|
5298
|
+
</g>
|
5299
|
+
<xsl:variable name="text_x">
|
5300
|
+
<xsl:choose>
|
5301
|
+
<xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
|
5302
|
+
<xsl:otherwise>22</xsl:otherwise>
|
5303
|
+
</xsl:choose>
|
5304
|
+
</xsl:variable>
|
5305
|
+
<text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
|
5306
|
+
<xsl:value-of select="$kind"/>
|
5307
|
+
</text>
|
5308
|
+
<text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
|
5309
|
+
<xsl:value-of select="$value"/>
|
5310
|
+
</text>
|
5269
5311
|
</svg>
|
5270
5312
|
</fo:instream-foreign-object>
|
5271
5313
|
</xsl:template>
|
@@ -5520,18 +5562,23 @@
|
|
5520
5562
|
|
5521
5563
|
<xsl:template name="add-zero-spaces-java">
|
5522
5564
|
<xsl:param name="text" select="."/>
|
5523
|
-
|
5524
|
-
|
5565
|
+
|
5566
|
+
<!-- add zero-width space (#x200B) after dot with next non-digit -->
|
5567
|
+
<xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1$2')"/>
|
5568
|
+
<!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
|
5569
|
+
<xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1')"/>
|
5570
|
+
<!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
|
5571
|
+
<xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1$2')"/>
|
5525
5572
|
<!-- add zero-width space (#x200B) after characters: 'great than' -->
|
5526
|
-
<xsl:variable name="
|
5573
|
+
<xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(\u003e)(?!\u003e)', '$1')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
|
5527
5574
|
<!-- add zero-width space (#x200B) before characters: 'less than' -->
|
5528
|
-
<xsl:variable name="
|
5575
|
+
<xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(?<!\u003c)(\u003c)', '$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
|
5529
5576
|
<!-- add zero-width space (#x200B) before character: { -->
|
5530
|
-
<xsl:variable name="
|
5577
|
+
<xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?<!\W)(\{)', '$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
|
5531
5578
|
<!-- add zero-width space (#x200B) after character: , -->
|
5532
|
-
<xsl:variable name="
|
5579
|
+
<xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1')"/> <!-- negative lookahead: ',' not followed by digit -->
|
5533
5580
|
|
5534
|
-
<xsl:value-of select="$
|
5581
|
+
<xsl:value-of select="$text7"/>
|
5535
5582
|
</xsl:template>
|
5536
5583
|
|
5537
5584
|
<xsl:template name="add-zero-spaces-link-java">
|
@@ -5540,7 +5587,9 @@
|
|
5540
5587
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
|
5541
5588
|
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
5542
5589
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
5543
|
-
<xsl:
|
5590
|
+
<xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
|
5591
|
+
<!-- remove zero-width space at the end -->
|
5592
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '$', '')"/>
|
5544
5593
|
</xsl:template>
|
5545
5594
|
|
5546
5595
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -5677,7 +5726,7 @@
|
|
5677
5726
|
</xsl:copy>
|
5678
5727
|
</xsl:template>
|
5679
5728
|
|
5680
|
-
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
|
5729
|
+
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode']) and not(*[local-name()='ul']) and not(*[local-name()='ol'])]" mode="table-without-br">
|
5681
5730
|
<xsl:copy>
|
5682
5731
|
<xsl:copy-of select="@*"/>
|
5683
5732
|
<p>
|
@@ -5753,6 +5802,14 @@
|
|
5753
5802
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
|
5754
5803
|
</xsl:template>
|
5755
5804
|
|
5805
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
|
5806
|
+
<xsl:apply-templates mode="table-without-br"/>
|
5807
|
+
</xsl:template>
|
5808
|
+
|
5809
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
|
5810
|
+
<xsl:apply-templates mode="table-without-br"/>
|
5811
|
+
</xsl:template>
|
5812
|
+
|
5756
5813
|
<!-- mode="table-without-br" -->
|
5757
5814
|
<!-- ================================== -->
|
5758
5815
|
<!-- END: Step 0. replace <br/> to <p>...</p> -->
|
@@ -6570,7 +6627,7 @@
|
|
6570
6627
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
6571
6628
|
</xsl:if>
|
6572
6629
|
|
6573
|
-
<fo:block-container margin-left="0mm">
|
6630
|
+
<fo:block-container margin-left="0mm" margin-right="0mm">
|
6574
6631
|
|
6575
6632
|
<fo:block>
|
6576
6633
|
|
@@ -6748,11 +6805,14 @@
|
|
6748
6805
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
6749
6806
|
</xsl:call-template>
|
6750
6807
|
|
6808
|
+
<!-- Example: Dimensions in millimeters -->
|
6809
|
+
<xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
|
6810
|
+
|
6751
6811
|
<fo:block xsl:use-attribute-sets="figure-style">
|
6752
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6812
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
6753
6813
|
</fo:block>
|
6754
6814
|
<xsl:call-template name="fn_display_figure"/>
|
6755
|
-
<xsl:for-each select="*[local-name() = 'note']">
|
6815
|
+
<xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
|
6756
6816
|
<xsl:call-template name="note"/>
|
6757
6817
|
</xsl:for-each>
|
6758
6818
|
|
@@ -7009,24 +7069,47 @@
|
|
7009
7069
|
|
7010
7070
|
</xsl:when>
|
7011
7071
|
<xsl:otherwise>
|
7012
|
-
|
7013
|
-
|
7014
|
-
|
7015
|
-
<xsl:
|
7016
|
-
|
7017
|
-
|
7018
|
-
<xsl:
|
7019
|
-
|
7020
|
-
|
7021
|
-
|
7022
|
-
|
7023
|
-
|
7024
|
-
|
7025
|
-
|
7026
|
-
|
7027
|
-
|
7028
|
-
|
7029
|
-
|
7072
|
+
|
7073
|
+
<xsl:variable name="element">
|
7074
|
+
<xsl:choose>
|
7075
|
+
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
|
7076
|
+
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
7077
|
+
</xsl:when>
|
7078
|
+
<xsl:otherwise>
|
7079
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
7080
|
+
<xsl:if test="ancestor::*[local-name() = 'dt']">
|
7081
|
+
<xsl:attribute name="text-align">left</xsl:attribute>
|
7082
|
+
</xsl:if>
|
7083
|
+
</fo:block>
|
7084
|
+
</xsl:otherwise>
|
7085
|
+
</xsl:choose>
|
7086
|
+
</xsl:variable>
|
7087
|
+
|
7088
|
+
<xsl:for-each select="xalan:nodeset($element)/*">
|
7089
|
+
<xsl:copy>
|
7090
|
+
<xsl:copy-of select="@*"/>
|
7091
|
+
<!-- <fo:block xsl:use-attribute-sets="image-style"> -->
|
7092
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
7093
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
7094
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
7095
|
+
</xsl:if>
|
7096
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
7097
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
7098
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
7099
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
7100
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
7101
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
7102
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
7103
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
7104
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
7105
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
7106
|
+
</xsl:if>
|
7107
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
7108
|
+
<xsl:copy-of select="$svg_content"/>
|
7109
|
+
</fo:instream-foreign-object>
|
7110
|
+
<!-- </fo:block> -->
|
7111
|
+
</xsl:copy>
|
7112
|
+
</xsl:for-each>
|
7030
7113
|
</xsl:otherwise>
|
7031
7114
|
</xsl:choose>
|
7032
7115
|
</xsl:template>
|
@@ -7118,6 +7201,13 @@
|
|
7118
7201
|
</xsl:for-each>
|
7119
7202
|
</xsl:template>
|
7120
7203
|
|
7204
|
+
<!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
|
7205
|
+
<xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
|
7206
|
+
<xsl:for-each select="*[local-name() = 'svg']">
|
7207
|
+
<xsl:call-template name="image_svg"/>
|
7208
|
+
</xsl:for-each>
|
7209
|
+
</xsl:template>
|
7210
|
+
|
7121
7211
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
7122
7212
|
<xsl:variable name="svg_content" select="document(@src)"/>
|
7123
7213
|
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
@@ -7256,6 +7346,8 @@
|
|
7256
7346
|
<xsl:value-of select="."/>
|
7257
7347
|
</xsl:template>
|
7258
7348
|
|
7349
|
+
<xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
|
7350
|
+
|
7259
7351
|
<xsl:template match="node()" mode="contents">
|
7260
7352
|
<xsl:apply-templates mode="contents"/>
|
7261
7353
|
</xsl:template>
|
@@ -7581,7 +7673,15 @@
|
|
7581
7673
|
<xsl:value-of select="@section"/>
|
7582
7674
|
<xsl:text> </xsl:text>
|
7583
7675
|
</xsl:if>
|
7584
|
-
<xsl:
|
7676
|
+
<xsl:variable name="title">
|
7677
|
+
<xsl:for-each select="title/node()">
|
7678
|
+
<xsl:choose>
|
7679
|
+
<xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
|
7680
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
7681
|
+
</xsl:choose>
|
7682
|
+
</xsl:for-each>
|
7683
|
+
</xsl:variable>
|
7684
|
+
<xsl:value-of select="normalize-space($title)"/>
|
7585
7685
|
</fo:bookmark-title>
|
7586
7686
|
<xsl:apply-templates mode="bookmark"/>
|
7587
7687
|
</fo:bookmark>
|
@@ -7607,6 +7707,12 @@
|
|
7607
7707
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
|
7608
7708
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
|
7609
7709
|
|
7710
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
|
7711
|
+
<fo:block text-align="right" keep-with-next="always">
|
7712
|
+
<xsl:apply-templates/>
|
7713
|
+
</fo:block>
|
7714
|
+
</xsl:template>
|
7715
|
+
|
7610
7716
|
<!-- ====== -->
|
7611
7717
|
<!-- ====== -->
|
7612
7718
|
<xsl:template match="*[local-name() = 'title']" mode="contents_item">
|
@@ -7756,6 +7862,10 @@
|
|
7756
7862
|
</xsl:for-each>
|
7757
7863
|
</xsl:template>
|
7758
7864
|
|
7865
|
+
<xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
|
7866
|
+
<xsl:value-of select="."/>
|
7867
|
+
</xsl:template>
|
7868
|
+
|
7759
7869
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
7760
7870
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
7761
7871
|
<xsl:apply-templates mode="contents_item"/>
|
@@ -7765,7 +7875,7 @@
|
|
7765
7875
|
<!-- sourcecode -->
|
7766
7876
|
<!-- =============== -->
|
7767
7877
|
|
7768
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
7878
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
7769
7879
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
7770
7880
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
7771
7881
|
|
@@ -9863,8 +9973,8 @@
|
|
9863
9973
|
|
9864
9974
|
<xsl:variable name="toc_level">
|
9865
9975
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
9866
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
9867
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
9976
|
+
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
|
9977
|
+
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
|
9868
9978
|
<xsl:choose>
|
9869
9979
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
9870
9980
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -10856,6 +10966,7 @@
|
|
10856
10966
|
<xsl:choose>
|
10857
10967
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
10858
10968
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
10969
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
10859
10970
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
10860
10971
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
10861
10972
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|