metanorma-itu 2.5.5 → 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/itu/base_convert.rb +2 -22
- data/lib/isodoc/itu/cleanup.rb +1 -1
- data/lib/isodoc/itu/itu.implementers-guide.xsl +299 -78
- data/lib/isodoc/itu/itu.in-force.xsl +299 -78
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +299 -78
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +299 -78
- data/lib/isodoc/itu/itu.recommendation.xsl +299 -78
- data/lib/isodoc/itu/itu.resolution.xsl +299 -78
- data/lib/isodoc/itu/itu.service-publication.xsl +299 -78
- data/lib/isodoc/itu/itu.technical-paper.xsl +299 -78
- data/lib/isodoc/itu/itu.technical-report.xsl +299 -78
- data/lib/isodoc/itu/presentation_ref.rb +29 -2
- data/lib/isodoc/itu/presentation_xml_convert.rb +57 -19
- data/lib/isodoc/itu/ref.rb +4 -32
- data/lib/isodoc/itu/terms.rb +1 -14
- data/lib/isodoc/itu/word_cleanup.rb +2 -2
- data/lib/isodoc/itu/word_convert.rb +1 -1
- data/lib/isodoc/itu/xref.rb +0 -6
- data/lib/isodoc/itu/xref_section.rb +3 -3
- data/lib/metanorma/itu/cleanup.rb +0 -16
- data/lib/metanorma/itu/front.rb +1 -18
- data/lib/metanorma/itu/isodoc.rng +1 -1
- data/lib/metanorma/itu/version.rb +1 -1
- data/lib/nokogiri/xml.rb +10 -0
- data/metanorma-itu.gemspec +1 -1
- metadata +5 -4
@@ -1938,6 +1938,7 @@
|
|
1938
1938
|
</xsl:choose>
|
1939
1939
|
<fo:block>
|
1940
1940
|
<xsl:call-template name="setId"/>
|
1941
|
+
<xsl:call-template name="addReviewHelper"/>
|
1941
1942
|
<xsl:apply-templates/>
|
1942
1943
|
</fo:block>
|
1943
1944
|
</xsl:template>
|
@@ -2073,19 +2074,25 @@
|
|
2073
2074
|
</fo:block>
|
2074
2075
|
<xsl:if test="$doctype != 'resolution'">
|
2075
2076
|
<fo:block font-size="12pt" font-weight="normal" margin-top="6pt">
|
2076
|
-
<xsl:choose>
|
2077
|
+
<!-- <xsl:choose>
|
2077
2078
|
<xsl:when test="parent::*[@obligation = 'informative']">
|
2078
2079
|
<xsl:text>(This appendix does not form an integral part of this Recommendation.)</xsl:text>
|
2079
2080
|
</xsl:when>
|
2080
2081
|
<xsl:otherwise>
|
2081
2082
|
<xsl:text>(This annex forms an integral part of this Recommendation.)</xsl:text>
|
2082
2083
|
</xsl:otherwise>
|
2083
|
-
</xsl:choose>
|
2084
|
+
</xsl:choose> -->
|
2085
|
+
<!-- Added for https://github.com/metanorma/isodoc/issues/614 -->
|
2086
|
+
<xsl:apply-templates select="following-sibling::itu:p[not(preceding-sibling::itu:clause)][starts-with(normalize-space(), '(')]/node()"/>
|
2084
2087
|
</fo:block>
|
2085
2088
|
</xsl:if>
|
2086
2089
|
</fo:block>
|
2087
2090
|
</xsl:template>
|
2088
2091
|
|
2092
|
+
<!-- Added for https://github.com/metanorma/isodoc/issues/614 -->
|
2093
|
+
<!-- renders in the annex/title template -->
|
2094
|
+
<xsl:template match="itu:annex/itu:p[preceding-sibling::*[1][self::itu:title or self::itu:variant-title]][starts-with(normalize-space(), '(')]" priority="3"/>
|
2095
|
+
|
2089
2096
|
<!-- Bibliography -->
|
2090
2097
|
<xsl:template match="itu:references[not(@normative='true')]/itu:title">
|
2091
2098
|
<fo:block font-size="14pt" font-weight="bold" text-align="center" margin-bottom="18pt" role="H1">
|
@@ -2225,32 +2232,50 @@
|
|
2225
2232
|
<xsl:call-template name="setStyle_preferred"/>
|
2226
2233
|
<xsl:apply-templates/>
|
2227
2234
|
</fo:inline>
|
2228
|
-
<xsl:if test="../itu:termsource
|
2229
|
-
|
2235
|
+
<xsl:if test="../itu:termsource">
|
2236
|
+
<!-- https://github.com/metanorma/isodoc/issues/614 -->
|
2237
|
+
<!-- <xsl:text>: </xsl:text> -->
|
2238
|
+
<xsl:text> </xsl:text>
|
2230
2239
|
<xsl:variable name="citeas" select="../itu:termsource/itu:origin/@citeas"/>
|
2231
2240
|
<xsl:variable name="bibitemid" select="../itu:termsource/itu:origin/@bibitemid"/>
|
2232
2241
|
<xsl:variable name="origin_text" select="normalize-space(../itu:termsource/itu:origin/text())"/>
|
2233
2242
|
|
2234
|
-
<xsl:
|
2235
|
-
<xsl:
|
2236
|
-
<
|
2237
|
-
<xsl:
|
2238
|
-
<
|
2239
|
-
<xsl:
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2247
|
-
|
2248
|
-
|
2249
|
-
|
2250
|
-
|
2243
|
+
<xsl:choose>
|
2244
|
+
<xsl:when test="$origin_text != '' or $citeas != ''">
|
2245
|
+
<xsl:call-template name="insert_basic_link">
|
2246
|
+
<xsl:with-param name="element">
|
2247
|
+
<fo:basic-link internal-destination="{$bibitemid}" fox:alt-text="{$citeas}">
|
2248
|
+
<xsl:choose>
|
2249
|
+
<xsl:when test="$origin_text != ''">
|
2250
|
+
<xsl:text> </xsl:text><xsl:apply-templates select="../itu:termsource/itu:origin/node()"/>
|
2251
|
+
</xsl:when>
|
2252
|
+
<!-- https://github.com/metanorma/isodoc/issues/614 -->
|
2253
|
+
<!-- <xsl:when test="contains($citeas, '[')">
|
2254
|
+
<xsl:text> </xsl:text><xsl:value-of select="$citeas"/>disable-output-escaping="yes"
|
2255
|
+
</xsl:when>
|
2256
|
+
<xsl:otherwise>
|
2257
|
+
<xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
|
2258
|
+
</xsl:otherwise> -->
|
2259
|
+
<xsl:otherwise>
|
2260
|
+
<xsl:text> </xsl:text><xsl:value-of select="$citeas"/>
|
2261
|
+
</xsl:otherwise>
|
2262
|
+
</xsl:choose>
|
2263
|
+
</fo:basic-link>
|
2264
|
+
</xsl:with-param>
|
2265
|
+
</xsl:call-template>
|
2266
|
+
</xsl:when>
|
2267
|
+
<xsl:otherwise>
|
2268
|
+
<xsl:apply-templates select="../itu:termsource">
|
2269
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
2270
|
+
</xsl:apply-templates>
|
2271
|
+
</xsl:otherwise>
|
2272
|
+
</xsl:choose>
|
2251
2273
|
</xsl:if>
|
2252
2274
|
<xsl:if test="following-sibling::itu:definition/node()">
|
2253
|
-
<xsl:
|
2275
|
+
<xsl:if test="../itu:termsource">
|
2276
|
+
<xsl:text>:</xsl:text>
|
2277
|
+
</xsl:if>
|
2278
|
+
<xsl:text> </xsl:text>
|
2254
2279
|
<!-- <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/> -->
|
2255
2280
|
<xsl:apply-templates select="following-sibling::itu:definition">
|
2256
2281
|
<xsl:with-param name="process">true</xsl:with-param>
|
@@ -2262,7 +2287,12 @@
|
|
2262
2287
|
</xsl:if> -->
|
2263
2288
|
</xsl:template> <!-- preferred -->
|
2264
2289
|
|
2265
|
-
<xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2"
|
2290
|
+
<xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2">
|
2291
|
+
<xsl:param name="process">false</xsl:param>
|
2292
|
+
<xsl:if test="$process = 'true'">
|
2293
|
+
<xsl:apply-templates/>
|
2294
|
+
</xsl:if>
|
2295
|
+
</xsl:template>
|
2266
2296
|
|
2267
2297
|
<xsl:template match="itu:term[itu:preferred]/itu:definition" priority="2">
|
2268
2298
|
<xsl:param name="process">false</xsl:param>
|
@@ -6150,10 +6180,14 @@
|
|
6150
6180
|
<xsl:variable name="fn_styles">
|
6151
6181
|
<xsl:choose>
|
6152
6182
|
<xsl:when test="ancestor::*[local-name() = 'bibitem']">
|
6153
|
-
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"
|
6183
|
+
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
|
6184
|
+
|
6185
|
+
</fn_styles>
|
6154
6186
|
</xsl:when>
|
6155
6187
|
<xsl:otherwise>
|
6156
|
-
<fn_styles xsl:use-attribute-sets="fn-num-style"
|
6188
|
+
<fn_styles xsl:use-attribute-sets="fn-num-style">
|
6189
|
+
|
6190
|
+
</fn_styles>
|
6157
6191
|
</xsl:otherwise>
|
6158
6192
|
</xsl:choose>
|
6159
6193
|
</xsl:variable>
|
@@ -6292,7 +6326,10 @@
|
|
6292
6326
|
|
6293
6327
|
<xsl:value-of select="@reference"/>
|
6294
6328
|
|
6329
|
+
<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
|
6330
|
+
<!-- <xsl:if test="$namespace = 'itu'">
|
6295
6331
|
<xsl:text>)</xsl:text>
|
6332
|
+
</xsl:if> -->
|
6296
6333
|
|
6297
6334
|
</fo:inline>
|
6298
6335
|
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
@@ -6303,7 +6340,7 @@
|
|
6303
6340
|
|
6304
6341
|
</xsl:if>
|
6305
6342
|
</xsl:for-each>
|
6306
|
-
</xsl:template>
|
6343
|
+
</xsl:template> <!-- table_fn_display -->
|
6307
6344
|
|
6308
6345
|
<xsl:template name="create_fn">
|
6309
6346
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -6335,8 +6372,10 @@
|
|
6335
6372
|
<!-- EMD table's footnotes rendering -->
|
6336
6373
|
<!-- ============================ -->
|
6337
6374
|
|
6375
|
+
<!-- ============================ -->
|
6338
6376
|
<!-- figure's footnotes rendering -->
|
6339
|
-
|
6377
|
+
<!-- ============================ -->
|
6378
|
+
<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
|
6340
6379
|
|
6341
6380
|
<!-- current figure id -->
|
6342
6381
|
<xsl:variable name="figure_id_">
|
@@ -6449,9 +6488,28 @@
|
|
6449
6488
|
|
6450
6489
|
</fo:block>
|
6451
6490
|
</xsl:if>
|
6452
|
-
|
6453
6491
|
</xsl:template> <!-- fn_display_figure -->
|
6454
6492
|
|
6493
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
6494
|
+
<!-- figure's footnote label -->
|
6495
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
|
6496
|
+
<xsl:variable name="key_iso">
|
6497
|
+
|
6498
|
+
</xsl:variable>
|
6499
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
6500
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
6501
|
+
|
6502
|
+
</xsl:if>
|
6503
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
|
6504
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
6505
|
+
<xsl:apply-templates/>
|
6506
|
+
</fo:inline>
|
6507
|
+
</xsl:template>
|
6508
|
+
|
6509
|
+
<!-- ============================ -->
|
6510
|
+
<!-- END: figure's footnotes rendering -->
|
6511
|
+
<!-- ============================ -->
|
6512
|
+
|
6455
6513
|
<!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
|
6456
6514
|
<xsl:template match="*[local-name()='fn']">
|
6457
6515
|
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
@@ -6467,6 +6525,10 @@
|
|
6467
6525
|
|
6468
6526
|
<xsl:value-of select="@reference"/>
|
6469
6527
|
|
6528
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
6529
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
6530
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
6531
|
+
</xsl:if> -->
|
6470
6532
|
</fo:basic-link>
|
6471
6533
|
</fo:inline>
|
6472
6534
|
</xsl:template>
|
@@ -6627,17 +6689,22 @@
|
|
6627
6689
|
</fo:block>
|
6628
6690
|
</xsl:when> <!-- END: a few components -->
|
6629
6691
|
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
|
6630
|
-
|
6692
|
+
<!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
|
6693
|
+
<xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
|
6631
6694
|
|
6632
|
-
|
6695
|
+
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
|
6633
6696
|
|
6634
|
-
|
6635
|
-
|
6636
|
-
|
6637
|
-
|
6638
|
-
|
6639
|
-
|
6640
|
-
|
6697
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
6698
|
+
|
6699
|
+
<xsl:variable name="title-key">
|
6700
|
+
<xsl:call-template name="getLocalizedString">
|
6701
|
+
<xsl:with-param name="key">key</xsl:with-param>
|
6702
|
+
</xsl:call-template>
|
6703
|
+
</xsl:variable>
|
6704
|
+
<xsl:value-of select="$title-key"/>
|
6705
|
+
</fo:block>
|
6706
|
+
|
6707
|
+
</xsl:if>
|
6641
6708
|
</xsl:when> <!-- END: definition list in a figure -->
|
6642
6709
|
</xsl:choose>
|
6643
6710
|
|
@@ -6823,6 +6890,14 @@
|
|
6823
6890
|
|
6824
6891
|
</xsl:template> <!-- END: dl -->
|
6825
6892
|
|
6893
|
+
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
6894
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
6895
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
6896
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
6897
|
+
<xsl:apply-templates/>
|
6898
|
+
</fo:block>
|
6899
|
+
</xsl:template>
|
6900
|
+
|
6826
6901
|
<xsl:template name="refine_dl_formula_where_style">
|
6827
6902
|
|
6828
6903
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
@@ -8865,6 +8940,39 @@
|
|
8865
8940
|
</xsl:copy>
|
8866
8941
|
</xsl:template>
|
8867
8942
|
|
8943
|
+
<xsl:template match="@*|node()" mode="mathml_linebreak">
|
8944
|
+
<xsl:copy>
|
8945
|
+
<xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
|
8946
|
+
</xsl:copy>
|
8947
|
+
</xsl:template>
|
8948
|
+
|
8949
|
+
<!-- split math into two math -->
|
8950
|
+
<xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
|
8951
|
+
<xsl:variable name="math_elements_tree_">
|
8952
|
+
<xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
|
8953
|
+
<element pos="{position()}">
|
8954
|
+
<xsl:copy-of select="@*[local-name() != 'id']"/>
|
8955
|
+
<xsl:value-of select="name()"/>
|
8956
|
+
</element>
|
8957
|
+
</xsl:for-each>
|
8958
|
+
</xsl:variable>
|
8959
|
+
|
8960
|
+
<xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
|
8961
|
+
|
8962
|
+
<xsl:call-template name="insertClosingElements">
|
8963
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
8964
|
+
</xsl:call-template>
|
8965
|
+
|
8966
|
+
<xsl:element name="br" namespace="{$namespace_full}"/>
|
8967
|
+
|
8968
|
+
<xsl:call-template name="insertOpeningElements">
|
8969
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
8970
|
+
<xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
|
8971
|
+
<xsl:with-param name="add_continue">false</xsl:with-param>
|
8972
|
+
</xsl:call-template>
|
8973
|
+
|
8974
|
+
</xsl:template>
|
8975
|
+
|
8868
8976
|
<!-- Examples:
|
8869
8977
|
<stem type="AsciiMath">x = 1</stem>
|
8870
8978
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
@@ -9066,6 +9174,7 @@
|
|
9066
9174
|
<xsl:if test="string-length(normalize-space()) < 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
|
9067
9175
|
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
9068
9176
|
</xsl:if>
|
9177
|
+
|
9069
9178
|
<xsl:if test="parent::*[local-name() = 'add']">
|
9070
9179
|
<xsl:call-template name="append_add-style"/>
|
9071
9180
|
</xsl:if>
|
@@ -9115,9 +9224,11 @@
|
|
9115
9224
|
</xsl:template>
|
9116
9225
|
|
9117
9226
|
<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
|
9227
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
9118
9228
|
<xsl:if test="normalize-space() != ''">
|
9119
|
-
<xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
|
9120
|
-
</xsl:if>
|
9229
|
+
<xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
|
9230
|
+
</xsl:if> -->
|
9231
|
+
<xsl:apply-templates/>
|
9121
9232
|
</xsl:template>
|
9122
9233
|
|
9123
9234
|
<!-- stem inside formula with name (with formula's number) -->
|
@@ -9174,44 +9285,44 @@
|
|
9174
9285
|
|
9175
9286
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
9176
9287
|
|
9177
|
-
|
9288
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
9178
9289
|
|
9179
|
-
|
9290
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
9180
9291
|
|
9181
|
-
|
9292
|
+
<xsl:call-template name="refine_note-style"/>
|
9182
9293
|
|
9183
|
-
|
9294
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
9184
9295
|
|
9185
|
-
|
9296
|
+
<fo:block>
|
9186
9297
|
|
9187
|
-
|
9298
|
+
<xsl:call-template name="refine_note_block_style"/>
|
9188
9299
|
|
9189
|
-
|
9300
|
+
<fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
|
9190
9301
|
|
9191
|
-
|
9302
|
+
<xsl:call-template name="refine_note-name-style"/>
|
9192
9303
|
|
9193
|
-
|
9194
|
-
|
9195
|
-
|
9196
|
-
|
9197
|
-
|
9304
|
+
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
9305
|
+
<!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
|
9306
|
+
<xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
|
9307
|
+
<xsl:call-template name="append_add-style"/>
|
9308
|
+
</xsl:if>
|
9198
9309
|
|
9199
|
-
|
9200
|
-
|
9201
|
-
|
9202
|
-
|
9203
|
-
|
9204
|
-
|
9310
|
+
<!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
|
9311
|
+
<xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
|
9312
|
+
<xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
|
9313
|
+
<xsl:with-param name="skip">false</xsl:with-param>
|
9314
|
+
</xsl:apply-templates>
|
9315
|
+
</xsl:if>
|
9205
9316
|
|
9206
|
-
|
9317
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
9207
9318
|
|
9208
|
-
|
9319
|
+
</fo:inline>
|
9209
9320
|
|
9210
|
-
|
9211
|
-
|
9321
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
9322
|
+
</fo:block>
|
9212
9323
|
|
9213
|
-
|
9214
|
-
|
9324
|
+
</fo:block-container>
|
9325
|
+
</fo:block-container>
|
9215
9326
|
|
9216
9327
|
</xsl:template>
|
9217
9328
|
|
@@ -9277,8 +9388,17 @@
|
|
9277
9388
|
</xsl:when>
|
9278
9389
|
<xsl:otherwise>
|
9279
9390
|
|
9280
|
-
|
9391
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
9392
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
9393
|
+
<xsl:text>—</xsl:text> em dash —
|
9394
|
+
</xsl:if> -->
|
9395
|
+
<!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
|
9396
|
+
<xsl:text>:</xsl:text>
|
9397
|
+
</xsl:if> -->
|
9281
9398
|
|
9399
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
|
9400
|
+
<xsl:text> – </xsl:text> en dash –
|
9401
|
+
</xsl:if> -->
|
9282
9402
|
</xsl:otherwise>
|
9283
9403
|
</xsl:choose>
|
9284
9404
|
</xsl:variable>
|
@@ -9297,8 +9417,16 @@
|
|
9297
9417
|
</xsl:when>
|
9298
9418
|
<xsl:otherwise>
|
9299
9419
|
|
9300
|
-
|
9301
|
-
|
9420
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
9421
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
9422
|
+
<xsl:text>—</xsl:text> em dash —
|
9423
|
+
</xsl:if> -->
|
9424
|
+
<!-- <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'jcgm'">
|
9425
|
+
<xsl:text>:</xsl:text>
|
9426
|
+
</xsl:if> -->
|
9427
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
|
9428
|
+
<xsl:text> – </xsl:text> en dash –
|
9429
|
+
</xsl:if> -->
|
9302
9430
|
</xsl:otherwise>
|
9303
9431
|
</xsl:choose>
|
9304
9432
|
</xsl:variable>
|
@@ -11466,7 +11594,7 @@
|
|
11466
11594
|
<xsl:if test="normalize-space() != ''">
|
11467
11595
|
<fo:inline xsl:use-attribute-sets="termexample-name-style">
|
11468
11596
|
<xsl:call-template name="refine_termexample-name-style"/>
|
11469
|
-
<xsl:apply-templates/>
|
11597
|
+
<xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
|
11470
11598
|
</fo:inline>
|
11471
11599
|
</xsl:if>
|
11472
11600
|
</xsl:template>
|
@@ -11621,13 +11749,14 @@
|
|
11621
11749
|
</xsl:when>
|
11622
11750
|
<xsl:when test="contains(normalize-space($fo_element), 'block')">
|
11623
11751
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
11752
|
+
|
11624
11753
|
<xsl:apply-templates/>
|
11625
11754
|
</fo:block>
|
11626
11755
|
</xsl:when>
|
11627
11756
|
<xsl:otherwise>
|
11628
11757
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
11629
11758
|
<xsl:call-template name="refine_example-name-style"/>
|
11630
|
-
<xsl:apply-templates/>
|
11759
|
+
<xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
|
11631
11760
|
</fo:inline>
|
11632
11761
|
</xsl:otherwise>
|
11633
11762
|
</xsl:choose>
|
@@ -11636,6 +11765,7 @@
|
|
11636
11765
|
|
11637
11766
|
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
|
11638
11767
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
11768
|
+
|
11639
11769
|
<xsl:apply-templates/>
|
11640
11770
|
</fo:inline>
|
11641
11771
|
</xsl:template>
|
@@ -11808,15 +11938,17 @@
|
|
11808
11938
|
|
11809
11939
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
11810
11940
|
<fo:block role="BlockQuote">
|
11811
|
-
<xsl:apply-templates select="./node()[not(local-name() = 'author') and
|
11941
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source') and not(local-name() = 'attribution')]"/> <!-- process all nested nodes, except author and source -->
|
11812
11942
|
</fo:block>
|
11813
11943
|
</fo:block-container>
|
11814
11944
|
</fo:block-container>
|
11815
|
-
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
11945
|
+
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
|
11816
11946
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
11817
11947
|
<!-- — ISO, ISO 7301:2011, Clause 1 -->
|
11818
11948
|
<xsl:apply-templates select="*[local-name() = 'author']"/>
|
11819
11949
|
<xsl:apply-templates select="*[local-name() = 'source']"/>
|
11950
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
11951
|
+
<xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
|
11820
11952
|
</fo:block>
|
11821
11953
|
</xsl:if>
|
11822
11954
|
|
@@ -11838,9 +11970,13 @@
|
|
11838
11970
|
</xsl:template>
|
11839
11971
|
|
11840
11972
|
<xsl:template match="*[local-name() = 'author']">
|
11841
|
-
<xsl:
|
11973
|
+
<xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
|
11974
|
+
<xsl:text>— </xsl:text>
|
11975
|
+
</xsl:if>
|
11842
11976
|
<xsl:apply-templates/>
|
11843
11977
|
</xsl:template>
|
11978
|
+
|
11979
|
+
<xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
|
11844
11980
|
<!-- ====== -->
|
11845
11981
|
<!-- ====== -->
|
11846
11982
|
|
@@ -12007,20 +12143,26 @@
|
|
12007
12143
|
|
12008
12144
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
|
12009
12145
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
12146
|
+
|
12010
12147
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
12011
12148
|
</fo:block>
|
12012
12149
|
</xsl:if>
|
12013
12150
|
|
12014
12151
|
<fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
|
12015
12152
|
<xsl:call-template name="setStyle_preferred"/>
|
12153
|
+
|
12016
12154
|
<xsl:apply-templates/>
|
12017
12155
|
</fo:block>
|
12018
12156
|
</fo:block>
|
12019
12157
|
</xsl:template>
|
12020
12158
|
|
12021
12159
|
<xsl:template match="*[local-name() = 'domain']">
|
12160
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
12022
12161
|
<fo:inline xsl:use-attribute-sets="domain-style"><<xsl:apply-templates/>></fo:inline>
|
12023
|
-
<xsl:text> </xsl:text>
|
12162
|
+
<xsl:text> </xsl:text> -->
|
12163
|
+
<xsl:if test="not(@hidden = 'true')">
|
12164
|
+
<xsl:apply-templates/>
|
12165
|
+
</xsl:if>
|
12024
12166
|
</xsl:template>
|
12025
12167
|
|
12026
12168
|
<xsl:template match="*[local-name() = 'admitted']">
|
@@ -12068,6 +12210,29 @@
|
|
12068
12210
|
<!-- END definition -->
|
12069
12211
|
<!-- ========== -->
|
12070
12212
|
|
12213
|
+
<xsl:variable name="reviews_">
|
12214
|
+
<xsl:for-each select="//*[local-name() = 'review'][@from]">
|
12215
|
+
<xsl:copy>
|
12216
|
+
<xsl:copy-of select="@from"/>
|
12217
|
+
<xsl:copy-of select="@id"/>
|
12218
|
+
</xsl:copy>
|
12219
|
+
</xsl:for-each>
|
12220
|
+
</xsl:variable>
|
12221
|
+
<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
|
12222
|
+
|
12223
|
+
<xsl:template name="addReviewHelper">
|
12224
|
+
<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
|
12225
|
+
<xsl:variable name="curr_id" select="@id"/>
|
12226
|
+
<xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
|
12227
|
+
<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
|
12228
|
+
<fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
12229
|
+
</xsl:if>
|
12230
|
+
<!-- <fo:block>
|
12231
|
+
<curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
12232
|
+
<xsl:copy-of select="$reviews"/>
|
12233
|
+
</fo:block> -->
|
12234
|
+
</xsl:template>
|
12235
|
+
|
12071
12236
|
<!-- main sections -->
|
12072
12237
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
12073
12238
|
|
@@ -12076,6 +12241,8 @@
|
|
12076
12241
|
|
12077
12242
|
<xsl:call-template name="sections_element_style"/>
|
12078
12243
|
|
12244
|
+
<xsl:call-template name="addReviewHelper"/>
|
12245
|
+
|
12079
12246
|
<xsl:apply-templates/>
|
12080
12247
|
</fo:block>
|
12081
12248
|
|
@@ -12118,6 +12285,7 @@
|
|
12118
12285
|
|
12119
12286
|
<fo:block>
|
12120
12287
|
<xsl:call-template name="setId"/>
|
12288
|
+
<xsl:call-template name="addReviewHelper"/>
|
12121
12289
|
<xsl:apply-templates/>
|
12122
12290
|
</fo:block>
|
12123
12291
|
</xsl:template>
|
@@ -12154,6 +12322,8 @@
|
|
12154
12322
|
|
12155
12323
|
<xsl:call-template name="refine_clause_style"/>
|
12156
12324
|
|
12325
|
+
<xsl:call-template name="addReviewHelper"/>
|
12326
|
+
|
12157
12327
|
<xsl:apply-templates/>
|
12158
12328
|
</fo:block>
|
12159
12329
|
</xsl:template>
|
@@ -12210,6 +12380,23 @@
|
|
12210
12380
|
|
12211
12381
|
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
|
12212
12382
|
|
12383
|
+
<xsl:if test="1 = 1">
|
12384
|
+
<xsl:choose>
|
12385
|
+
<!-- if there isn't the attribute '@from', then -->
|
12386
|
+
<xsl:when test="$id_from = ''">
|
12387
|
+
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
12388
|
+
</xsl:when>
|
12389
|
+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
12390
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
12391
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
12392
|
+
</xsl:when>
|
12393
|
+
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
12394
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
12395
|
+
</xsl:when>
|
12396
|
+
</xsl:choose>
|
12397
|
+
</xsl:if>
|
12398
|
+
|
12399
|
+
<xsl:if test="1 = 2">
|
12213
12400
|
<xsl:choose>
|
12214
12401
|
<!-- if there isn't the attribute '@from', then -->
|
12215
12402
|
<xsl:when test="$id_from = ''">
|
@@ -12223,6 +12410,7 @@
|
|
12223
12410
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
12224
12411
|
</xsl:when>
|
12225
12412
|
</xsl:choose>
|
12413
|
+
</xsl:if>
|
12226
12414
|
|
12227
12415
|
</xsl:template>
|
12228
12416
|
|
@@ -13612,7 +13800,7 @@
|
|
13612
13800
|
<!-- remove preprocess-xslt -->
|
13613
13801
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
13614
13802
|
|
13615
|
-
<xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
13803
|
+
<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">
|
13616
13804
|
<xsl:copy-of select="."/>
|
13617
13805
|
</xsl:template>
|
13618
13806
|
|
@@ -13678,6 +13866,22 @@
|
|
13678
13866
|
</xsl:choose>
|
13679
13867
|
</xsl:template>
|
13680
13868
|
|
13869
|
+
<xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
|
13870
|
+
<xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
|
13871
|
+
<!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
|
13872
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
|
13873
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13874
|
+
</xsl:if>
|
13875
|
+
</xsl:template>
|
13876
|
+
|
13877
|
+
<!-- split math by element with @linebreak into maths -->
|
13878
|
+
<xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
|
13879
|
+
<xsl:variable name="maths">
|
13880
|
+
<xsl:apply-templates select="." mode="mathml_linebreak"/>
|
13881
|
+
</xsl:variable>
|
13882
|
+
<xsl:copy-of select="$maths"/>
|
13883
|
+
</xsl:template>
|
13884
|
+
|
13681
13885
|
<!-- =========================================================================== -->
|
13682
13886
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
13683
13887
|
<!-- =========================================================================== -->
|
@@ -13781,6 +13985,8 @@
|
|
13781
13985
|
|
13782
13986
|
<xsl:template name="insertOpeningElements">
|
13783
13987
|
<xsl:param name="tree"/>
|
13988
|
+
<xsl:param name="xmlns"/>
|
13989
|
+
<xsl:param name="add_continue">true</xsl:param>
|
13784
13990
|
<xsl:for-each select="$tree//element">
|
13785
13991
|
<xsl:text disable-output-escaping="yes"><</xsl:text>
|
13786
13992
|
<xsl:value-of select="."/>
|
@@ -13791,7 +13997,8 @@
|
|
13791
13997
|
<xsl:value-of select="."/>
|
13792
13998
|
<xsl:text>"</xsl:text>
|
13793
13999
|
</xsl:for-each>
|
13794
|
-
<xsl:if test="position() = 1"> continue="true"</xsl:if>
|
14000
|
+
<xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
|
14001
|
+
<xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
|
13795
14002
|
<xsl:text disable-output-escaping="yes">></xsl:text>
|
13796
14003
|
<xsl:if test="$debug = 'true'">
|
13797
14004
|
<xsl:message><<xsl:value-of select="."/>></xsl:message>
|
@@ -15001,9 +15208,10 @@
|
|
15001
15208
|
<xsl:template name="insertBackgroundPageImage">
|
15002
15209
|
<xsl:param name="number">1</xsl:param>
|
15003
15210
|
<xsl:param name="name">coverpage-image</xsl:param>
|
15211
|
+
<xsl:param name="suffix"/>
|
15004
15212
|
<xsl:variable name="num" select="number($number)"/>
|
15005
15213
|
<!-- background image -->
|
15006
|
-
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="
|
15214
|
+
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
|
15007
15215
|
<fo:block>
|
15008
15216
|
<xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
|
15009
15217
|
<xsl:choose>
|
@@ -15069,16 +15277,29 @@
|
|
15069
15277
|
|
15070
15278
|
<!-- END: insert cover page image -->
|
15071
15279
|
|
15280
|
+
<xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
|
15072
15281
|
<xsl:template name="insertVerticalChar">
|
15073
15282
|
<xsl:param name="str"/>
|
15283
|
+
<xsl:param name="writing-mode">lr-tb</xsl:param>
|
15284
|
+
<xsl:param name="reference-orientation">90</xsl:param>
|
15074
15285
|
<xsl:if test="string-length($str) > 0">
|
15075
|
-
<fo:inline-container
|
15286
|
+
<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">
|
15287
|
+
<xsl:if test="normalize-space($writing-mode) != ''">
|
15288
|
+
<xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
|
15289
|
+
<xsl:attribute name="reference-orientation">90</xsl:attribute>
|
15290
|
+
</xsl:if>
|
15291
|
+
<xsl:variable name="char" select="substring($str,1,1)"/>
|
15292
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
|
15293
|
+
<xsl:attribute name="reference-orientation">0</xsl:attribute>
|
15294
|
+
</xsl:if>
|
15076
15295
|
<fo:block-container width="1em">
|
15077
|
-
<fo:block line-height="1em"><xsl:value-of select="
|
15296
|
+
<fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
|
15078
15297
|
</fo:block-container>
|
15079
15298
|
</fo:inline-container>
|
15080
15299
|
<xsl:call-template name="insertVerticalChar">
|
15081
15300
|
<xsl:with-param name="str" select="substring($str, 2)"/>
|
15301
|
+
<xsl:with-param name="writing-mode" select="$writing-mode"/>
|
15302
|
+
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
15082
15303
|
</xsl:call-template>
|
15083
15304
|
</xsl:if>
|
15084
15305
|
</xsl:template>
|