metanorma-bipm 2.6.3 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/bipm/bipm.brochure.xsl +206 -61
- data/lib/isodoc/bipm/bipm.guide.xsl +206 -61
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +206 -61
- data/lib/isodoc/bipm/bipm.rapport.xsl +206 -61
- data/lib/isodoc/bipm/jcgm.standard.xsl +169 -44
- data/lib/isodoc/bipm/presentation_blocks.rb +40 -9
- data/lib/isodoc/bipm/presentation_footnotes.rb +112 -0
- data/lib/isodoc/bipm/presentation_xml_convert.rb +1 -123
- data/lib/metanorma/bipm/basicdoc.rng +14 -8
- data/lib/metanorma/bipm/biblio-standoc.rng +37 -7
- data/lib/metanorma/bipm/biblio.rng +30 -18
- data/lib/metanorma/bipm/bipm.rng +3 -67
- data/lib/metanorma/bipm/isodoc.rng +115 -96
- data/lib/metanorma/bipm/relaton-bipm.rng +18 -24
- data/lib/metanorma/bipm/reqt.rng +7 -6
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma.yml +7 -7
- metadata +3 -2
@@ -469,7 +469,7 @@
|
|
469
469
|
|
470
470
|
<!-- flatxml=<xsl:copy-of select="$flatxml"/> -->
|
471
471
|
|
472
|
-
<xsl:apply-templates select="xalan:nodeset($flatxml)/bipm:
|
472
|
+
<xsl:apply-templates select="xalan:nodeset($flatxml)/bipm:metanorma" mode="bipm-standard">
|
473
473
|
<xsl:with-param name="curr_docnum" select="$num"/>
|
474
474
|
</xsl:apply-templates>
|
475
475
|
|
@@ -619,6 +619,17 @@
|
|
619
619
|
|
620
620
|
<xsl:template match="*[local-name() = 'clause']/*[local-name() = 'fmt-footnote-container']" priority="3" mode="update_xml_pres"/>
|
621
621
|
|
622
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="3" mode="update_xml_pres">
|
623
|
+
<xsl:choose>
|
624
|
+
<!-- no need li labels in BIPM brochure preface -->
|
625
|
+
<xsl:when test="ancestor::*[bipm:preface] and ancestor::bipm:clause[not(@type = 'toc')]"/>
|
626
|
+
<xsl:otherwise>
|
627
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
628
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
629
|
+
</xsl:otherwise>
|
630
|
+
</xsl:choose>
|
631
|
+
</xsl:template>
|
632
|
+
|
622
633
|
<!-- ================================= -->
|
623
634
|
<!-- Flattening xml for fit notes at page sides (margins) -->
|
624
635
|
<!-- ================================= -->
|
@@ -776,7 +787,6 @@
|
|
776
787
|
<xsl:otherwise>
|
777
788
|
<xsl:apply-templates select="." mode="fn_to_xref"/> <!-- displays asterisks with link to side note -->
|
778
789
|
<xsl:call-template name="fn_to_note_side"/> <!-- convert footnote to side note with asterisk at start -->
|
779
|
-
|
780
790
|
</xsl:otherwise>
|
781
791
|
</xsl:choose>
|
782
792
|
</xsl:template>
|
@@ -887,9 +897,7 @@
|
|
887
897
|
<!-- move all footnotes in the current list (not only current list item) into first 'li' -->
|
888
898
|
<xsl:variable name="curr_list_id" select="../@id"/>
|
889
899
|
<xsl:for-each select="..//bipm:fn[ancestor::bipm:ol[1]/@id = $curr_list_id or ancestor::bipm:ul[1]/@id = $curr_list_id]">
|
890
|
-
|
891
900
|
<xsl:call-template name="fn_to_note_side"/>
|
892
|
-
|
893
901
|
</xsl:for-each>
|
894
902
|
|
895
903
|
</xsl:otherwise>
|
@@ -910,24 +918,32 @@
|
|
910
918
|
</xsl:template>
|
911
919
|
|
912
920
|
<xsl:template name="fn_to_note_side">
|
913
|
-
<xsl:
|
921
|
+
<xsl:variable name="target" select="@target"/>
|
922
|
+
<xsl:choose>
|
923
|
+
<!-- skip side note, see the comment https://github.com/metanorma/isodoc/issues/658#issuecomment-2768874528: -->
|
924
|
+
<!-- every repeated footnote is only rendered at the first instance -->
|
925
|
+
<xsl:when test="preceding::*[@target = $target]"/>
|
926
|
+
<xsl:otherwise>
|
927
|
+
<xsl:element name="note_side" namespace="https://www.metanorma.org/ns/standoc">
|
914
928
|
|
915
|
-
|
916
|
-
|
917
|
-
|
929
|
+
<xsl:attribute name="id">
|
930
|
+
<xsl:value-of select="@target"/>
|
931
|
+
</xsl:attribute>
|
918
932
|
|
919
|
-
|
933
|
+
<xsl:variable name="curr_id" select="@target"/>
|
920
934
|
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
935
|
+
<xsl:element name="sup_fn" namespace="https://www.metanorma.org/ns/standoc">
|
936
|
+
<!-- <xsl:value-of select="concat('(',$number,')')"/> -->
|
937
|
+
<!-- https://github.com/metanorma/isodoc/issues/658#issuecomment-2726450824 -->
|
938
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-fn-label']/node()" mode="flatxml"/>
|
939
|
+
</xsl:element>
|
940
|
+
<xsl:text> </xsl:text>
|
927
941
|
|
928
|
-
|
929
|
-
|
930
|
-
|
942
|
+
<!-- <xsl:apply-templates mode="flatxml"/> -->
|
943
|
+
<xsl:apply-templates select="$footnotes/*[local-name() = 'fmt-fn-body'][@id = $curr_id]/node()" mode="flatxml"/>
|
944
|
+
</xsl:element>
|
945
|
+
</xsl:otherwise>
|
946
|
+
</xsl:choose>
|
931
947
|
</xsl:template>
|
932
948
|
|
933
949
|
<!-- remove latest elements (after li), because they moved into latest 'li' -->
|
@@ -2923,13 +2939,17 @@
|
|
2923
2939
|
<fo:list-item-label end-indent="label-end()">
|
2924
2940
|
<fo:block> <!-- debug: border="0.5pt solid green" -->
|
2925
2941
|
<fo:inline>
|
2926
|
-
|
2927
|
-
<xsl:
|
2942
|
+
<xsl:if test="@list_type = 'ul'">
|
2943
|
+
<xsl:variable name="li_label" select="@label"/>
|
2944
|
+
<xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
|
2945
|
+
</xsl:if>
|
2946
|
+
|
2928
2947
|
<xsl:copy-of select="@font-size"/>
|
2929
2948
|
<xsl:copy-of select="@baseline-shift"/>
|
2930
2949
|
<xsl:if test="@list_type = 'ul' and ancestor::bipm:note_side">
|
2931
2950
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2932
2951
|
</xsl:if>
|
2952
|
+
|
2933
2953
|
<xsl:value-of select="@label"/>
|
2934
2954
|
</fo:inline>
|
2935
2955
|
</fo:block>
|
@@ -4676,6 +4696,7 @@
|
|
4676
4696
|
</xsl:template> <!-- refine_table-style -->
|
4677
4697
|
|
4678
4698
|
<xsl:attribute-set name="table-name-style">
|
4699
|
+
<xsl:attribute name="role">Caption</xsl:attribute>
|
4679
4700
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
4680
4701
|
|
4681
4702
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -4689,6 +4710,9 @@
|
|
4689
4710
|
|
4690
4711
|
<xsl:template name="refine_table-name-style">
|
4691
4712
|
<xsl:param name="continued"/>
|
4713
|
+
<xsl:if test="$continued = 'true'">
|
4714
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
4715
|
+
</xsl:if>
|
4692
4716
|
|
4693
4717
|
</xsl:template> <!-- refine_table-name-style -->
|
4694
4718
|
|
@@ -6504,7 +6528,7 @@
|
|
6504
6528
|
</xsl:if>
|
6505
6529
|
|
6506
6530
|
</fo:block-container>
|
6507
|
-
</xsl:variable>
|
6531
|
+
</xsl:variable> <!-- END: variable name="table" -->
|
6508
6532
|
|
6509
6533
|
<xsl:variable name="isAdded" select="@added"/>
|
6510
6534
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -6558,6 +6582,7 @@
|
|
6558
6582
|
|
6559
6583
|
</xsl:template>
|
6560
6584
|
|
6585
|
+
<!-- table/name-->
|
6561
6586
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
6562
6587
|
<xsl:param name="continued"/>
|
6563
6588
|
<xsl:if test="normalize-space() != ''">
|
@@ -7047,7 +7072,7 @@
|
|
7047
7072
|
|
7048
7073
|
<xsl:variable name="tableWithNotesAndFootnotes">
|
7049
7074
|
|
7050
|
-
<fo:table keep-with-previous="always">
|
7075
|
+
<fo:table keep-with-previous="always" role="SKIP">
|
7051
7076
|
<xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
|
7052
7077
|
<xsl:variable name="name" select="local-name()"/>
|
7053
7078
|
<xsl:choose>
|
@@ -7078,9 +7103,9 @@
|
|
7078
7103
|
</xsl:otherwise>
|
7079
7104
|
</xsl:choose>
|
7080
7105
|
|
7081
|
-
<fo:table-body>
|
7082
|
-
<fo:table-row>
|
7083
|
-
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
7106
|
+
<fo:table-body role="SKIP">
|
7107
|
+
<fo:table-row role="SKIP">
|
7108
|
+
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
|
7084
7109
|
|
7085
7110
|
<xsl:call-template name="refine_table-footer-cell-style"/>
|
7086
7111
|
|
@@ -7507,6 +7532,7 @@
|
|
7507
7532
|
<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
|
7508
7533
|
<!-- fn in text -->
|
7509
7534
|
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
|
7535
|
+
<xsl:param name="footnote_body_from_table">false</xsl:param>
|
7510
7536
|
|
7511
7537
|
<!-- list of unique footnotes -->
|
7512
7538
|
<xsl:variable name="p_fn_">
|
@@ -7572,7 +7598,7 @@
|
|
7572
7598
|
<xsl:copy-of select="$footnote_inline"/>
|
7573
7599
|
</xsl:when>
|
7574
7600
|
<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
|
7575
|
-
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
7601
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
|
7576
7602
|
|
7577
7603
|
<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
|
7578
7604
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -7983,42 +8009,54 @@
|
|
7983
8009
|
<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
|
7984
8010
|
<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
|
7985
8011
|
<xsl:template match="*[local-name()='fn']">
|
7986
|
-
<
|
8012
|
+
<xsl:variable name="target" select="@target"/>
|
8013
|
+
<xsl:choose>
|
8014
|
+
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
8015
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'][1]/*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
|
8016
|
+
<xsl:call-template name="fn">
|
8017
|
+
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
8018
|
+
</xsl:call-template>
|
8019
|
+
</xsl:when>
|
8020
|
+
<xsl:otherwise>
|
7987
8021
|
|
7988
|
-
|
8022
|
+
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
7989
8023
|
|
7990
|
-
|
7991
|
-
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
7992
|
-
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
7993
|
-
<!-- <xsl:attribute name="internal-destination">
|
7994
|
-
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
7995
|
-
</xsl:attribute>
|
7996
|
-
</xsl:if>
|
7997
|
-
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
7998
|
-
<xsl:attribute name="internal-destination">
|
7999
|
-
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
8000
|
-
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
8001
|
-
</xsl:attribute>
|
8002
|
-
</xsl:if> -->
|
8003
|
-
<!-- <xsl:if test="$namespace = 'plateau'">
|
8004
|
-
<xsl:text>※</xsl:text>
|
8005
|
-
</xsl:if> -->
|
8006
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
8007
|
-
|
8008
|
-
<fo:inline font-style="normal"> </fo:inline>
|
8009
|
-
<!-- Example: <fmt-fn-label><sup><span class="fmt-label-delim">(</span>a<span class="fmt-label-delim">)</span></sup></fmt-fn-label> -->
|
8010
|
-
<!-- to <fo:inline font-style="normal">(</fo:inline> ... -->
|
8011
|
-
<xsl:apply-templates select="*[local-name() = 'fmt-fn-label']/node()"/>
|
8024
|
+
<xsl:call-template name="refine_fn-reference-style"/>
|
8012
8025
|
|
8013
|
-
|
8014
|
-
<
|
8015
|
-
|
8016
|
-
|
8017
|
-
|
8018
|
-
|
8019
|
-
|
8020
|
-
|
8021
|
-
|
8026
|
+
<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
8027
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
8028
|
+
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
8029
|
+
<!-- <xsl:attribute name="internal-destination">
|
8030
|
+
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
8031
|
+
</xsl:attribute>
|
8032
|
+
</xsl:if>
|
8033
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
8034
|
+
<xsl:attribute name="internal-destination">
|
8035
|
+
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
8036
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
8037
|
+
</xsl:attribute>
|
8038
|
+
</xsl:if> -->
|
8039
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
8040
|
+
<xsl:text>※</xsl:text>
|
8041
|
+
</xsl:if> -->
|
8042
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
8043
|
+
|
8044
|
+
<fo:inline font-style="normal"> </fo:inline>
|
8045
|
+
<!-- Example: <fmt-fn-label><sup><span class="fmt-label-delim">(</span>a<span class="fmt-label-delim">)</span></sup></fmt-fn-label> -->
|
8046
|
+
<!-- to <fo:inline font-style="normal">(</fo:inline> ... -->
|
8047
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-fn-label']/node()"/>
|
8048
|
+
|
8049
|
+
<!-- <xsl:if test="$namespace = 'bsi'">
|
8050
|
+
<xsl:text>)</xsl:text>
|
8051
|
+
</xsl:if> -->
|
8052
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
8053
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
8054
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
8055
|
+
</xsl:if> -->
|
8056
|
+
</fo:basic-link>
|
8057
|
+
</fo:inline>
|
8058
|
+
</xsl:otherwise>
|
8059
|
+
</xsl:choose>
|
8022
8060
|
</xsl:template> <!-- fn -->
|
8023
8061
|
|
8024
8062
|
<!-- fn/text() -->
|
@@ -12066,6 +12104,13 @@
|
|
12066
12104
|
<xsl:apply-templates select="."/>
|
12067
12105
|
</xsl:template>
|
12068
12106
|
|
12107
|
+
<!-- prevent missing stem for table and figures in ToC -->
|
12108
|
+
<xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
12109
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
|
12110
|
+
<xsl:apply-templates select="."/>
|
12111
|
+
</xsl:if>
|
12112
|
+
</xsl:template>
|
12113
|
+
|
12069
12114
|
<xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
|
12070
12115
|
|
12071
12116
|
<xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
|
@@ -12289,7 +12334,8 @@
|
|
12289
12334
|
|
12290
12335
|
<xsl:for-each select="$contents_nodes//tables/table">
|
12291
12336
|
<fo:bookmark internal-destination="{@id}">
|
12292
|
-
<fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
|
12337
|
+
<!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
|
12338
|
+
<fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
|
12293
12339
|
</fo:bookmark>
|
12294
12340
|
</xsl:for-each>
|
12295
12341
|
</fo:bookmark>
|
@@ -12298,6 +12344,26 @@
|
|
12298
12344
|
</xsl:template> <!-- insertTableBookmarks -->
|
12299
12345
|
<!-- End Bookmarks -->
|
12300
12346
|
|
12347
|
+
<!-- ============================ -->
|
12348
|
+
<!-- mode="bookmark_clean" -->
|
12349
|
+
<!-- ============================ -->
|
12350
|
+
<xsl:template match="node()" mode="bookmark_clean">
|
12351
|
+
<xsl:apply-templates select="node()" mode="bookmark_clean"/>
|
12352
|
+
</xsl:template>
|
12353
|
+
|
12354
|
+
<xsl:template match="text()" mode="bookmark_clean">
|
12355
|
+
<xsl:value-of select="."/>
|
12356
|
+
</xsl:template>
|
12357
|
+
|
12358
|
+
<xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
|
12359
|
+
<xsl:value-of select="normalize-space(.)"/>
|
12360
|
+
</xsl:template>
|
12361
|
+
|
12362
|
+
<xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
|
12363
|
+
<!-- ============================ -->
|
12364
|
+
<!-- END: mode="bookmark_clean" -->
|
12365
|
+
<!-- ============================ -->
|
12366
|
+
|
12301
12367
|
<xsl:template name="getLangVersion">
|
12302
12368
|
<xsl:param name="lang"/>
|
12303
12369
|
<xsl:param name="doctype" select="''"/>
|
@@ -14320,9 +14386,15 @@
|
|
14320
14386
|
<xsl:when test="local-name(..) = 'ul'">
|
14321
14387
|
<xsl:choose>
|
14322
14388
|
<xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
|
14389
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
14390
|
+
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
|
14323
14391
|
<xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
|
14324
14392
|
</xsl:choose>
|
14325
14393
|
</xsl:when>
|
14394
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
14395
|
+
<xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
|
14396
|
+
<xsl:value-of select="@label"/>
|
14397
|
+
</xsl:when>
|
14326
14398
|
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
|
14327
14399
|
|
14328
14400
|
<xsl:variable name="type" select="../@type"/>
|
@@ -14447,7 +14519,7 @@
|
|
14447
14519
|
|
14448
14520
|
</xsl:otherwise>
|
14449
14521
|
</xsl:choose>
|
14450
|
-
</xsl:template>
|
14522
|
+
</xsl:template> <!-- getListItemFormat -->
|
14451
14523
|
|
14452
14524
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
14453
14525
|
<xsl:param name="indent">0</xsl:param>
|
@@ -14581,6 +14653,11 @@
|
|
14581
14653
|
|
14582
14654
|
<xsl:call-template name="refine_list-item-label-style"/>
|
14583
14655
|
|
14656
|
+
<xsl:if test="local-name(..) = 'ul'">
|
14657
|
+
<xsl:variable name="li_label" select="@label"/>
|
14658
|
+
<xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
|
14659
|
+
</xsl:if>
|
14660
|
+
|
14584
14661
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
14585
14662
|
<xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
|
14586
14663
|
<xsl:call-template name="append_add-style"/>
|
@@ -15976,6 +16053,16 @@
|
|
15976
16053
|
</xsl:choose>
|
15977
16054
|
</xsl:template>
|
15978
16055
|
|
16056
|
+
<!-- li/fmt-name -->
|
16057
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
|
16058
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
16059
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
16060
|
+
</xsl:template>
|
16061
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
|
16062
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
16063
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
16064
|
+
</xsl:template>
|
16065
|
+
|
15979
16066
|
<xsl:template match="*[local-name() = 'fmt-preferred']"/>
|
15980
16067
|
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
|
15981
16068
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -16790,6 +16877,64 @@
|
|
16790
16877
|
<fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
|
16791
16878
|
</xsl:template>
|
16792
16879
|
|
16880
|
+
<!-- ===================================== -->
|
16881
|
+
<!-- ===================================== -->
|
16882
|
+
<!-- Ruby text (CJK languages) rendering -->
|
16883
|
+
<!-- ===================================== -->
|
16884
|
+
<!-- ===================================== -->
|
16885
|
+
<xsl:template match="*[local-name() = 'ruby']">
|
16886
|
+
<fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
|
16887
|
+
<xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
|
16888
|
+
<xsl:attribute name="alignment-baseline">central</xsl:attribute>
|
16889
|
+
</xsl:if>
|
16890
|
+
<xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
|
16891
|
+
<xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
|
16892
|
+
<!-- Example: width="2em" -->
|
16893
|
+
<xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
|
16894
|
+
<xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
|
16895
|
+
<xsl:variable name="text_width">
|
16896
|
+
<xsl:choose>
|
16897
|
+
<xsl:when test="$text_rt_width >= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
|
16898
|
+
<xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
|
16899
|
+
</xsl:choose>
|
16900
|
+
</xsl:variable>
|
16901
|
+
<xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
|
16902
|
+
|
16903
|
+
<xsl:choose>
|
16904
|
+
<xsl:when test="ancestor::*[local-name() = 'ruby']">
|
16905
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
16906
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
16907
|
+
</xsl:when>
|
16908
|
+
<xsl:otherwise>
|
16909
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
16910
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
16911
|
+
</xsl:otherwise>
|
16912
|
+
</xsl:choose>
|
16913
|
+
|
16914
|
+
<xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
|
16915
|
+
</fo:inline-container>
|
16916
|
+
</xsl:template>
|
16917
|
+
|
16918
|
+
<xsl:template match="*[local-name() = 'rb']">
|
16919
|
+
<fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
|
16920
|
+
</xsl:template>
|
16921
|
+
|
16922
|
+
<xsl:template match="*[local-name() = 'rt']">
|
16923
|
+
<fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
|
16924
|
+
<xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
|
16925
|
+
<xsl:attribute name="space-before">0em</xsl:attribute>
|
16926
|
+
</xsl:if>
|
16927
|
+
<xsl:apply-templates/>
|
16928
|
+
</fo:block>
|
16929
|
+
|
16930
|
+
</xsl:template>
|
16931
|
+
|
16932
|
+
<!-- ===================================== -->
|
16933
|
+
<!-- ===================================== -->
|
16934
|
+
<!-- END: Ruby text (CJK languages) rendering -->
|
16935
|
+
<!-- ===================================== -->
|
16936
|
+
<!-- ===================================== -->
|
16937
|
+
|
16793
16938
|
<xsl:template name="printEdition">
|
16794
16939
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
16795
16940
|
|