metanorma-itu 2.5.4 → 2.5.5
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 +1 -1
- data/lib/isodoc/itu/cleanup.rb +1 -1
- data/lib/isodoc/itu/html_convert.rb +1 -1
- data/lib/isodoc/itu/i18n.rb +1 -1
- data/lib/isodoc/itu/init.rb +2 -2
- data/lib/isodoc/itu/itu.implementers-guide.xsl +85 -22
- data/lib/isodoc/itu/itu.in-force.xsl +85 -22
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +85 -22
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +85 -22
- data/lib/isodoc/itu/itu.recommendation.xsl +85 -22
- data/lib/isodoc/itu/itu.resolution.xsl +85 -22
- data/lib/isodoc/itu/itu.service-publication.xsl +85 -22
- data/lib/isodoc/itu/itu.technical-paper.xsl +85 -22
- data/lib/isodoc/itu/itu.technical-report.xsl +85 -22
- data/lib/isodoc/itu/metadata.rb +2 -2
- data/lib/isodoc/itu/metadata_date.rb +1 -1
- data/lib/isodoc/itu/pdf_convert.rb +1 -1
- data/lib/isodoc/itu/presentation_bibdata.rb +1 -1
- data/lib/isodoc/itu/presentation_contribution.rb +1 -1
- data/lib/isodoc/itu/presentation_preface.rb +1 -1
- data/lib/isodoc/itu/presentation_ref.rb +1 -1
- data/lib/isodoc/itu/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/itu/ref.rb +1 -1
- data/lib/isodoc/itu/terms.rb +1 -1
- data/lib/isodoc/itu/word_cleanup.rb +1 -1
- data/lib/isodoc/itu/word_convert.rb +1 -1
- data/lib/isodoc/itu/xref.rb +1 -1
- data/lib/isodoc/itu/xref_section.rb +1 -1
- data/lib/isodoc/itu.rb +1 -1
- data/lib/metanorma/itu/biblio-standoc.rng +13 -0
- data/lib/metanorma/itu/biblio.rng +19 -12
- data/lib/metanorma/itu/cleanup.rb +1 -1
- data/lib/metanorma/itu/cleanup_section.rb +1 -1
- data/lib/metanorma/itu/converter.rb +6 -6
- data/lib/metanorma/itu/front.rb +2 -1
- data/lib/metanorma/itu/front_id.rb +1 -1
- data/lib/metanorma/itu/processor.rb +6 -6
- data/lib/metanorma/itu/relaton-itu.rng +1 -0
- data/lib/metanorma/itu/validate.rb +1 -1
- data/lib/metanorma/itu/version.rb +2 -2
- data/lib/metanorma/itu.rb +1 -1
- data/lib/metanorma-itu.rb +1 -1
- data/lib/relaton/render/general.rb +2 -2
- data/lib/relaton/render/parse.rb +1 -1
- data/metanorma-itu.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3261c835429196306df6cfaa35a3fecf9648b1449e13290290ae9db79d50a29
|
4
|
+
data.tar.gz: e5244715d2863c296587a45b7189ccce5f26c0efadcb841593c723b3eb376a95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b6b7b3e5f5e8ca6ac9ceb724f3734454d695d9c9810ec41f10afcae9b7be583b35b31a9d6845650fbaec30725a7c0bbfc86bcc43c9c802e5758644303a551ae
|
7
|
+
data.tar.gz: 36884c6bade781e001e32a614d7d0f6e3d7aaf2fabd625ea398fa631e2f6a963b5ad30d575ef66ec45c86a4638f241c8c12431d25190c8631f4c8e51cca4b388
|
data/lib/isodoc/itu/cleanup.rb
CHANGED
data/lib/isodoc/itu/i18n.rb
CHANGED
data/lib/isodoc/itu/init.rb
CHANGED
@@ -4,7 +4,7 @@ require_relative "xref"
|
|
4
4
|
require_relative "i18n"
|
5
5
|
|
6
6
|
module IsoDoc
|
7
|
-
module
|
7
|
+
module Itu
|
8
8
|
module Init
|
9
9
|
def metadata_init(lang, script, locale, i18n)
|
10
10
|
@meta = Metadata.new(lang, script, locale, i18n)
|
@@ -22,7 +22,7 @@ module IsoDoc
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def bibrenderer(options = {})
|
25
|
-
::Relaton::Render::
|
25
|
+
::Relaton::Render::Itu::General.new(options.merge(language: @lang,
|
26
26
|
i18nhash: @i18n.get))
|
27
27
|
end
|
28
28
|
|
@@ -6131,7 +6131,8 @@
|
|
6131
6131
|
</xsl:choose>
|
6132
6132
|
</xsl:variable>
|
6133
6133
|
<xsl:variable name="current_fn_number_text">
|
6134
|
-
|
6134
|
+
|
6135
|
+
<xsl:value-of select="$current_fn_number"/>
|
6135
6136
|
|
6136
6137
|
</xsl:variable>
|
6137
6138
|
|
@@ -6167,8 +6168,10 @@
|
|
6167
6168
|
|
6168
6169
|
<xsl:call-template name="insert_basic_link">
|
6169
6170
|
<xsl:with-param name="element">
|
6170
|
-
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl"
|
6171
|
-
<
|
6171
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
|
6172
|
+
<fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
|
6173
|
+
<xsl:copy-of select="$current_fn_number_text"/>
|
6174
|
+
</fo:inline>
|
6172
6175
|
</fo:basic-link>
|
6173
6176
|
</xsl:with-param>
|
6174
6177
|
</xsl:call-template>
|
@@ -6455,7 +6458,7 @@
|
|
6455
6458
|
|
6456
6459
|
<xsl:call-template name="refine_fn-reference-style"/>
|
6457
6460
|
|
6458
|
-
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
6461
|
+
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
6459
6462
|
<xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
|
6460
6463
|
<xsl:attribute name="internal-destination">
|
6461
6464
|
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
@@ -7499,9 +7502,19 @@
|
|
7499
7502
|
</fo:inline>
|
7500
7503
|
</xsl:template>
|
7501
7504
|
|
7502
|
-
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
7505
|
+
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
|
7506
|
+
<xsl:param name="txt"/>
|
7503
7507
|
<!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
|
7504
|
-
<xsl:variable name="text"
|
7508
|
+
<xsl:variable name="text">
|
7509
|
+
<xsl:choose>
|
7510
|
+
<xsl:when test="$txt != ''">
|
7511
|
+
<xsl:value-of select="$txt"/>
|
7512
|
+
</xsl:when>
|
7513
|
+
<xsl:otherwise>
|
7514
|
+
<xsl:value-of select="."/>
|
7515
|
+
</xsl:otherwise>
|
7516
|
+
</xsl:choose>
|
7517
|
+
</xsl:variable>
|
7505
7518
|
<xsl:variable name="ratio_">
|
7506
7519
|
0.75
|
7507
7520
|
</xsl:variable>
|
@@ -8947,9 +8960,12 @@
|
|
8947
8960
|
<xsl:apply-templates/>
|
8948
8961
|
</xsl:when>
|
8949
8962
|
<xsl:otherwise>
|
8963
|
+
<xsl:variable name="alt_text">
|
8964
|
+
<xsl:call-template name="getAltText"/>
|
8965
|
+
</xsl:variable>
|
8950
8966
|
<xsl:call-template name="insert_basic_link">
|
8951
8967
|
<xsl:with-param name="element">
|
8952
|
-
<fo:basic-link external-destination="{$target}" fox:alt-text="{$
|
8968
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
|
8953
8969
|
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
8954
8970
|
<xsl:attribute name="role">Annot</xsl:attribute>
|
8955
8971
|
</xsl:if>
|
@@ -8976,6 +8992,14 @@
|
|
8976
8992
|
</fo:inline>
|
8977
8993
|
</xsl:template> <!-- link -->
|
8978
8994
|
|
8995
|
+
<xsl:template name="getAltText">
|
8996
|
+
<xsl:choose>
|
8997
|
+
<xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
|
8998
|
+
<xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
|
8999
|
+
<!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
|
9000
|
+
</xsl:choose>
|
9001
|
+
</xsl:template>
|
9002
|
+
|
8979
9003
|
<!-- ======================== -->
|
8980
9004
|
<!-- Appendix processing -->
|
8981
9005
|
<!-- ======================== -->
|
@@ -9006,7 +9030,7 @@
|
|
9006
9030
|
<xsl:template match="*[local-name() = 'callout']">
|
9007
9031
|
<xsl:choose>
|
9008
9032
|
<xsl:when test="normalize-space(@target) = ''"><<xsl:apply-templates/>></xsl:when>
|
9009
|
-
<xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{
|
9033
|
+
<xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}"><<xsl:apply-templates/>></fo:basic-link></xsl:otherwise>
|
9010
9034
|
</xsl:choose>
|
9011
9035
|
</xsl:template>
|
9012
9036
|
|
@@ -9035,7 +9059,10 @@
|
|
9035
9059
|
<xsl:template match="*[local-name() = 'xref']">
|
9036
9060
|
<xsl:call-template name="insert_basic_link">
|
9037
9061
|
<xsl:with-param name="element">
|
9038
|
-
<
|
9062
|
+
<xsl:variable name="alt_text">
|
9063
|
+
<xsl:call-template name="getAltText"/>
|
9064
|
+
</xsl:variable>
|
9065
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
|
9039
9066
|
<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'])">
|
9040
9067
|
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
9041
9068
|
</xsl:if>
|
@@ -11523,12 +11550,14 @@
|
|
11523
11550
|
|
11524
11551
|
<xsl:when test="contains(normalize-space($fo_element), 'list')">
|
11525
11552
|
|
11526
|
-
<xsl:variable name="
|
11553
|
+
<xsl:variable name="provisional_distance_between_starts_">
|
11527
11554
|
7
|
11528
11555
|
</xsl:variable>
|
11529
|
-
<xsl:variable name="
|
11556
|
+
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
|
11557
|
+
<xsl:variable name="indent_">
|
11530
11558
|
0
|
11531
11559
|
</xsl:variable>
|
11560
|
+
<xsl:variable name="indent" select="normalize-space($indent_)"/>
|
11532
11561
|
|
11533
11562
|
<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
|
11534
11563
|
<fo:list-item>
|
@@ -12260,14 +12289,17 @@
|
|
12260
12289
|
</xsl:when>
|
12261
12290
|
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
|
12262
12291
|
|
12263
|
-
<xsl:variable name="
|
12292
|
+
<xsl:variable name="type" select="../@type"/>
|
12264
12293
|
|
12265
|
-
|
12294
|
+
<xsl:variable name="label">
|
12266
12295
|
|
12267
12296
|
<xsl:variable name="style_prefix_">
|
12268
12297
|
<xsl:if test="$type = 'roman'">
|
12269
12298
|
<!-- Example: (i) -->
|
12270
12299
|
</xsl:if>
|
12300
|
+
<xsl:if test="$type = 'alphabet'">
|
12301
|
+
|
12302
|
+
</xsl:if>
|
12271
12303
|
</xsl:variable>
|
12272
12304
|
<xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
|
12273
12305
|
|
@@ -12293,13 +12325,15 @@
|
|
12293
12325
|
<xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
|
12294
12326
|
<xsl:value-of select="$style_prefix"/>
|
12295
12327
|
</xsl:if>
|
12328
|
+
|
12296
12329
|
<xsl:value-of select="@label"/>
|
12330
|
+
|
12297
12331
|
<xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
|
12298
12332
|
<xsl:value-of select="$style_suffix"/>
|
12299
12333
|
</xsl:if>
|
12300
12334
|
</xsl:variable>
|
12301
12335
|
|
12302
|
-
|
12336
|
+
<xsl:value-of select="normalize-space($label)"/>
|
12303
12337
|
|
12304
12338
|
</xsl:when>
|
12305
12339
|
<xsl:otherwise> <!-- for ordered lists 'ol' -->
|
@@ -14525,7 +14559,8 @@
|
|
14525
14559
|
<xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
|
14526
14560
|
<xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
|
14527
14561
|
<!-- Todo: need update -->
|
14528
|
-
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = '
|
14562
|
+
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
|
14563
|
+
<xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
|
14529
14564
|
|
14530
14565
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
|
14531
14566
|
<xsl:attribute name="src">
|
@@ -14546,6 +14581,9 @@
|
|
14546
14581
|
<xsl:if test="$afrelationship != ''">
|
14547
14582
|
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
|
14548
14583
|
</xsl:if>
|
14584
|
+
<xsl:if test="$volatile != ''">
|
14585
|
+
<xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
|
14586
|
+
</xsl:if>
|
14549
14587
|
</pdf:embedded-file>
|
14550
14588
|
</xsl:for-each>
|
14551
14589
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
@@ -14556,14 +14594,18 @@
|
|
14556
14594
|
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
|
14557
14595
|
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
|
14558
14596
|
<!-- Todo: need update -->
|
14559
|
-
|
14597
|
+
<xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
|
14598
|
+
<xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
|
14560
14599
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
|
14561
14600
|
<xsl:if test="$description != ''">
|
14562
14601
|
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
14563
14602
|
</xsl:if>
|
14564
14603
|
<xsl:if test="$afrelationship != ''">
|
14565
|
-
|
14566
|
-
|
14604
|
+
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
|
14605
|
+
</xsl:if>
|
14606
|
+
<xsl:if test="$volatile != ''">
|
14607
|
+
<xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
|
14608
|
+
</xsl:if>
|
14567
14609
|
</pdf:embedded-file>
|
14568
14610
|
</xsl:for-each>
|
14569
14611
|
</xsl:if>
|
@@ -14610,10 +14652,31 @@
|
|
14610
14652
|
<xsl:value-of select="$level_total - 2"/>
|
14611
14653
|
</xsl:when>
|
14612
14654
|
<xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
|
14613
|
-
|
14655
|
+
<!-- determine 'depth' depends on upper clause with title/@depth -->
|
14656
|
+
<!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
|
14657
|
+
<xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
|
14658
|
+
<!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
|
14659
|
+
<xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
|
14660
|
+
<!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
|
14661
|
+
<xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
|
14662
|
+
<!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
|
14663
|
+
<!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
|
14664
|
+
<xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
|
14665
|
+
<!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
|
14614
14666
|
<xsl:choose>
|
14615
|
-
<xsl:when test="string(number($
|
14616
|
-
<xsl:value-of select="number($
|
14667
|
+
<xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
|
14668
|
+
<xsl:value-of select="number($curr_clause_depth)"/>
|
14669
|
+
</xsl:when>
|
14670
|
+
<xsl:otherwise>
|
14671
|
+
<xsl:value-of select="$level_total - 2"/>
|
14672
|
+
</xsl:otherwise>
|
14673
|
+
</xsl:choose>
|
14674
|
+
</xsl:when>
|
14675
|
+
<xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
|
14676
|
+
<xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
|
14677
|
+
<xsl:choose>
|
14678
|
+
<xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
|
14679
|
+
<xsl:value-of select="number($upper_terms_depth + 1)"/>
|
14617
14680
|
</xsl:when>
|
14618
14681
|
<xsl:otherwise>
|
14619
14682
|
<xsl:value-of select="$level_total - 2"/>
|
@@ -14621,7 +14684,7 @@
|
|
14621
14684
|
</xsl:choose>
|
14622
14685
|
</xsl:when>
|
14623
14686
|
<xsl:when test="ancestor::*[local-name() = 'sections']">
|
14624
|
-
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
|
14687
|
+
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
|
14625
14688
|
<xsl:choose>
|
14626
14689
|
<xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
|
14627
14690
|
<xsl:value-of select="number($upper_clause_depth + 1)"/>
|
@@ -6131,7 +6131,8 @@
|
|
6131
6131
|
</xsl:choose>
|
6132
6132
|
</xsl:variable>
|
6133
6133
|
<xsl:variable name="current_fn_number_text">
|
6134
|
-
|
6134
|
+
|
6135
|
+
<xsl:value-of select="$current_fn_number"/>
|
6135
6136
|
|
6136
6137
|
</xsl:variable>
|
6137
6138
|
|
@@ -6167,8 +6168,10 @@
|
|
6167
6168
|
|
6168
6169
|
<xsl:call-template name="insert_basic_link">
|
6169
6170
|
<xsl:with-param name="element">
|
6170
|
-
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl"
|
6171
|
-
<
|
6171
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
|
6172
|
+
<fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
|
6173
|
+
<xsl:copy-of select="$current_fn_number_text"/>
|
6174
|
+
</fo:inline>
|
6172
6175
|
</fo:basic-link>
|
6173
6176
|
</xsl:with-param>
|
6174
6177
|
</xsl:call-template>
|
@@ -6455,7 +6458,7 @@
|
|
6455
6458
|
|
6456
6459
|
<xsl:call-template name="refine_fn-reference-style"/>
|
6457
6460
|
|
6458
|
-
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
6461
|
+
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
6459
6462
|
<xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
|
6460
6463
|
<xsl:attribute name="internal-destination">
|
6461
6464
|
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
@@ -7499,9 +7502,19 @@
|
|
7499
7502
|
</fo:inline>
|
7500
7503
|
</xsl:template>
|
7501
7504
|
|
7502
|
-
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
7505
|
+
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
|
7506
|
+
<xsl:param name="txt"/>
|
7503
7507
|
<!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
|
7504
|
-
<xsl:variable name="text"
|
7508
|
+
<xsl:variable name="text">
|
7509
|
+
<xsl:choose>
|
7510
|
+
<xsl:when test="$txt != ''">
|
7511
|
+
<xsl:value-of select="$txt"/>
|
7512
|
+
</xsl:when>
|
7513
|
+
<xsl:otherwise>
|
7514
|
+
<xsl:value-of select="."/>
|
7515
|
+
</xsl:otherwise>
|
7516
|
+
</xsl:choose>
|
7517
|
+
</xsl:variable>
|
7505
7518
|
<xsl:variable name="ratio_">
|
7506
7519
|
0.75
|
7507
7520
|
</xsl:variable>
|
@@ -8947,9 +8960,12 @@
|
|
8947
8960
|
<xsl:apply-templates/>
|
8948
8961
|
</xsl:when>
|
8949
8962
|
<xsl:otherwise>
|
8963
|
+
<xsl:variable name="alt_text">
|
8964
|
+
<xsl:call-template name="getAltText"/>
|
8965
|
+
</xsl:variable>
|
8950
8966
|
<xsl:call-template name="insert_basic_link">
|
8951
8967
|
<xsl:with-param name="element">
|
8952
|
-
<fo:basic-link external-destination="{$target}" fox:alt-text="{$
|
8968
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
|
8953
8969
|
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
8954
8970
|
<xsl:attribute name="role">Annot</xsl:attribute>
|
8955
8971
|
</xsl:if>
|
@@ -8976,6 +8992,14 @@
|
|
8976
8992
|
</fo:inline>
|
8977
8993
|
</xsl:template> <!-- link -->
|
8978
8994
|
|
8995
|
+
<xsl:template name="getAltText">
|
8996
|
+
<xsl:choose>
|
8997
|
+
<xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
|
8998
|
+
<xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
|
8999
|
+
<!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
|
9000
|
+
</xsl:choose>
|
9001
|
+
</xsl:template>
|
9002
|
+
|
8979
9003
|
<!-- ======================== -->
|
8980
9004
|
<!-- Appendix processing -->
|
8981
9005
|
<!-- ======================== -->
|
@@ -9006,7 +9030,7 @@
|
|
9006
9030
|
<xsl:template match="*[local-name() = 'callout']">
|
9007
9031
|
<xsl:choose>
|
9008
9032
|
<xsl:when test="normalize-space(@target) = ''"><<xsl:apply-templates/>></xsl:when>
|
9009
|
-
<xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{
|
9033
|
+
<xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}"><<xsl:apply-templates/>></fo:basic-link></xsl:otherwise>
|
9010
9034
|
</xsl:choose>
|
9011
9035
|
</xsl:template>
|
9012
9036
|
|
@@ -9035,7 +9059,10 @@
|
|
9035
9059
|
<xsl:template match="*[local-name() = 'xref']">
|
9036
9060
|
<xsl:call-template name="insert_basic_link">
|
9037
9061
|
<xsl:with-param name="element">
|
9038
|
-
<
|
9062
|
+
<xsl:variable name="alt_text">
|
9063
|
+
<xsl:call-template name="getAltText"/>
|
9064
|
+
</xsl:variable>
|
9065
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
|
9039
9066
|
<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'])">
|
9040
9067
|
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
9041
9068
|
</xsl:if>
|
@@ -11523,12 +11550,14 @@
|
|
11523
11550
|
|
11524
11551
|
<xsl:when test="contains(normalize-space($fo_element), 'list')">
|
11525
11552
|
|
11526
|
-
<xsl:variable name="
|
11553
|
+
<xsl:variable name="provisional_distance_between_starts_">
|
11527
11554
|
7
|
11528
11555
|
</xsl:variable>
|
11529
|
-
<xsl:variable name="
|
11556
|
+
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
|
11557
|
+
<xsl:variable name="indent_">
|
11530
11558
|
0
|
11531
11559
|
</xsl:variable>
|
11560
|
+
<xsl:variable name="indent" select="normalize-space($indent_)"/>
|
11532
11561
|
|
11533
11562
|
<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
|
11534
11563
|
<fo:list-item>
|
@@ -12260,14 +12289,17 @@
|
|
12260
12289
|
</xsl:when>
|
12261
12290
|
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
|
12262
12291
|
|
12263
|
-
<xsl:variable name="
|
12292
|
+
<xsl:variable name="type" select="../@type"/>
|
12264
12293
|
|
12265
|
-
|
12294
|
+
<xsl:variable name="label">
|
12266
12295
|
|
12267
12296
|
<xsl:variable name="style_prefix_">
|
12268
12297
|
<xsl:if test="$type = 'roman'">
|
12269
12298
|
<!-- Example: (i) -->
|
12270
12299
|
</xsl:if>
|
12300
|
+
<xsl:if test="$type = 'alphabet'">
|
12301
|
+
|
12302
|
+
</xsl:if>
|
12271
12303
|
</xsl:variable>
|
12272
12304
|
<xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
|
12273
12305
|
|
@@ -12293,13 +12325,15 @@
|
|
12293
12325
|
<xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
|
12294
12326
|
<xsl:value-of select="$style_prefix"/>
|
12295
12327
|
</xsl:if>
|
12328
|
+
|
12296
12329
|
<xsl:value-of select="@label"/>
|
12330
|
+
|
12297
12331
|
<xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
|
12298
12332
|
<xsl:value-of select="$style_suffix"/>
|
12299
12333
|
</xsl:if>
|
12300
12334
|
</xsl:variable>
|
12301
12335
|
|
12302
|
-
|
12336
|
+
<xsl:value-of select="normalize-space($label)"/>
|
12303
12337
|
|
12304
12338
|
</xsl:when>
|
12305
12339
|
<xsl:otherwise> <!-- for ordered lists 'ol' -->
|
@@ -14525,7 +14559,8 @@
|
|
14525
14559
|
<xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
|
14526
14560
|
<xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
|
14527
14561
|
<!-- Todo: need update -->
|
14528
|
-
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = '
|
14562
|
+
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
|
14563
|
+
<xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
|
14529
14564
|
|
14530
14565
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
|
14531
14566
|
<xsl:attribute name="src">
|
@@ -14546,6 +14581,9 @@
|
|
14546
14581
|
<xsl:if test="$afrelationship != ''">
|
14547
14582
|
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
|
14548
14583
|
</xsl:if>
|
14584
|
+
<xsl:if test="$volatile != ''">
|
14585
|
+
<xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
|
14586
|
+
</xsl:if>
|
14549
14587
|
</pdf:embedded-file>
|
14550
14588
|
</xsl:for-each>
|
14551
14589
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
@@ -14556,14 +14594,18 @@
|
|
14556
14594
|
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
|
14557
14595
|
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
|
14558
14596
|
<!-- Todo: need update -->
|
14559
|
-
|
14597
|
+
<xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
|
14598
|
+
<xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
|
14560
14599
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
|
14561
14600
|
<xsl:if test="$description != ''">
|
14562
14601
|
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
14563
14602
|
</xsl:if>
|
14564
14603
|
<xsl:if test="$afrelationship != ''">
|
14565
|
-
|
14566
|
-
|
14604
|
+
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
|
14605
|
+
</xsl:if>
|
14606
|
+
<xsl:if test="$volatile != ''">
|
14607
|
+
<xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
|
14608
|
+
</xsl:if>
|
14567
14609
|
</pdf:embedded-file>
|
14568
14610
|
</xsl:for-each>
|
14569
14611
|
</xsl:if>
|
@@ -14610,10 +14652,31 @@
|
|
14610
14652
|
<xsl:value-of select="$level_total - 2"/>
|
14611
14653
|
</xsl:when>
|
14612
14654
|
<xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
|
14613
|
-
|
14655
|
+
<!-- determine 'depth' depends on upper clause with title/@depth -->
|
14656
|
+
<!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
|
14657
|
+
<xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
|
14658
|
+
<!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
|
14659
|
+
<xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
|
14660
|
+
<!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
|
14661
|
+
<xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
|
14662
|
+
<!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
|
14663
|
+
<!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
|
14664
|
+
<xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
|
14665
|
+
<!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
|
14614
14666
|
<xsl:choose>
|
14615
|
-
<xsl:when test="string(number($
|
14616
|
-
<xsl:value-of select="number($
|
14667
|
+
<xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
|
14668
|
+
<xsl:value-of select="number($curr_clause_depth)"/>
|
14669
|
+
</xsl:when>
|
14670
|
+
<xsl:otherwise>
|
14671
|
+
<xsl:value-of select="$level_total - 2"/>
|
14672
|
+
</xsl:otherwise>
|
14673
|
+
</xsl:choose>
|
14674
|
+
</xsl:when>
|
14675
|
+
<xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
|
14676
|
+
<xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
|
14677
|
+
<xsl:choose>
|
14678
|
+
<xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
|
14679
|
+
<xsl:value-of select="number($upper_terms_depth + 1)"/>
|
14617
14680
|
</xsl:when>
|
14618
14681
|
<xsl:otherwise>
|
14619
14682
|
<xsl:value-of select="$level_total - 2"/>
|
@@ -14621,7 +14684,7 @@
|
|
14621
14684
|
</xsl:choose>
|
14622
14685
|
</xsl:when>
|
14623
14686
|
<xsl:when test="ancestor::*[local-name() = 'sections']">
|
14624
|
-
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
|
14687
|
+
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
|
14625
14688
|
<xsl:choose>
|
14626
14689
|
<xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
|
14627
14690
|
<xsl:value-of select="number($upper_clause_depth + 1)"/>
|