metanorma-iec 2.5.7 → 2.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iec/base_convert.rb +5 -5
- data/lib/isodoc/iec/iec.international-standard.xsl +495 -153
- data/lib/isodoc/iec/presentation_terms.rb +21 -10
- data/lib/isodoc/iec/presentation_xml_convert.rb +13 -10
- data/lib/isodoc/iec/word_convert.rb +2 -3
- data/lib/isodoc/iec/xref.rb +18 -5
- data/lib/metanorma/iec/isodoc.rng +1 -1
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66fba3763fe9014def32480c7a7a3b48b13359ee0d0aa68e32e6fec0895d997c
|
4
|
+
data.tar.gz: a611decb5788c0f8d5cef6a565887f87fad598709b733c709f83b7b4e7edb369
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 888379d6efae9178b3b159223d6a7d3d6168784d9e3f3acc9b28b3a9b4f322d79c944df4980b977a91650db96aa7c09a15db8a02d31d8e12908fac61eb852976
|
7
|
+
data.tar.gz: bdcc2276baa7c810f149b3f7e8c6b3df3cdcd41279f5b4adcc2931c43707fd81500b92c650209d919e894f9177ec7ef8aa320b892c698a8057d8c36ae33f5842
|
@@ -10,9 +10,9 @@ module IsoDoc
|
|
10
10
|
|
11
11
|
def foreword(clause, out)
|
12
12
|
out.div **attr_code(id: clause["id"]) do |s|
|
13
|
-
clause_name(nil, clause.at(ns("./title")), s,
|
13
|
+
clause_name(nil, clause.at(ns("./fmt-title")), s,
|
14
14
|
{ class: "ForewordTitle" })
|
15
|
-
clause.elements.each { |e| parse(e, s) unless e.name == "title" }
|
15
|
+
clause.elements.each { |e| parse(e, s) unless e.name == "fmt-title" }
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -23,7 +23,7 @@ module IsoDoc
|
|
23
23
|
def biblio_list(elem, div, biblio)
|
24
24
|
@is_iev or return super
|
25
25
|
elem.children.each do |b|
|
26
|
-
parse(b, div) unless %w(title bibitem).include? b.name
|
26
|
+
parse(b, div) unless %w(fmt-title bibitem).include? b.name
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -34,10 +34,10 @@ module IsoDoc
|
|
34
34
|
depth = clause_title_depth(node, nil)
|
35
35
|
out.send "h#{depth}", class: "zzSTDTitle2" do |p|
|
36
36
|
p.b do |b|
|
37
|
-
node&.at(ns("./title"))&.children&.each { |c2| parse(c2, b) }
|
37
|
+
node&.at(ns("./fmt-title"))&.children&.each { |c2| parse(c2, b) }
|
38
38
|
end
|
39
39
|
end
|
40
|
-
node.children.reject { |c1| c1.name == "title" }.each do |c1|
|
40
|
+
node.children.reject { |c1| c1.name == "fmt-title" }.each do |c1|
|
41
41
|
parse(c1, div)
|
42
42
|
end
|
43
43
|
end
|
@@ -221,6 +221,12 @@
|
|
221
221
|
<xsl:with-param name="contents" select="$contents"/>
|
222
222
|
</xsl:call-template>
|
223
223
|
|
224
|
+
<xsl:if test="$debug = 'true'">
|
225
|
+
<redirect:write file="contents_.xml"> <!-- {java:getTime(java:java.util.Date.new())} -->
|
226
|
+
<xsl:copy-of select="$contents"/>
|
227
|
+
</redirect:write>
|
228
|
+
</xsl:if>
|
229
|
+
|
224
230
|
<!-- For 'Published' documents insert two cover pages -->
|
225
231
|
<xsl:if test="$stage >= 60">
|
226
232
|
|
@@ -868,12 +874,6 @@
|
|
868
874
|
</fo:page-sequence> <!-- END: cover-FDIS -->
|
869
875
|
</xsl:if>
|
870
876
|
|
871
|
-
<!-- <xsl:if test="$debug = 'true'">
|
872
|
-
<redirect:write file="contents_{java:getTime(java:java.util.Date.new())}.xml">
|
873
|
-
<xsl:copy-of select="$contents"/>
|
874
|
-
</redirect:write>
|
875
|
-
</xsl:if> -->
|
876
|
-
|
877
877
|
<xsl:for-each select="//iec:iec-standard">
|
878
878
|
<xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
|
879
879
|
<xsl:variable name="current_document">
|
@@ -1591,10 +1591,10 @@
|
|
1591
1591
|
<!-- ============================= -->
|
1592
1592
|
|
1593
1593
|
<!-- element with title -->
|
1594
|
-
<xsl:template match="*[iec:title]" mode="contents">
|
1594
|
+
<xsl:template match="*[iec:title or iec:fmt-title]" mode="contents">
|
1595
1595
|
<xsl:variable name="level">
|
1596
1596
|
<xsl:call-template name="getLevel">
|
1597
|
-
<xsl:with-param name="depth" select="iec:title/@depth"/>
|
1597
|
+
<xsl:with-param name="depth" select="iec:fmt-title/@depth | iec:title/@depth"/>
|
1598
1598
|
</xsl:call-template>
|
1599
1599
|
</xsl:variable>
|
1600
1600
|
|
@@ -1649,7 +1649,14 @@
|
|
1649
1649
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($title))"/>
|
1650
1650
|
</xsl:when>
|
1651
1651
|
<xsl:when test="$type = 'appendix'">
|
1652
|
-
<xsl:
|
1652
|
+
<xsl:choose>
|
1653
|
+
<xsl:when test="iec:fmt-title">
|
1654
|
+
<xsl:apply-templates select="iec:fmt-title" mode="contents_item"/>
|
1655
|
+
</xsl:when>
|
1656
|
+
<xsl:otherwise>
|
1657
|
+
<xsl:apply-templates select="iec:title" mode="contents_item"/>
|
1658
|
+
</xsl:otherwise>
|
1659
|
+
</xsl:choose>
|
1653
1660
|
</xsl:when>
|
1654
1661
|
<xsl:otherwise>
|
1655
1662
|
<xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
|
@@ -2163,7 +2170,7 @@
|
|
2163
2170
|
</xsl:copy>
|
2164
2171
|
</xsl:template> -->
|
2165
2172
|
|
2166
|
-
<xsl:strip-space elements="iec:xref"/>
|
2173
|
+
<!-- <xsl:strip-space elements="iec:xref"/> -->
|
2167
2174
|
|
2168
2175
|
<xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
|
2169
2176
|
<xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
|
@@ -3183,6 +3190,10 @@
|
|
3183
3190
|
|
3184
3191
|
<xsl:template name="refine_termnote-name-style">
|
3185
3192
|
|
3193
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
3194
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
3195
|
+
</xsl:if> -->
|
3196
|
+
|
3186
3197
|
</xsl:template>
|
3187
3198
|
|
3188
3199
|
<xsl:attribute-set name="termnote-p-style">
|
@@ -3895,9 +3906,21 @@
|
|
3895
3906
|
<xsl:template name="processTables_Contents">
|
3896
3907
|
<tables>
|
3897
3908
|
<xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
|
3898
|
-
<
|
3899
|
-
<xsl:
|
3900
|
-
|
3909
|
+
<xsl:choose>
|
3910
|
+
<xsl:when test="*[local-name() = 'fmt-name']">
|
3911
|
+
<xsl:variable name="fmt_name">
|
3912
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
3913
|
+
</xsl:variable>
|
3914
|
+
<table id="{@id}" alt-text="{normalize-space($fmt_name)}">
|
3915
|
+
<xsl:copy-of select="$fmt_name"/>
|
3916
|
+
</table>
|
3917
|
+
</xsl:when>
|
3918
|
+
<xsl:otherwise>
|
3919
|
+
<table id="{@id}" alt-text="{*[local-name() = 'name']}">
|
3920
|
+
<xsl:copy-of select="*[local-name() = 'name']"/>
|
3921
|
+
</table>
|
3922
|
+
</xsl:otherwise>
|
3923
|
+
</xsl:choose>
|
3901
3924
|
</xsl:for-each>
|
3902
3925
|
</tables>
|
3903
3926
|
</xsl:template>
|
@@ -3905,9 +3928,21 @@
|
|
3905
3928
|
<xsl:template name="processFigures_Contents">
|
3906
3929
|
<figures>
|
3907
3930
|
<xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
|
3908
|
-
<
|
3909
|
-
<xsl:
|
3910
|
-
|
3931
|
+
<xsl:choose>
|
3932
|
+
<xsl:when test="*[local-name() = 'fmt-name']">
|
3933
|
+
<xsl:variable name="fmt_name">
|
3934
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
3935
|
+
</xsl:variable>
|
3936
|
+
<figure id="{@id}" alt-text="{normalize-space($fmt_name)}">
|
3937
|
+
<xsl:copy-of select="$fmt_name"/>
|
3938
|
+
</figure>
|
3939
|
+
</xsl:when>
|
3940
|
+
<xsl:otherwise>
|
3941
|
+
<figure id="{@id}" alt-text="{*[local-name() = 'name']}">
|
3942
|
+
<xsl:copy-of select="*[local-name() = 'name']"/>
|
3943
|
+
</figure>
|
3944
|
+
</xsl:otherwise>
|
3945
|
+
</xsl:choose>
|
3911
3946
|
</xsl:for-each>
|
3912
3947
|
</figures>
|
3913
3948
|
</xsl:template>
|
@@ -8814,6 +8849,8 @@
|
|
8814
8849
|
|
8815
8850
|
<fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
|
8816
8851
|
|
8852
|
+
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab"/>
|
8853
|
+
|
8817
8854
|
<xsl:call-template name="refine_note-name-style"/>
|
8818
8855
|
|
8819
8856
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
@@ -8870,10 +8907,6 @@
|
|
8870
8907
|
|
8871
8908
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
8872
8909
|
|
8873
|
-
<xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
|
8874
|
-
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
8875
|
-
</xsl:if>
|
8876
|
-
|
8877
8910
|
<xsl:call-template name="refine_termnote-name-style"/>
|
8878
8911
|
|
8879
8912
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
@@ -9020,17 +9053,29 @@
|
|
9020
9053
|
<!-- Example: Dimensions in millimeters -->
|
9021
9054
|
<xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
|
9022
9055
|
|
9056
|
+
<xsl:variable name="show_figure_key_in_block_container">
|
9057
|
+
true
|
9058
|
+
</xsl:variable>
|
9059
|
+
|
9023
9060
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
9024
9061
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
9025
9062
|
</fo:block>
|
9026
|
-
|
9027
|
-
|
9028
|
-
|
9029
|
-
|
9063
|
+
|
9064
|
+
<xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
|
9065
|
+
<xsl:call-template name="showFigureKey"/>
|
9066
|
+
</xsl:if>
|
9030
9067
|
|
9031
9068
|
<xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
|
9032
9069
|
|
9033
9070
|
</fo:block-container>
|
9071
|
+
|
9072
|
+
</xsl:template>
|
9073
|
+
|
9074
|
+
<xsl:template name="showFigureKey">
|
9075
|
+
<xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
|
9076
|
+
<xsl:call-template name="note"/>
|
9077
|
+
</xsl:for-each>
|
9078
|
+
<xsl:call-template name="fn_display_figure"/>
|
9034
9079
|
</xsl:template>
|
9035
9080
|
|
9036
9081
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
@@ -9228,6 +9273,22 @@
|
|
9228
9273
|
</xsl:if>
|
9229
9274
|
</xsl:template>
|
9230
9275
|
|
9276
|
+
<xsl:template name="getImageSrc">
|
9277
|
+
<xsl:choose>
|
9278
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
9279
|
+
<xsl:choose>
|
9280
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
9281
|
+
<xsl:value-of select="@src"/>
|
9282
|
+
</xsl:when>
|
9283
|
+
<xsl:otherwise>
|
9284
|
+
<xsl:value-of select="concat($basepath, @src)"/>
|
9285
|
+
</xsl:otherwise>
|
9286
|
+
</xsl:choose>
|
9287
|
+
</xsl:when>
|
9288
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
9289
|
+
</xsl:choose>
|
9290
|
+
</xsl:template>
|
9291
|
+
|
9231
9292
|
<xsl:template name="getImageScale">
|
9232
9293
|
<xsl:param name="indent"/>
|
9233
9294
|
<xsl:variable name="indent_left">
|
@@ -9237,19 +9298,7 @@
|
|
9237
9298
|
</xsl:choose>
|
9238
9299
|
</xsl:variable>
|
9239
9300
|
<xsl:variable name="img_src">
|
9240
|
-
<xsl:
|
9241
|
-
<xsl:when test="not(starts-with(@src, 'data:'))">
|
9242
|
-
<xsl:choose>
|
9243
|
-
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
9244
|
-
<xsl:value-of select="@src"/>
|
9245
|
-
</xsl:when>
|
9246
|
-
<xsl:otherwise>
|
9247
|
-
<xsl:value-of select="concat($basepath, @src)"/>
|
9248
|
-
</xsl:otherwise>
|
9249
|
-
</xsl:choose>
|
9250
|
-
</xsl:when>
|
9251
|
-
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
9252
|
-
</xsl:choose>
|
9301
|
+
<xsl:call-template name="getImageSrc"/>
|
9253
9302
|
</xsl:variable>
|
9254
9303
|
|
9255
9304
|
<xsl:variable name="image_width_effective">
|
@@ -9257,10 +9306,15 @@
|
|
9257
9306
|
<xsl:value-of select="$width_effective - number($indent_left)"/>
|
9258
9307
|
|
9259
9308
|
</xsl:variable>
|
9309
|
+
<xsl:variable name="image_height_effective" select="$height_effective - number($indent_left)"/>
|
9260
9310
|
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
9261
9311
|
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
9262
9312
|
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
9263
|
-
<xsl:variable name="scale"
|
9313
|
+
<xsl:variable name="scale">
|
9314
|
+
|
9315
|
+
<xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
9316
|
+
|
9317
|
+
</xsl:variable>
|
9264
9318
|
<xsl:value-of select="$scale"/>
|
9265
9319
|
</xsl:template>
|
9266
9320
|
|
@@ -9813,20 +9867,48 @@
|
|
9813
9867
|
<xsl:template match="*[local-name() = 'emf']"/>
|
9814
9868
|
|
9815
9869
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
9870
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
9871
|
+
<xsl:apply-templates mode="contents"/>
|
9872
|
+
<xsl:text> </xsl:text>
|
9873
|
+
</xsl:if>
|
9874
|
+
</xsl:template>
|
9875
|
+
|
9876
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="contents"/>
|
9877
|
+
|
9878
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name']" mode="contents">
|
9816
9879
|
<xsl:apply-templates mode="contents"/>
|
9817
9880
|
<xsl:text> </xsl:text>
|
9818
9881
|
</xsl:template>
|
9819
9882
|
|
9820
9883
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
|
9884
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
9885
|
+
<xsl:apply-templates mode="bookmarks"/>
|
9886
|
+
<xsl:text> </xsl:text>
|
9887
|
+
</xsl:if>
|
9888
|
+
</xsl:template>
|
9889
|
+
|
9890
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name'] | *[local-name() = 'sourcecode']/*[local-name() = 'fmt-name']" mode="bookmarks">
|
9821
9891
|
<xsl:apply-templates mode="bookmarks"/>
|
9822
9892
|
<xsl:text> </xsl:text>
|
9823
9893
|
</xsl:template>
|
9824
9894
|
|
9825
9895
|
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
9896
|
+
<xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
|
9897
|
+
<xsl:value-of select="."/>
|
9898
|
+
</xsl:if>
|
9899
|
+
</xsl:template>
|
9900
|
+
|
9901
|
+
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'fmt-name']/text()" mode="contents" priority="2">
|
9826
9902
|
<xsl:value-of select="."/>
|
9827
9903
|
</xsl:template>
|
9828
9904
|
|
9829
9905
|
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
9906
|
+
<xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
|
9907
|
+
<xsl:value-of select="."/>
|
9908
|
+
</xsl:if>
|
9909
|
+
</xsl:template>
|
9910
|
+
|
9911
|
+
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'fmt-name']//text()" mode="bookmarks" priority="2">
|
9830
9912
|
<xsl:value-of select="."/>
|
9831
9913
|
</xsl:template>
|
9832
9914
|
|
@@ -9847,7 +9929,7 @@
|
|
9847
9929
|
</xsl:template>
|
9848
9930
|
|
9849
9931
|
<!-- special case: ignore section-title if @depth different than @depth of parent clause, or @depth of parent clause = 1 -->
|
9850
|
-
<xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/>
|
9932
|
+
<xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth or ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth = 1)]" priority="3" mode="contents"/>
|
9851
9933
|
|
9852
9934
|
<xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
|
9853
9935
|
<xsl:variable name="level">
|
@@ -9859,6 +9941,9 @@
|
|
9859
9941
|
<xsl:variable name="section">
|
9860
9942
|
<xsl:choose>
|
9861
9943
|
<xsl:when test="@type = 'section-title'"/>
|
9944
|
+
<xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
|
9945
|
+
<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
|
9946
|
+
</xsl:when>
|
9862
9947
|
<xsl:otherwise>
|
9863
9948
|
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
9864
9949
|
</xsl:otherwise>
|
@@ -9881,6 +9966,19 @@
|
|
9881
9966
|
|
9882
9967
|
<xsl:variable name="title">
|
9883
9968
|
<xsl:choose>
|
9969
|
+
<!-- https://github.com/metanorma/mn-native-pdf/issues/770 -->
|
9970
|
+
<xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
|
9971
|
+
<xsl:choose>
|
9972
|
+
<xsl:when test="@type = 'section-title'">
|
9973
|
+
<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
|
9974
|
+
<xsl:text>: </xsl:text>
|
9975
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
9976
|
+
</xsl:when>
|
9977
|
+
<xsl:otherwise>
|
9978
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
9979
|
+
</xsl:otherwise>
|
9980
|
+
</xsl:choose>
|
9981
|
+
</xsl:when>
|
9884
9982
|
<xsl:when test="*[local-name() = 'tab']">
|
9885
9983
|
<xsl:choose>
|
9886
9984
|
<xsl:when test="@type = 'section-title'">
|
@@ -9916,7 +10014,7 @@
|
|
9916
10014
|
<xsl:apply-templates mode="bookmarks"/>
|
9917
10015
|
</xsl:template>
|
9918
10016
|
|
9919
|
-
<xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
10017
|
+
<xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
9920
10018
|
<xsl:apply-templates select="."/>
|
9921
10019
|
</xsl:template>
|
9922
10020
|
|
@@ -9929,6 +10027,10 @@
|
|
9929
10027
|
<xsl:apply-templates mode="contents"/>
|
9930
10028
|
</xsl:template>
|
9931
10029
|
|
10030
|
+
<xsl:template match="*[local-name() = 'semx']" mode="contents">
|
10031
|
+
<xsl:apply-templates mode="contents"/>
|
10032
|
+
</xsl:template>
|
10033
|
+
|
9932
10034
|
<xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
9933
10035
|
<xsl:apply-templates mode="bookmarks"/>
|
9934
10036
|
</xsl:template>
|
@@ -9938,9 +10040,14 @@
|
|
9938
10040
|
<xsl:apply-templates mode="bookmarks"/>
|
9939
10041
|
</xsl:template>
|
9940
10042
|
|
10043
|
+
<xsl:template match="*[local-name() = 'semx']" mode="bookmarks">
|
10044
|
+
<xsl:apply-templates mode="bookmarks"/>
|
10045
|
+
</xsl:template>
|
10046
|
+
|
9941
10047
|
<!-- Bookmarks -->
|
9942
10048
|
<xsl:template name="addBookmarks">
|
9943
10049
|
<xsl:param name="contents"/>
|
10050
|
+
<xsl:param name="contents_addon"/>
|
9944
10051
|
<xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
|
9945
10052
|
<xsl:if test="$contents_nodes//item">
|
9946
10053
|
<fo:bookmark-tree>
|
@@ -10038,6 +10145,9 @@
|
|
10038
10145
|
</xsl:otherwise>
|
10039
10146
|
</xsl:choose>
|
10040
10147
|
|
10148
|
+
<!-- for $namespace = 'nist-sp' $namespace = 'ogc' $namespace = 'ogc-white-paper' -->
|
10149
|
+
<xsl:copy-of select="$contents_addon"/>
|
10150
|
+
|
10041
10151
|
</fo:bookmark-tree>
|
10042
10152
|
</xsl:if>
|
10043
10153
|
</xsl:template>
|
@@ -10202,6 +10312,16 @@
|
|
10202
10312
|
<!-- ====== -->
|
10203
10313
|
<!-- ====== -->
|
10204
10314
|
<xsl:template match="*[local-name() = 'title']" mode="contents_item">
|
10315
|
+
<xsl:param name="mode">bookmarks</xsl:param>
|
10316
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-title'])">
|
10317
|
+
<xsl:apply-templates mode="contents_item">
|
10318
|
+
<xsl:with-param name="mode" select="$mode"/>
|
10319
|
+
</xsl:apply-templates>
|
10320
|
+
<!-- <xsl:text> </xsl:text> -->
|
10321
|
+
</xsl:if>
|
10322
|
+
</xsl:template>
|
10323
|
+
|
10324
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="contents_item">
|
10205
10325
|
<xsl:param name="mode">bookmarks</xsl:param>
|
10206
10326
|
<xsl:apply-templates mode="contents_item">
|
10207
10327
|
<xsl:with-param name="mode" select="$mode"/>
|
@@ -10209,12 +10329,38 @@
|
|
10209
10329
|
<!-- <xsl:text> </xsl:text> -->
|
10210
10330
|
</xsl:template>
|
10211
10331
|
|
10332
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim']" mode="contents_item" priority="3">
|
10333
|
+
<xsl:apply-templates mode="contents_item"/>
|
10334
|
+
</xsl:template>
|
10335
|
+
|
10336
|
+
<xsl:template match="*[local-name() = 'semx']" mode="contents_item">
|
10337
|
+
<xsl:apply-templates mode="contents_item"/>
|
10338
|
+
</xsl:template>
|
10339
|
+
|
10340
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
|
10341
|
+
|
10212
10342
|
<xsl:template name="getSection">
|
10213
|
-
<xsl:
|
10343
|
+
<xsl:choose>
|
10344
|
+
<xsl:when test="*[local-name() = 'fmt-title']">
|
10345
|
+
<xsl:variable name="fmt_title_section">
|
10346
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/preceding-sibling::node()[not(local-name() = 'review')]"/>
|
10347
|
+
</xsl:variable>
|
10348
|
+
<xsl:value-of select="normalize-space($fmt_title_section)"/>
|
10349
|
+
</xsl:when>
|
10350
|
+
<xsl:otherwise>
|
10351
|
+
<xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
10352
|
+
</xsl:otherwise>
|
10353
|
+
</xsl:choose>
|
10214
10354
|
</xsl:template>
|
10215
10355
|
|
10216
10356
|
<xsl:template name="getName">
|
10217
10357
|
<xsl:choose>
|
10358
|
+
<xsl:when test="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']]">
|
10359
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/following-sibling::node()"/>
|
10360
|
+
</xsl:when>
|
10361
|
+
<xsl:when test="*[local-name() = 'fmt-title']">
|
10362
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']/node()"/>
|
10363
|
+
</xsl:when>
|
10218
10364
|
<xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
|
10219
10365
|
<xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
10220
10366
|
</xsl:when>
|
@@ -10321,6 +10467,15 @@
|
|
10321
10467
|
</xsl:template>
|
10322
10468
|
|
10323
10469
|
<xsl:template match="*[local-name() = 'name']" mode="contents_item">
|
10470
|
+
<xsl:param name="mode">bookmarks</xsl:param>
|
10471
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
10472
|
+
<xsl:apply-templates mode="contents_item">
|
10473
|
+
<xsl:with-param name="mode" select="$mode"/>
|
10474
|
+
</xsl:apply-templates>
|
10475
|
+
</xsl:if>
|
10476
|
+
</xsl:template>
|
10477
|
+
|
10478
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="contents_item">
|
10324
10479
|
<xsl:param name="mode">bookmarks</xsl:param>
|
10325
10480
|
<xsl:apply-templates mode="contents_item">
|
10326
10481
|
<xsl:with-param name="mode" select="$mode"/>
|
@@ -11159,113 +11314,114 @@
|
|
11159
11314
|
-->
|
11160
11315
|
<xsl:template match="*[local-name() = 'example']">
|
11161
11316
|
|
11162
|
-
|
11317
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
11163
11318
|
|
11164
|
-
|
11165
|
-
|
11166
|
-
<xsl:call-template name="refine_example-style"/>
|
11319
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
11167
11320
|
|
11168
|
-
|
11169
|
-
<xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
|
11321
|
+
<xsl:call-template name="refine_example-style"/>
|
11170
11322
|
|
11171
|
-
|
11172
|
-
|
11173
|
-
<xsl:when test="count(*[not(local-name() = 'name')]) = 1">inline</xsl:when>
|
11174
|
-
<xsl:otherwise>block</xsl:otherwise>
|
11175
|
-
</xsl:choose>
|
11323
|
+
<xsl:variable name="fo_element">
|
11324
|
+
<xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
|
11176
11325
|
|
11177
|
-
|
11326
|
+
<xsl:choose>
|
11327
|
+
<!-- if example contains only one (except 'name') element (paragraph for example), then display it on the same line as EXAMPLE title -->
|
11328
|
+
<xsl:when test="count(*[not(local-name() = 'name')]) = 1">inline</xsl:when>
|
11329
|
+
<xsl:otherwise>block</xsl:otherwise>
|
11330
|
+
</xsl:choose>
|
11178
11331
|
|
11179
|
-
|
11332
|
+
</xsl:variable>
|
11180
11333
|
|
11181
|
-
|
11334
|
+
<fo:block-container margin-left="0mm" role="SKIP">
|
11182
11335
|
|
11183
|
-
|
11336
|
+
<xsl:choose>
|
11184
11337
|
|
11185
|
-
|
11186
|
-
<fo:block>
|
11187
|
-
<xsl:apply-templates select="*[local-name()='name']">
|
11188
|
-
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11189
|
-
</xsl:apply-templates>
|
11190
|
-
</fo:block>
|
11338
|
+
<xsl:when test="contains(normalize-space($fo_element), 'block')">
|
11191
11339
|
|
11192
|
-
|
11193
|
-
|
11194
|
-
|
11195
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
11340
|
+
<!-- display name 'EXAMPLE' in a separate block -->
|
11341
|
+
<fo:block>
|
11342
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
11196
11343
|
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11197
11344
|
</xsl:apply-templates>
|
11345
|
+
</fo:block>
|
11346
|
+
|
11347
|
+
<fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
|
11348
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
11349
|
+
<xsl:variable name="example_body">
|
11350
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
11351
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11352
|
+
</xsl:apply-templates>
|
11353
|
+
</xsl:variable>
|
11354
|
+
<xsl:choose>
|
11355
|
+
<xsl:when test="xalan:nodeset($example_body)/*">
|
11356
|
+
<xsl:copy-of select="$example_body"/>
|
11357
|
+
</xsl:when>
|
11358
|
+
<xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
|
11359
|
+
</xsl:choose>
|
11360
|
+
</fo:block-container>
|
11361
|
+
</fo:block-container>
|
11362
|
+
</xsl:when> <!-- end block -->
|
11363
|
+
|
11364
|
+
<xsl:when test="contains(normalize-space($fo_element), 'list')">
|
11365
|
+
|
11366
|
+
<xsl:variable name="provisional_distance_between_starts_">
|
11367
|
+
7
|
11198
11368
|
</xsl:variable>
|
11199
|
-
<xsl:
|
11200
|
-
|
11201
|
-
|
11202
|
-
|
11203
|
-
|
11204
|
-
</xsl:choose>
|
11205
|
-
</fo:block-container>
|
11206
|
-
</fo:block-container>
|
11207
|
-
</xsl:when> <!-- end block -->
|
11369
|
+
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
|
11370
|
+
<xsl:variable name="indent_">
|
11371
|
+
0
|
11372
|
+
</xsl:variable>
|
11373
|
+
<xsl:variable name="indent" select="normalize-space($indent_)"/>
|
11208
11374
|
|
11209
|
-
|
11375
|
+
<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
|
11376
|
+
<fo:list-item>
|
11377
|
+
<fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
|
11378
|
+
<fo:block>
|
11379
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
11380
|
+
<xsl:with-param name="fo_element">block</xsl:with-param>
|
11381
|
+
</xsl:apply-templates>
|
11382
|
+
</fo:block>
|
11383
|
+
</fo:list-item-label>
|
11384
|
+
<fo:list-item-body start-indent="body-start()">
|
11385
|
+
<fo:block>
|
11386
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
11387
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11388
|
+
</xsl:apply-templates>
|
11389
|
+
</fo:block>
|
11390
|
+
</fo:list-item-body>
|
11391
|
+
</fo:list-item>
|
11392
|
+
</fo:list-block>
|
11393
|
+
</xsl:when> <!-- end list -->
|
11210
11394
|
|
11211
|
-
|
11212
|
-
7
|
11213
|
-
</xsl:variable>
|
11214
|
-
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
|
11215
|
-
<xsl:variable name="indent_">
|
11216
|
-
0
|
11217
|
-
</xsl:variable>
|
11218
|
-
<xsl:variable name="indent" select="normalize-space($indent_)"/>
|
11395
|
+
<xsl:otherwise> <!-- inline -->
|
11219
11396
|
|
11220
|
-
|
11221
|
-
|
11222
|
-
|
11223
|
-
|
11224
|
-
|
11225
|
-
|
11226
|
-
|
11227
|
-
</fo:block>
|
11228
|
-
</fo:list-item-label>
|
11229
|
-
<fo:list-item-body start-indent="body-start()">
|
11230
|
-
<fo:block>
|
11231
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
11397
|
+
<!-- display 'EXAMPLE' and first element in the same line -->
|
11398
|
+
<fo:block>
|
11399
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
11400
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11401
|
+
</xsl:apply-templates>
|
11402
|
+
<fo:inline>
|
11403
|
+
<xsl:apply-templates select="*[not(local-name() = 'name')][1]">
|
11232
11404
|
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11233
11405
|
</xsl:apply-templates>
|
11234
|
-
</fo:
|
11235
|
-
</fo:
|
11236
|
-
</fo:list-item>
|
11237
|
-
</fo:list-block>
|
11238
|
-
</xsl:when> <!-- end list -->
|
11239
|
-
|
11240
|
-
<xsl:otherwise> <!-- inline -->
|
11406
|
+
</fo:inline>
|
11407
|
+
</fo:block>
|
11241
11408
|
|
11242
|
-
|
11243
|
-
|
11244
|
-
|
11245
|
-
|
11246
|
-
|
11247
|
-
|
11248
|
-
|
11249
|
-
|
11250
|
-
|
11251
|
-
|
11252
|
-
|
11409
|
+
<xsl:if test="*[not(local-name() = 'name')][position() > 1]">
|
11410
|
+
<!-- display further elements in blocks -->
|
11411
|
+
<fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
|
11412
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
11413
|
+
<xsl:apply-templates select="*[not(local-name() = 'name')][position() > 1]">
|
11414
|
+
<xsl:with-param name="fo_element" select="'block'"/>
|
11415
|
+
</xsl:apply-templates>
|
11416
|
+
</fo:block-container>
|
11417
|
+
</fo:block-container>
|
11418
|
+
</xsl:if>
|
11419
|
+
</xsl:otherwise> <!-- end inline -->
|
11253
11420
|
|
11254
|
-
|
11255
|
-
|
11256
|
-
|
11257
|
-
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
11258
|
-
<xsl:apply-templates select="*[not(local-name() = 'name')][position() > 1]">
|
11259
|
-
<xsl:with-param name="fo_element" select="'block'"/>
|
11260
|
-
</xsl:apply-templates>
|
11261
|
-
</fo:block-container>
|
11262
|
-
</fo:block-container>
|
11263
|
-
</xsl:if>
|
11264
|
-
</xsl:otherwise> <!-- end inline -->
|
11421
|
+
</xsl:choose>
|
11422
|
+
</fo:block-container>
|
11423
|
+
</fo:block-container>
|
11265
11424
|
|
11266
|
-
</xsl:choose>
|
11267
|
-
</fo:block-container>
|
11268
|
-
</fo:block-container>
|
11269
11425
|
</xsl:template>
|
11270
11426
|
|
11271
11427
|
<xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
|
@@ -11647,6 +11803,15 @@
|
|
11647
11803
|
|
11648
11804
|
</xsl:template> <!-- tab -->
|
11649
11805
|
|
11806
|
+
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
|
11807
|
+
<xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
|
11808
|
+
|
11809
|
+
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab">
|
11810
|
+
|
11811
|
+
<xsl:attribute name="padding-right">6mm</xsl:attribute>
|
11812
|
+
|
11813
|
+
</xsl:template>
|
11814
|
+
|
11650
11815
|
<xsl:template name="insertNonBreakSpaces">
|
11651
11816
|
<xsl:param name="count"/>
|
11652
11817
|
<xsl:if test="$count > 0">
|
@@ -13193,6 +13358,10 @@
|
|
13193
13358
|
<!-- - Remove semantic xml part -->
|
13194
13359
|
<!-- - Remove image/emf (EMF vector image for Word) -->
|
13195
13360
|
<!-- - add @id, redundant for table auto-layout algorithm -->
|
13361
|
+
<!-- - process 'passthrough' element -->
|
13362
|
+
<!-- - split math by element with @linebreak into maths -->
|
13363
|
+
<!-- - rename fmt-title to title, fmt-name to name and another changes to convert new presentation XML to -->
|
13364
|
+
<!-- - old XML without significant changes in XSLT -->
|
13196
13365
|
<!-- =========================================================================== -->
|
13197
13366
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
13198
13367
|
<xsl:copy>
|
@@ -13200,6 +13369,12 @@
|
|
13200
13369
|
</xsl:copy>
|
13201
13370
|
</xsl:template>
|
13202
13371
|
|
13372
|
+
<xsl:template match="@*|node()" mode="update_xml_pres">
|
13373
|
+
<xsl:copy>
|
13374
|
+
<xsl:apply-templates select="@*|node()" mode="update_xml_pres"/>
|
13375
|
+
</xsl:copy>
|
13376
|
+
</xsl:template>
|
13377
|
+
|
13203
13378
|
<!-- change section's order based on @displayorder value -->
|
13204
13379
|
<xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
|
13205
13380
|
<xsl:copy>
|
@@ -13276,7 +13451,7 @@
|
|
13276
13451
|
</xsl:template>
|
13277
13452
|
|
13278
13453
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
13279
|
-
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
|
13454
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
13280
13455
|
<xsl:copy>
|
13281
13456
|
<xsl:copy-of select="@*"/>
|
13282
13457
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -13295,14 +13470,17 @@
|
|
13295
13470
|
|
13296
13471
|
<!-- remove semantic xml -->
|
13297
13472
|
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
|
13473
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_pres"/>
|
13298
13474
|
|
13299
13475
|
<!-- remove image/emf -->
|
13300
13476
|
<xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
|
13477
|
+
<xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_pres"/>
|
13301
13478
|
|
13302
13479
|
<!-- remove preprocess-xslt -->
|
13303
13480
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
13481
|
+
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
|
13304
13482
|
|
13305
|
-
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
13483
|
+
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
13306
13484
|
<xsl:copy-of select="."/>
|
13307
13485
|
</xsl:template>
|
13308
13486
|
|
@@ -13384,6 +13562,77 @@
|
|
13384
13562
|
<xsl:copy-of select="$maths"/>
|
13385
13563
|
</xsl:template>
|
13386
13564
|
|
13565
|
+
<!-- update new Presentation XML -->
|
13566
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_step1"/>
|
13567
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_pres"/>
|
13568
|
+
<xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_step1"/>
|
13569
|
+
<xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
|
13570
|
+
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
|
13571
|
+
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
|
13572
|
+
|
13573
|
+
<xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
|
13574
|
+
<xsl:copy>
|
13575
|
+
<xsl:apply-templates select="@*" mode="update_xml_step1"/>
|
13576
|
+
<xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
|
13577
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
13578
|
+
</xsl:copy>
|
13579
|
+
</xsl:template>
|
13580
|
+
<xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_pres">
|
13581
|
+
<xsl:copy>
|
13582
|
+
<xsl:apply-templates select="@*" mode="update_xml_pres"/>
|
13583
|
+
<xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
|
13584
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
13585
|
+
</xsl:copy>
|
13586
|
+
</xsl:template>
|
13587
|
+
|
13588
|
+
<xsl:template match="*[local-name() = 'fmt-title']"/>
|
13589
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
13590
|
+
<xsl:element name="title" namespace="{$namespace_full}">
|
13591
|
+
<xsl:copy-of select="@*"/>
|
13592
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13593
|
+
</xsl:element>
|
13594
|
+
</xsl:template>
|
13595
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
13596
|
+
<xsl:element name="title" namespace="{$namespace_full}">
|
13597
|
+
<xsl:copy-of select="@*"/>
|
13598
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13599
|
+
</xsl:element>
|
13600
|
+
</xsl:template>
|
13601
|
+
|
13602
|
+
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
13603
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
13604
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
13605
|
+
<xsl:copy-of select="@*"/>
|
13606
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13607
|
+
</xsl:element>
|
13608
|
+
</xsl:template>
|
13609
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
|
13610
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
13611
|
+
<xsl:copy-of select="@*"/>
|
13612
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13613
|
+
</xsl:element>
|
13614
|
+
</xsl:template>
|
13615
|
+
|
13616
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
|
13617
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13618
|
+
</xsl:template>
|
13619
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_pres" priority="3">
|
13620
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13621
|
+
</xsl:template>
|
13622
|
+
|
13623
|
+
<xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
|
13624
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13625
|
+
</xsl:template>
|
13626
|
+
<xsl:template match="*[local-name() = 'semx']" mode="update_xml_pres">
|
13627
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13628
|
+
</xsl:template>
|
13629
|
+
|
13630
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']"/>
|
13631
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
|
13632
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
|
13633
|
+
|
13634
|
+
<!-- END: update new Presentation XML -->
|
13635
|
+
|
13387
13636
|
<!-- =========================================================================== -->
|
13388
13637
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
13389
13638
|
<!-- =========================================================================== -->
|
@@ -13576,7 +13825,7 @@
|
|
13576
13825
|
<xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
|
13577
13826
|
<xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
|
13578
13827
|
|
13579
|
-
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
13828
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::*[local-name() = 'name'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
13580
13829
|
|
13581
13830
|
<xsl:variable name="parent" select="local-name(..)"/>
|
13582
13831
|
|
@@ -14155,6 +14404,7 @@
|
|
14155
14404
|
</pdf:catalog>
|
14156
14405
|
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
14157
14406
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
14407
|
+
<!-- Commented after upgrade to Apache FOP 2.10
|
14158
14408
|
<rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
|
14159
14409
|
<pdfaExtension:schemas>
|
14160
14410
|
<rdf:Bag>
|
@@ -14187,7 +14437,7 @@
|
|
14187
14437
|
</rdf:li>
|
14188
14438
|
</rdf:Bag>
|
14189
14439
|
</pdfaExtension:schemas>
|
14190
|
-
</rdf:Description>
|
14440
|
+
</rdf:Description> -->
|
14191
14441
|
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
14192
14442
|
<!-- Dublin Core properties go here -->
|
14193
14443
|
<dc:title>
|
@@ -14234,7 +14484,7 @@
|
|
14234
14484
|
<xsl:variable name="dc_description">
|
14235
14485
|
<xsl:variable name="abstract">
|
14236
14486
|
|
14237
|
-
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
|
14487
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
|
14238
14488
|
|
14239
14489
|
</xsl:variable>
|
14240
14490
|
<rdf:Alt>
|
@@ -14779,31 +15029,123 @@
|
|
14779
15029
|
|
14780
15030
|
<!-- END: insert cover page image -->
|
14781
15031
|
|
14782
|
-
|
15032
|
+
<!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
|
15033
|
+
<xsl:variable name="regex_ja_spec_">[
|
15034
|
+
<!-- Rotate 90° clockwise -->
|
15035
|
+
\u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
|
15036
|
+
\uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
|
15037
|
+
\u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
|
15038
|
+
\uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
|
15039
|
+
\u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
|
15040
|
+
\uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
|
15041
|
+
\u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
|
15042
|
+
\uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
|
15043
|
+
\u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
|
15044
|
+
\u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
|
15045
|
+
\u3010 <!-- U+3010 LEFT BLACK LENTICULAR BRACKET (【) -->
|
15046
|
+
\u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
|
15047
|
+
\u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
|
15048
|
+
\u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
|
15049
|
+
\uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
|
15050
|
+
\u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
|
15051
|
+
\uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
|
15052
|
+
\u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
|
15053
|
+
\u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
|
15054
|
+
\u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
|
15055
|
+
\u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
|
15056
|
+
\uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
|
15057
|
+
\u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
|
15058
|
+
\uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
|
15059
|
+
\u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
|
15060
|
+
\u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
|
15061
|
+
\u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
|
15062
|
+
\u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
|
15063
|
+
|
15064
|
+
\u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
|
15065
|
+
\u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
|
15066
|
+
\u301C <!-- U+301C WAVE DASH (〜) -->
|
15067
|
+
\u3030 <!-- U+3030 WAVY DASH (〰 )-->
|
15068
|
+
\u30FC <!-- U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK (ー) -->
|
15069
|
+
\u2329 <!-- U+2329 LEFT-POINTING ANGLE BRACKET (〈) -->
|
15070
|
+
\u232A <!-- U+232A RIGHT-POINTING ANGLE BRACKET (〉) -->
|
15071
|
+
\u3018 <!-- U+3018 LEFT WHITE TORTOISE SHELL BRACKET (〘) -->
|
15072
|
+
\u3019 <!-- U+3019 RIGHT WHITE TORTOISE SHELL BRACKET (〙) -->
|
15073
|
+
\u30A0 <!-- U+30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN (゠) -->
|
15074
|
+
\uFE59 <!-- U+FE59 SMALL LEFT PARENTHESIS (﹙) -->
|
15075
|
+
\uFE5A <!-- U+FE5A SMALL RIGHT PARENTHESIS (﹚) -->
|
15076
|
+
\uFE5B <!-- U+FE5B SMALL LEFT CURLY BRACKET (﹛) -->
|
15077
|
+
\uFE5C <!-- U+FE5C SMALL RIGHT CURLY BRACKET (﹜) -->
|
15078
|
+
\uFE5D <!-- U+FE5D SMALL LEFT TORTOISE SHELL BRACKET (﹝) -->
|
15079
|
+
\uFE5E <!-- U+FE5E SMALL RIGHT TORTOISE SHELL BRACKET (﹞) -->
|
15080
|
+
\uFF5C <!-- U+FF5C FULLWIDTH VERTICAL LINE (|) -->
|
15081
|
+
\uFF5F <!-- U+FF5F FULLWIDTH LEFT WHITE PARENTHESIS (⦅) -->
|
15082
|
+
\uFF60 <!-- U+FF60 FULLWIDTH RIGHT WHITE PARENTHESIS (⦆) -->
|
15083
|
+
\uFFE3 <!-- U+FFE3 FULLWIDTH MACRON ( ̄) -->
|
15084
|
+
\uFF3F <!-- U+FF3F FULLWIDTH LOW LINE (_) -->
|
15085
|
+
\uFF5E <!-- U+FF5E FULLWIDTH TILDE (~) -->
|
15086
|
+
<!-- Rotate 180° -->
|
15087
|
+
\u309C <!-- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜) -->
|
15088
|
+
\u3002 <!-- U+3002 IDEOGRAPHIC FULL STOP (。) -->
|
15089
|
+
\uFE52 <!-- U+FE52 SMALL FULL STOP (﹒) -->
|
15090
|
+
\uFF0E <!-- U+FF0E FULLWIDTH FULL STOP (.) -->
|
15091
|
+
]</xsl:variable>
|
15092
|
+
<xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
|
14783
15093
|
<xsl:template name="insertVerticalChar">
|
14784
15094
|
<xsl:param name="str"/>
|
14785
15095
|
<xsl:param name="writing-mode">lr-tb</xsl:param>
|
14786
15096
|
<xsl:param name="reference-orientation">90</xsl:param>
|
14787
|
-
<xsl:
|
14788
|
-
|
14789
|
-
|
14790
|
-
|
14791
|
-
|
14792
|
-
|
14793
|
-
<xsl:
|
14794
|
-
|
14795
|
-
<xsl:
|
15097
|
+
<xsl:param name="add_zero_width_space">false</xsl:param>
|
15098
|
+
<xsl:choose>
|
15099
|
+
<xsl:when test="ancestor::*[local-name() = 'span'][@class = 'norotate']">
|
15100
|
+
<xsl:value-of select="$str"/>
|
15101
|
+
</xsl:when>
|
15102
|
+
<xsl:otherwise>
|
15103
|
+
<xsl:if test="string-length($str) > 0">
|
15104
|
+
<xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
|
15105
|
+
<xsl:variable name="char" select="substring($str,1,1)"/>
|
15106
|
+
<fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
|
15107
|
+
<xsl:if test="normalize-space($writing-mode) != ''">
|
15108
|
+
<xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
|
15109
|
+
<xsl:attribute name="reference-orientation">90</xsl:attribute>
|
15110
|
+
</xsl:if>
|
15111
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
|
15112
|
+
<xsl:attribute name="reference-orientation">0</xsl:attribute>
|
15113
|
+
</xsl:if>
|
15114
|
+
<xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
|
15115
|
+
<!-- Rotate 180°:
|
15116
|
+
U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
|
15117
|
+
U+3002 IDEOGRAPHIC FULL STOP (。)
|
15118
|
+
U+FE52 SMALL FULL STOP (﹒)
|
15119
|
+
U+FF0E FULLWIDTH FULL STOP (.)
|
15120
|
+
-->
|
15121
|
+
<xsl:attribute name="reference-orientation">-90</xsl:attribute>
|
15122
|
+
</xsl:if>
|
15123
|
+
<fo:block-container width="1em">
|
15124
|
+
<fo:block line-height="1em">
|
15125
|
+
<xsl:choose>
|
15126
|
+
<xsl:when test="$horizontal_mode = 'true'">
|
15127
|
+
<xsl:value-of select="$str"/>
|
15128
|
+
</xsl:when>
|
15129
|
+
<xsl:otherwise>
|
15130
|
+
<xsl:value-of select="$char"/>
|
15131
|
+
</xsl:otherwise>
|
15132
|
+
</xsl:choose>
|
15133
|
+
</fo:block>
|
15134
|
+
</fo:block-container>
|
15135
|
+
</fo:inline-container>
|
15136
|
+
<xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}')"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
15137
|
+
|
15138
|
+
<xsl:if test="$horizontal_mode = 'false'">
|
15139
|
+
<xsl:call-template name="insertVerticalChar">
|
15140
|
+
<xsl:with-param name="str" select="substring($str, 2)"/>
|
15141
|
+
<xsl:with-param name="writing-mode" select="$writing-mode"/>
|
15142
|
+
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
15143
|
+
<xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
|
15144
|
+
</xsl:call-template>
|
15145
|
+
</xsl:if>
|
14796
15146
|
</xsl:if>
|
14797
|
-
|
14798
|
-
|
14799
|
-
</fo:block-container>
|
14800
|
-
</fo:inline-container>
|
14801
|
-
<xsl:call-template name="insertVerticalChar">
|
14802
|
-
<xsl:with-param name="str" select="substring($str, 2)"/>
|
14803
|
-
<xsl:with-param name="writing-mode" select="$writing-mode"/>
|
14804
|
-
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
14805
|
-
</xsl:call-template>
|
14806
|
-
</xsl:if>
|
15147
|
+
</xsl:otherwise>
|
15148
|
+
</xsl:choose>
|
14807
15149
|
</xsl:template>
|
14808
15150
|
|
14809
15151
|
<xsl:template name="number-to-words">
|
@@ -3,9 +3,13 @@ module IsoDoc
|
|
3
3
|
class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
|
4
4
|
def termclause1(elem)
|
5
5
|
@is_iev or return clause1(elem)
|
6
|
-
@suppressheadingnumbers || elem["unnumbered"]
|
7
|
-
lbl = @xrefs.anchor(elem["id"], :label, true)
|
8
|
-
|
6
|
+
@suppressheadingnumbers || elem["unnumbered"] or
|
7
|
+
lbl = @xrefs.anchor(elem["id"], :label, true)
|
8
|
+
if lbl
|
9
|
+
prefix_name(elem, { caption: " " }, "#{lbl}#{clausedelim}", "title")
|
10
|
+
else
|
11
|
+
prefix_name(elem, {}, nil, "title")
|
12
|
+
end
|
9
13
|
end
|
10
14
|
|
11
15
|
def concept(docxml)
|
@@ -15,9 +19,9 @@ module IsoDoc
|
|
15
19
|
|
16
20
|
def concept_iev(docxml)
|
17
21
|
labels = @xrefs.get_anchors.each_with_object({}) do |(k, v), m|
|
18
|
-
m[v[:label]] = k
|
22
|
+
v[:label] and m[v[:label].gsub(%r{</?[^>]+>}, "")] = k
|
19
23
|
end
|
20
|
-
docpart = docxml
|
24
|
+
docpart = docxml.at(ns("//bibdata/ext/structuredidentifier/" \
|
21
25
|
"project-number/@part"))&.text or return
|
22
26
|
docxml.xpath(ns("//termref[@base = 'IEV']")).each do |t|
|
23
27
|
concept_iev1(t, docpart, labels)
|
@@ -51,10 +55,12 @@ module IsoDoc
|
|
51
55
|
docxml.xpath(ns("//term[@language = 'en'][@tag]")).each do |en|
|
52
56
|
fr = docxml.at(ns("//term[@language = 'fr'][@tag = '#{en['tag']}']"))
|
53
57
|
merge_fr_into_en_term1(en, fr) if fr
|
58
|
+
en.xpath(ns("./fmt-name | ./fmt-xref-label")).each(&:remove)
|
59
|
+
term1(en)
|
54
60
|
end
|
55
61
|
@xrefs.parse_inclusions(clauses: true).parse docxml
|
56
|
-
docxml.xpath(ns("//term/name")).each(&:remove)
|
57
|
-
term(docxml)
|
62
|
+
#docxml.xpath(ns("//term/fmt-name | //term/fmt-xref")).each(&:remove)
|
63
|
+
#term(docxml)
|
58
64
|
end
|
59
65
|
|
60
66
|
def merge_fr_into_en_term1(en_term, fr_term)
|
@@ -77,8 +83,7 @@ module IsoDoc
|
|
77
83
|
.each_with_object([]) do |d, m|
|
78
84
|
lg = d["language"]
|
79
85
|
d.delete("language")
|
80
|
-
|
81
|
-
|
86
|
+
lgs.include?(lg) and next
|
82
87
|
p = d.parent
|
83
88
|
designation_annotate(p, d.at(ns("./name")))
|
84
89
|
m << { lang: lg, script: Metanorma::Utils.default_script(lg),
|
@@ -174,6 +179,7 @@ module IsoDoc
|
|
174
179
|
|
175
180
|
def termexample1(elem)
|
176
181
|
lg = elem&.at("./ancestor::xmlns:term/@language")&.text
|
182
|
+
#require "debug"; binding.b
|
177
183
|
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
178
184
|
example1(elem)
|
179
185
|
@i18n = @i18n_lg["default"]
|
@@ -185,10 +191,15 @@ module IsoDoc
|
|
185
191
|
|
186
192
|
val = @xrefs.anchor(elem["id"], :value) || "???"
|
187
193
|
lbl = @i18n.termnote.gsub("%", val)
|
188
|
-
ret = @i18n.l10n
|
194
|
+
ret = @i18n.l10n lbl
|
189
195
|
@i18n = @i18n_lg["default"]
|
190
196
|
ret
|
191
197
|
end
|
198
|
+
|
199
|
+
def term1(elem)
|
200
|
+
#require 'debug'; binding.b
|
201
|
+
super
|
202
|
+
end
|
192
203
|
end
|
193
204
|
end
|
194
205
|
end
|
@@ -15,17 +15,15 @@ module IsoDoc
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def clause(docxml)
|
18
|
-
docxml.xpath(ns("//clause
|
19
|
-
"//
|
20
|
-
|
18
|
+
docxml.xpath(ns("//clause | //definitions | //references | //appendix | " \
|
19
|
+
"//introduction | //foreword | //preface/abstract | " \
|
20
|
+
"//acknowledgements | //colophon | //indexsect "))
|
21
21
|
.each do |f|
|
22
22
|
f.parent.name == "annex" &&
|
23
23
|
@xrefs.klass.single_term_clause?(f.parent) and next
|
24
24
|
clause1(f)
|
25
25
|
end
|
26
|
-
docxml.xpath(ns("//terms")).each
|
27
|
-
termclause1(f)
|
28
|
-
end
|
26
|
+
docxml.xpath(ns("//terms")).each { |f| termclause1(f) }
|
29
27
|
end
|
30
28
|
|
31
29
|
def clause1(elem)
|
@@ -65,10 +63,15 @@ module IsoDoc
|
|
65
63
|
<foreword id='_#{UUIDTools::UUID.random_create}'> </foreword>
|
66
64
|
CLAUSE
|
67
65
|
end
|
68
|
-
f
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
insert_foreword_boilerplate(f, b)
|
67
|
+
end
|
68
|
+
|
69
|
+
def insert_foreword_boilerplate(elem, boilerplate)
|
70
|
+
elem.children.empty? and elem.children = " "
|
71
|
+
ins = elem.at(ns("./title")) || elem.children.first.before(" ").previous
|
72
|
+
ins.next = <<~CLAUSE
|
73
|
+
<clause type='boilerplate_legal'>#{to_xml(boilerplate.children)}</clause>
|
74
|
+
CLAUSE
|
72
75
|
end
|
73
76
|
|
74
77
|
def insert_middle_title(docxml)
|
@@ -203,8 +203,7 @@ module IsoDoc
|
|
203
203
|
end
|
204
204
|
|
205
205
|
def annex_name(_annex, name, div)
|
206
|
-
|
207
|
-
|
206
|
+
name.nil? and return
|
208
207
|
div.h1 class: "Annex" do |t|
|
209
208
|
name.children.each { |c2| parse(c2, t) }
|
210
209
|
clause_parse_subtitle(name, t)
|
@@ -216,7 +215,7 @@ module IsoDoc
|
|
216
215
|
div.p **attr_code(class: "formula") do |_p|
|
217
216
|
insert_tab(div, 1)
|
218
217
|
parse(node.at(ns("./stem")), div)
|
219
|
-
if lbl = node&.at(ns("./name"))&.text
|
218
|
+
if lbl = node&.at(ns("./fmt-name"))&.text
|
220
219
|
insert_tab(div, 1)
|
221
220
|
div << lbl
|
222
221
|
end
|
data/lib/isodoc/iec/xref.rb
CHANGED
@@ -18,28 +18,41 @@ module IsoDoc
|
|
18
18
|
return unless @is_iev
|
19
19
|
|
20
20
|
if @parse_settings.empty? || @parse_settings[:clauses]
|
21
|
+
@terms_iev_names = true
|
21
22
|
terms_iev_names(docxml)
|
23
|
+
@terms_iev_names = false
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
27
|
def terms_iev_names(docxml)
|
26
28
|
docxml.xpath(ns("//sections/clause/terms")).each_with_index do |t, i|
|
27
|
-
num = "#{@iev_part}-%02d" % [i + 1]
|
29
|
+
num = semx(t, "#{@iev_part}-%02d" % [i + 1])
|
28
30
|
@anchors[t["id"]] =
|
29
|
-
{ label: num,
|
31
|
+
{ label: num,
|
32
|
+
#xref: l10n("#{@labels['section_iev']} #{num}"),
|
33
|
+
xref: labelled_autonum(@labels['section_iev'], num),
|
30
34
|
level: 2, type: "clause", elem: @labels["section_iev"] }
|
31
35
|
t.xpath(ns("./term")).each_with_index do |c, j|
|
32
|
-
num2 = "%02d" % [j + 1]
|
33
|
-
section_names1(c, "#{num}
|
36
|
+
num2 = semx(c, "%02d" % [j + 1])
|
37
|
+
#section_names1(c, "#{num}#{delim_wrap("-")}#{num2}", 3)
|
38
|
+
section_names1(c, num, num2, 3)
|
34
39
|
end
|
35
40
|
end
|
36
41
|
end
|
37
42
|
|
43
|
+
def clausesep
|
44
|
+
if @terms_iev_names then "-"
|
45
|
+
else super
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
38
49
|
def annex_name_lbl(clause, num)
|
39
50
|
obl = l10n("(#{@labels['inform_annex']})")
|
40
51
|
clause["obligation"] == "normative" and
|
41
52
|
obl = l10n("(#{@labels['norm_annex']})")
|
42
|
-
|
53
|
+
obl = "<span class='fmt-obligation'>#{l10n obl}</fmt>"
|
54
|
+
s = labelled_autonum(@labels['annex'], num)
|
55
|
+
l10n("<strong><span class='fmt-caption-label'>#{s}</span></strong><br/>#{obl}")
|
43
56
|
end
|
44
57
|
end
|
45
58
|
end
|
@@ -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.4.
|
20
|
+
<!-- VERSION v1.4.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">
|
data/metanorma-iec.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
31
31
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
|
32
32
|
|
33
|
-
spec.add_dependency "metanorma-iso", "~> 2.9.
|
33
|
+
spec.add_dependency "metanorma-iso", "~> 2.9.1"
|
34
34
|
spec.add_dependency "pubid"
|
35
35
|
|
36
36
|
spec.add_development_dependency "debug"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.9.
|
19
|
+
version: 2.9.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.9.
|
26
|
+
version: 2.9.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pubid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|