metanorma-ribose 2.1.11 → 2.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ribose/html/htmlstyle.css +6 -0
- data/lib/isodoc/ribose/html/wordstyle.css +150 -0
- data/lib/isodoc/ribose/html/wordstyle.scss +144 -0
- data/lib/isodoc/ribose/ribose.standard.xsl +342 -98
- data/lib/metanorma/ribose/biblio.rng +5 -0
- data/lib/metanorma/ribose/isodoc.rng +47 -13
- data/lib/metanorma/ribose/version.rb +1 -1
- data/metanorma-ribose.gemspec +3 -2
- metadata +4 -11
- data/.github/workflows/automerge.yml +0 -31
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/Rakefile +0 -8
- data/bin/console +0 -14
- data/bin/rspec +0 -17
- data/bin/setup +0 -8
@@ -320,7 +320,7 @@
|
|
320
320
|
</fo:block-container>
|
321
321
|
|
322
322
|
<!-- Ribose logo -->
|
323
|
-
<fo:block-container absolute-position="fixed" left="171mm" top="{$pageHeight - 33.4}mm" height="30mm" width="40mm"> <!-- top="246mm" -->
|
323
|
+
<fo:block-container absolute-position="fixed" left="171mm" top="{$pageHeight - 33.4}mm" height="30mm" width="40mm" id="__internal_layout__logo_{generate-id()}"> <!-- top="246mm" -->
|
324
324
|
<fo:block>
|
325
325
|
<fo:instream-foreign-object content-width="32mm" fox:alt-text="Ribose Logo">
|
326
326
|
<xsl:copy-of select="$Ribose-Logo"/>
|
@@ -405,7 +405,9 @@
|
|
405
405
|
|
406
406
|
<!-- ToC pages -->
|
407
407
|
<fo:page-sequence master-reference="document" force-page-count="no-force"> <!-- master-reference="toc" -->
|
408
|
-
<xsl:call-template name="insertHeaderFooter"
|
408
|
+
<xsl:call-template name="insertHeaderFooter">
|
409
|
+
<xsl:with-param name="section">toc</xsl:with-param>
|
410
|
+
</xsl:call-template>
|
409
411
|
<fo:flow flow-name="xsl-region-body">
|
410
412
|
<xsl:if test="$contents//item[@display = 'true']">
|
411
413
|
<fo:block role="TOC">
|
@@ -493,7 +495,9 @@
|
|
493
495
|
<fo:leader leader-pattern="rule" leader-length="30%"/>
|
494
496
|
</fo:block>
|
495
497
|
</fo:static-content>
|
496
|
-
<xsl:call-template name="insertHeaderFooter"
|
498
|
+
<xsl:call-template name="insertHeaderFooter">
|
499
|
+
<xsl:with-param name="section">main</xsl:with-param>
|
500
|
+
</xsl:call-template>
|
497
501
|
<fo:flow flow-name="xsl-region-body">
|
498
502
|
|
499
503
|
<fo:block line-height="130%">
|
@@ -983,7 +987,7 @@
|
|
983
987
|
</xsl:template>
|
984
988
|
|
985
989
|
<xsl:template name="insertHeaderFooter">
|
986
|
-
|
990
|
+
<xsl:param name="section"/>
|
987
991
|
<!-- LT - left top -->
|
988
992
|
<!-- RT - right top -->
|
989
993
|
<!-- LB - left bottom -->
|
@@ -995,28 +999,28 @@
|
|
995
999
|
<xsl:variable name="top_bottom">194</xsl:variable>
|
996
1000
|
<!-- Yellow -->
|
997
1001
|
<fo:static-content flow-name="header-LT-yellow" role="artifact">
|
998
|
-
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_top}mm" font-size="0">
|
1002
|
+
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_top}mm" font-size="0" id="__internal_layout__header-LT-yellow_{$section}_{generate-id()}">
|
999
1003
|
<fo:block>
|
1000
1004
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-yellow-left))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1001
1005
|
</fo:block>
|
1002
1006
|
</fo:block-container>
|
1003
1007
|
</fo:static-content>
|
1004
1008
|
<fo:static-content flow-name="header-RT-yellow" role="artifact">
|
1005
|
-
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_top}mm" font-size="0">
|
1009
|
+
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_top}mm" font-size="0" id="__internal_layout__header-RT-yellow_{$section}_{generate-id()}">
|
1006
1010
|
<fo:block>
|
1007
1011
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-yellow-right))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1008
1012
|
</fo:block>
|
1009
1013
|
</fo:block-container>
|
1010
1014
|
</fo:static-content>
|
1011
1015
|
<fo:static-content flow-name="header-LB-yellow" role="artifact">
|
1012
|
-
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_bottom}mm" font-size="0">
|
1016
|
+
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_bottom}mm" font-size="0" id="__internal_layout__header-LB-yellow_{$section}_{generate-id()}">
|
1013
1017
|
<fo:block>
|
1014
1018
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-yellow-left))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1015
1019
|
</fo:block>
|
1016
1020
|
</fo:block-container>
|
1017
1021
|
</fo:static-content>
|
1018
1022
|
<fo:static-content flow-name="header-RB-yellow" role="artifact">
|
1019
|
-
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_bottom}mm" font-size="0">
|
1023
|
+
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_bottom}mm" font-size="0" id="__internal_layout__header-RB-yellow_{$section}_{generate-id()}">
|
1020
1024
|
<fo:block>
|
1021
1025
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-yellow-right))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1022
1026
|
</fo:block>
|
@@ -1024,28 +1028,28 @@
|
|
1024
1028
|
</fo:static-content>
|
1025
1029
|
<!-- Blue -->
|
1026
1030
|
<fo:static-content flow-name="header-LT-blue" role="artifact">
|
1027
|
-
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_top}mm" font-size="0">
|
1031
|
+
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_top}mm" font-size="0" id="__internal_layout__header-LT-blue_{$section}_{generate-id()}">
|
1028
1032
|
<fo:block>
|
1029
1033
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-blue-left))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1030
1034
|
</fo:block>
|
1031
1035
|
</fo:block-container>
|
1032
1036
|
</fo:static-content>
|
1033
1037
|
<fo:static-content flow-name="header-RT-blue" role="artifact">
|
1034
|
-
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_top}mm" font-size="0">
|
1038
|
+
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_top}mm" font-size="0" id="__internal_layout__header-RT-blue_{$section}_{generate-id()}">
|
1035
1039
|
<fo:block>
|
1036
1040
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-blue-right))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1037
1041
|
</fo:block>
|
1038
1042
|
</fo:block-container>
|
1039
1043
|
</fo:static-content>
|
1040
1044
|
<fo:static-content flow-name="header-LB-blue" role="artifact">
|
1041
|
-
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_bottom}mm" font-size="0">
|
1045
|
+
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_bottom}mm" font-size="0" id="__internal_layout__header-LB-blue_{$section}_{generate-id()}">
|
1042
1046
|
<fo:block>
|
1043
1047
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-blue-left))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1044
1048
|
</fo:block>
|
1045
1049
|
</fo:block-container>
|
1046
1050
|
</fo:static-content>
|
1047
1051
|
<fo:static-content flow-name="header-RB-blue" role="artifact">
|
1048
|
-
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_bottom}mm" font-size="0">
|
1052
|
+
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_bottom}mm" font-size="0" id="__internal_layout__header-RB-blue_{$section}_{generate-id()}">
|
1049
1053
|
<fo:block>
|
1050
1054
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-blue-right))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1051
1055
|
</fo:block>
|
@@ -1053,28 +1057,28 @@
|
|
1053
1057
|
</fo:static-content>
|
1054
1058
|
<!-- Orange -->
|
1055
1059
|
<fo:static-content flow-name="header-LT-orange" role="artifact">
|
1056
|
-
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_top}mm" font-size="0">
|
1060
|
+
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_top}mm" font-size="0" id="__internal_layout__header-LT-orange_{$section}_{generate-id()}">
|
1057
1061
|
<fo:block>
|
1058
1062
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-orange-left))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1059
1063
|
</fo:block>
|
1060
1064
|
</fo:block-container>
|
1061
1065
|
</fo:static-content>
|
1062
1066
|
<fo:static-content flow-name="header-RT-orange" role="artifact">
|
1063
|
-
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_top}mm" font-size="0">
|
1067
|
+
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_top}mm" font-size="0" id="__internal_layout__header-RT-orange_{$section}_{generate-id()}">
|
1064
1068
|
<fo:block>
|
1065
1069
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-orange-right))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1066
1070
|
</fo:block>
|
1067
1071
|
</fo:block-container>
|
1068
1072
|
</fo:static-content>
|
1069
1073
|
<fo:static-content flow-name="header-LB-orange" role="artifact">
|
1070
|
-
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_bottom}mm" font-size="0">
|
1074
|
+
<fo:block-container absolute-position="fixed" left="{$left_left}mm" top="{$top_bottom}mm" font-size="0" id="__internal_layout__header-LB-orange_{$section}_{generate-id()}">
|
1071
1075
|
<fo:block>
|
1072
1076
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-orange-left))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1073
1077
|
</fo:block>
|
1074
1078
|
</fo:block-container>
|
1075
1079
|
</fo:static-content>
|
1076
1080
|
<fo:static-content flow-name="header-RB-orange" role="artifact">
|
1077
|
-
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_bottom}mm" font-size="0">
|
1081
|
+
<fo:block-container absolute-position="fixed" left="{$left_right}mm" top="{$top_bottom}mm" font-size="0" id="__internal_layout__header-RB-orange_{$section}_{generate-id()}">
|
1078
1082
|
<fo:block>
|
1079
1083
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Page-Background-orange-right))}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Page"/>
|
1080
1084
|
</fo:block>
|
@@ -1191,6 +1195,8 @@
|
|
1191
1195
|
</xsl:if>
|
1192
1196
|
</xsl:template>
|
1193
1197
|
|
1198
|
+
<xsl:strip-space elements="rsd:xref"/>
|
1199
|
+
|
1194
1200
|
<!-- external parameters -->
|
1195
1201
|
|
1196
1202
|
<xsl:param name="svg_images"/> <!-- svg images array -->
|
@@ -1616,6 +1622,15 @@
|
|
1616
1622
|
|
1617
1623
|
</xsl:attribute-set>
|
1618
1624
|
|
1625
|
+
<xsl:attribute-set name="pre-style">
|
1626
|
+
<xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
|
1627
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
1628
|
+
|
1629
|
+
<xsl:attribute name="font-family"><xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
|
1630
|
+
<xsl:attribute name="line-height">113%</xsl:attribute>
|
1631
|
+
|
1632
|
+
</xsl:attribute-set>
|
1633
|
+
|
1619
1634
|
<xsl:attribute-set name="permission-style">
|
1620
1635
|
|
1621
1636
|
</xsl:attribute-set>
|
@@ -1724,6 +1739,11 @@
|
|
1724
1739
|
</xsl:variable>
|
1725
1740
|
<xsl:variable name="table-border" select="normalize-space($table-border_)"/>
|
1726
1741
|
|
1742
|
+
<xsl:variable name="table-cell-border_">
|
1743
|
+
|
1744
|
+
</xsl:variable>
|
1745
|
+
<xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
|
1746
|
+
|
1727
1747
|
<xsl:attribute-set name="table-container-style">
|
1728
1748
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
1729
1749
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
@@ -1735,8 +1755,6 @@
|
|
1735
1755
|
<xsl:attribute-set name="table-style">
|
1736
1756
|
<xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
|
1737
1757
|
<xsl:attribute name="table-layout">fixed</xsl:attribute>
|
1738
|
-
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
1739
|
-
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
1740
1758
|
|
1741
1759
|
<xsl:attribute name="border">0pt solid black</xsl:attribute>
|
1742
1760
|
<xsl:attribute name="font-size">9.5pt</xsl:attribute> <!-- 8pt -->
|
@@ -2648,17 +2666,22 @@
|
|
2648
2666
|
</xsl:for-each>
|
2649
2667
|
</xsl:template>
|
2650
2668
|
|
2669
|
+
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
2651
2670
|
<xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
|
2652
2671
|
<xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
|
2653
2672
|
<xsl:template match="text()" name="text">
|
2654
2673
|
|
2655
|
-
<xsl:
|
2656
|
-
|
2657
|
-
|
2658
|
-
|
2659
|
-
|
2660
|
-
|
2661
|
-
|
2674
|
+
<xsl:choose>
|
2675
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when>
|
2676
|
+
<xsl:otherwise>
|
2677
|
+
<xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/>
|
2678
|
+
<xsl:call-template name="replace_fo_inline_tags">
|
2679
|
+
<xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
|
2680
|
+
<xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
|
2681
|
+
<xsl:with-param name="text" select="$text"/>
|
2682
|
+
</xsl:call-template>
|
2683
|
+
</xsl:otherwise>
|
2684
|
+
</xsl:choose>
|
2662
2685
|
|
2663
2686
|
</xsl:template>
|
2664
2687
|
|
@@ -2917,6 +2940,12 @@
|
|
2917
2940
|
<xsl:variable name="table_attributes">
|
2918
2941
|
|
2919
2942
|
<xsl:element name="table_attributes" use-attribute-sets="table-style">
|
2943
|
+
|
2944
|
+
<xsl:if test="$margin-side != 0">
|
2945
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2946
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
2947
|
+
</xsl:if>
|
2948
|
+
|
2920
2949
|
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
|
2921
2950
|
|
2922
2951
|
</xsl:element>
|
@@ -3020,7 +3049,7 @@
|
|
3020
3049
|
|
3021
3050
|
<!-- centered table when table name is centered (see table-name-style) -->
|
3022
3051
|
|
3023
|
-
<fo:table table-layout="fixed" width="100%">
|
3052
|
+
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
|
3024
3053
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
3025
3054
|
<fo:table-column column-width="{@width}"/>
|
3026
3055
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
@@ -3673,6 +3702,10 @@
|
|
3673
3702
|
<xsl:template match="*[local-name()='tr']">
|
3674
3703
|
<fo:table-row xsl:use-attribute-sets="table-body-row-style">
|
3675
3704
|
|
3705
|
+
<xsl:if test="count(*) = count(*[local-name() = 'th'])"> <!-- row contains 'th' only -->
|
3706
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
3707
|
+
</xsl:if>
|
3708
|
+
|
3676
3709
|
<xsl:variable name="number"><xsl:number/></xsl:variable>
|
3677
3710
|
<xsl:if test="$number mod 2 = 0">
|
3678
3711
|
<xsl:attribute name="background-color">rgb(254, 247, 228)</xsl:attribute>
|
@@ -4636,7 +4669,8 @@
|
|
4636
4669
|
<xsl:copy-of select="node()"/>
|
4637
4670
|
</td>
|
4638
4671
|
<td>
|
4639
|
-
<xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
|
4672
|
+
<!-- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/> -->
|
4673
|
+
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]" mode="dl_if"/>
|
4640
4674
|
<!-- get paragraphs from nested 'dl' -->
|
4641
4675
|
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
4642
4676
|
</td>
|
@@ -4644,6 +4678,53 @@
|
|
4644
4678
|
</xsl:template>
|
4645
4679
|
<xsl:template match="*[local-name()='dd']" mode="dl_if"/>
|
4646
4680
|
|
4681
|
+
<xsl:template match="*" mode="dl_if">
|
4682
|
+
<xsl:copy-of select="."/>
|
4683
|
+
</xsl:template>
|
4684
|
+
|
4685
|
+
<xsl:template match="*[local-name() = 'p']" mode="dl_if">
|
4686
|
+
<xsl:param name="indent"/>
|
4687
|
+
<p>
|
4688
|
+
<xsl:copy-of select="@*"/>
|
4689
|
+
<xsl:value-of select="$indent"/>
|
4690
|
+
<xsl:copy-of select="node()"/>
|
4691
|
+
</p>
|
4692
|
+
|
4693
|
+
</xsl:template>
|
4694
|
+
|
4695
|
+
<xsl:template match="*[local-name() = 'ul' or local-name() = 'ol']" mode="dl_if">
|
4696
|
+
<xsl:variable name="list_rendered_">
|
4697
|
+
<xsl:apply-templates select="."/>
|
4698
|
+
</xsl:variable>
|
4699
|
+
<xsl:variable name="list_rendered" select="xalan:nodeset($list_rendered_)"/>
|
4700
|
+
|
4701
|
+
<xsl:variable name="indent">
|
4702
|
+
<xsl:for-each select="($list_rendered//fo:block[not(.//fo:block)])[1]">
|
4703
|
+
<xsl:apply-templates select="ancestor::*[@provisional-distance-between-starts]/@provisional-distance-between-starts" mode="dl_if"/>
|
4704
|
+
</xsl:for-each>
|
4705
|
+
</xsl:variable>
|
4706
|
+
|
4707
|
+
<xsl:apply-templates mode="dl_if">
|
4708
|
+
<xsl:with-param name="indent" select="$indent"/>
|
4709
|
+
</xsl:apply-templates>
|
4710
|
+
</xsl:template>
|
4711
|
+
|
4712
|
+
<xsl:template match="*[local-name() = 'li']" mode="dl_if">
|
4713
|
+
<xsl:param name="indent"/>
|
4714
|
+
<xsl:apply-templates mode="dl_if">
|
4715
|
+
<xsl:with-param name="indent" select="$indent"/>
|
4716
|
+
</xsl:apply-templates>
|
4717
|
+
</xsl:template>
|
4718
|
+
|
4719
|
+
<xsl:template match="@provisional-distance-between-starts" mode="dl_if">
|
4720
|
+
<xsl:variable name="value" select="round(substring-before(.,'mm'))"/>
|
4721
|
+
<!-- emulate left indent for list item -->
|
4722
|
+
<xsl:call-template name="repeat">
|
4723
|
+
<xsl:with-param name="char" select="'x'"/>
|
4724
|
+
<xsl:with-param name="count" select="$value"/>
|
4725
|
+
</xsl:call-template>
|
4726
|
+
</xsl:template>
|
4727
|
+
|
4647
4728
|
<xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
|
4648
4729
|
<xsl:for-each select="*[local-name() = 'dt']">
|
4649
4730
|
<p>
|
@@ -5047,6 +5128,7 @@
|
|
5047
5128
|
</word>
|
5048
5129
|
<xsl:call-template name="tokenize_with_tags">
|
5049
5130
|
<xsl:with-param name="text" select="substring-after($text, $separator)"/>
|
5131
|
+
<xsl:with-param name="tags" select="$tags"/>
|
5050
5132
|
</xsl:call-template>
|
5051
5133
|
</xsl:otherwise>
|
5052
5134
|
</xsl:choose>
|
@@ -5086,8 +5168,18 @@
|
|
5086
5168
|
|
5087
5169
|
<xsl:template name="add-zero-spaces-java">
|
5088
5170
|
<xsl:param name="text" select="."/>
|
5089
|
-
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space
|
5090
|
-
<xsl:
|
5171
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
|
5172
|
+
<xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1')"/>
|
5173
|
+
<!-- add zero-width space (#x200B) after characters: 'great than' -->
|
5174
|
+
<xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1), '(\u003e)(?!\u003e)', '$1')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
|
5175
|
+
<!-- add zero-width space (#x200B) before characters: 'less than' -->
|
5176
|
+
<xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2), '(?<!\u003c)(\u003c)', '$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
|
5177
|
+
<!-- add zero-width space (#x200B) before character: { -->
|
5178
|
+
<xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?<!\W)(\{)', '$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
|
5179
|
+
<!-- add zero-width space (#x200B) after character: , -->
|
5180
|
+
<xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1')"/> <!-- negative lookahead: ',' not followed by digit -->
|
5181
|
+
|
5182
|
+
<xsl:value-of select="$text5"/>
|
5091
5183
|
</xsl:template>
|
5092
5184
|
|
5093
5185
|
<xsl:template name="add-zero-spaces-link-java">
|
@@ -5233,7 +5325,7 @@
|
|
5233
5325
|
</xsl:copy>
|
5234
5326
|
</xsl:template>
|
5235
5327
|
|
5236
|
-
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br">
|
5328
|
+
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
|
5237
5329
|
<xsl:copy>
|
5238
5330
|
<xsl:copy-of select="@*"/>
|
5239
5331
|
<p>
|
@@ -5281,6 +5373,28 @@
|
|
5281
5373
|
</xsl:for-each>
|
5282
5374
|
</xsl:template>
|
5283
5375
|
|
5376
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']" mode="table-without-br">
|
5377
|
+
<xsl:apply-templates mode="table-without-br"/>
|
5378
|
+
</xsl:template>
|
5379
|
+
|
5380
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']/text()[contains(., ' ') or contains(., ' ')]" mode="table-without-br">
|
5381
|
+
|
5382
|
+
<xsl:variable name="sep">###SOURCECODE_NEWLINE###</xsl:variable>
|
5383
|
+
<xsl:variable name="sourcecode_text" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', $sep)"/>
|
5384
|
+
<xsl:variable name="items">
|
5385
|
+
<xsl:call-template name="split">
|
5386
|
+
<xsl:with-param name="pText" select="$sourcecode_text"/>
|
5387
|
+
<xsl:with-param name="sep" select="$sep"/>
|
5388
|
+
<xsl:with-param name="normalize-space">false</xsl:with-param>
|
5389
|
+
</xsl:call-template>
|
5390
|
+
</xsl:variable>
|
5391
|
+
<xsl:for-each select="xalan:nodeset($items)/*">
|
5392
|
+
<p>
|
5393
|
+
<sourcecode><xsl:copy-of select="node()"/></sourcecode>
|
5394
|
+
</p>
|
5395
|
+
</xsl:for-each>
|
5396
|
+
</xsl:template>
|
5397
|
+
|
5284
5398
|
<!-- remove redundant white spaces -->
|
5285
5399
|
<xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
|
5286
5400
|
<xsl:variable name="text" select="translate(.,'	 ','')"/>
|
@@ -5591,6 +5705,7 @@
|
|
5591
5705
|
<xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
|
5592
5706
|
<xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
|
5593
5707
|
<xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
|
5708
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
|
5594
5709
|
<xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
|
5595
5710
|
</tags>
|
5596
5711
|
</xsl:template>
|
@@ -5653,6 +5768,9 @@
|
|
5653
5768
|
<xsl:value-of select="substring($str, 2)"/>
|
5654
5769
|
</xsl:template>
|
5655
5770
|
|
5771
|
+
<!-- ======================================= -->
|
5772
|
+
<!-- math -->
|
5773
|
+
<!-- ======================================= -->
|
5656
5774
|
<xsl:template match="mathml:math">
|
5657
5775
|
<xsl:variable name="isAdded" select="@added"/>
|
5658
5776
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -5703,14 +5821,57 @@
|
|
5703
5821
|
<xsl:value-of select="$comment_text"/>
|
5704
5822
|
</xsl:template>
|
5705
5823
|
|
5824
|
+
<xsl:template match="*[local-name() = 'asciimath']">
|
5825
|
+
<xsl:param name="process" select="'false'"/>
|
5826
|
+
<xsl:if test="$process = 'true'">
|
5827
|
+
<xsl:apply-templates/>
|
5828
|
+
</xsl:if>
|
5829
|
+
</xsl:template>
|
5830
|
+
|
5831
|
+
<xsl:template match="*[local-name() = 'latexmath']"/>
|
5832
|
+
|
5833
|
+
<xsl:template name="getMathml_asciimath_text">
|
5834
|
+
<xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
|
5835
|
+
<xsl:variable name="latexmath">
|
5836
|
+
|
5837
|
+
</xsl:variable>
|
5838
|
+
<xsl:variable name="asciimath_text_following">
|
5839
|
+
<xsl:choose>
|
5840
|
+
<xsl:when test="normalize-space($latexmath) != ''">
|
5841
|
+
<xsl:value-of select="$latexmath"/>
|
5842
|
+
</xsl:when>
|
5843
|
+
<xsl:when test="normalize-space($asciimath) != ''">
|
5844
|
+
<xsl:value-of select="$asciimath"/>
|
5845
|
+
</xsl:when>
|
5846
|
+
<xsl:otherwise>
|
5847
|
+
<xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
|
5848
|
+
</xsl:otherwise>
|
5849
|
+
</xsl:choose>
|
5850
|
+
</xsl:variable>
|
5851
|
+
<xsl:variable name="asciimath_text_">
|
5852
|
+
<xsl:choose>
|
5853
|
+
<xsl:when test="normalize-space($asciimath_text_following) != ''">
|
5854
|
+
<xsl:value-of select="$asciimath_text_following"/>
|
5855
|
+
</xsl:when>
|
5856
|
+
<xsl:otherwise>
|
5857
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
5858
|
+
</xsl:otherwise>
|
5859
|
+
</xsl:choose>
|
5860
|
+
</xsl:variable>
|
5861
|
+
<xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
|
5862
|
+
<xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
|
5863
|
+
<xsl:value-of select="$asciimath_text"/>
|
5864
|
+
</xsl:template>
|
5865
|
+
|
5706
5866
|
<xsl:template name="mathml_instream_object">
|
5707
|
-
<xsl:param name="
|
5867
|
+
<xsl:param name="asciimath_text"/>
|
5708
5868
|
<xsl:param name="mathml_content"/>
|
5709
5869
|
|
5710
|
-
<xsl:variable name="
|
5870
|
+
<xsl:variable name="asciimath_text_">
|
5711
5871
|
<xsl:choose>
|
5712
|
-
<xsl:when test="normalize-space($
|
5713
|
-
<xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
|
5872
|
+
<xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
|
5873
|
+
<!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
|
5874
|
+
<xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
|
5714
5875
|
</xsl:choose>
|
5715
5876
|
</xsl:variable>
|
5716
5877
|
|
@@ -5727,10 +5888,10 @@
|
|
5727
5888
|
</xsl:attribute>
|
5728
5889
|
|
5729
5890
|
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
5730
|
-
<xsl:if test="normalize-space($
|
5891
|
+
<xsl:if test="normalize-space($asciimath_text_) != ''">
|
5731
5892
|
<!-- put Mathin Alternate Text -->
|
5732
5893
|
<xsl:attribute name="fox:alt-text">
|
5733
|
-
<xsl:value-of select="$
|
5894
|
+
<xsl:value-of select="$asciimath_text_"/>
|
5734
5895
|
</xsl:attribute>
|
5735
5896
|
</xsl:if>
|
5736
5897
|
<!-- </xsl:if> -->
|
@@ -5803,6 +5964,29 @@
|
|
5803
5964
|
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
5804
5965
|
</xsl:template>
|
5805
5966
|
|
5967
|
+
<!-- Examples:
|
5968
|
+
<stem type="AsciiMath">x = 1</stem>
|
5969
|
+
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
5970
|
+
<stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
|
5971
|
+
-->
|
5972
|
+
<xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
|
5973
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
5974
|
+
|
5975
|
+
<xsl:choose>
|
5976
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
5977
|
+
<xsl:otherwise>
|
5978
|
+
<xsl:apply-templates>
|
5979
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
5980
|
+
</xsl:apply-templates>
|
5981
|
+
</xsl:otherwise>
|
5982
|
+
</xsl:choose>
|
5983
|
+
|
5984
|
+
</fo:inline>
|
5985
|
+
</xsl:template>
|
5986
|
+
<!-- ======================================= -->
|
5987
|
+
<!-- END: math -->
|
5988
|
+
<!-- ======================================= -->
|
5989
|
+
|
5806
5990
|
<xsl:template match="*[local-name()='localityStack']"/>
|
5807
5991
|
|
5808
5992
|
<xsl:template match="*[local-name()='link']" name="link">
|
@@ -6016,6 +6200,12 @@
|
|
6016
6200
|
|
6017
6201
|
<fo:block-container margin-left="0mm">
|
6018
6202
|
|
6203
|
+
<!-- <xsl:if test="$namespace = 'iho'">
|
6204
|
+
<xsl:if test="ancestor::iho:td">
|
6205
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
6206
|
+
</xsl:if>
|
6207
|
+
</xsl:if> -->
|
6208
|
+
|
6019
6209
|
<fo:block>
|
6020
6210
|
|
6021
6211
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
@@ -7155,49 +7345,25 @@
|
|
7155
7345
|
<xsl:apply-templates mode="contents_item"/>
|
7156
7346
|
</xsl:template>
|
7157
7347
|
|
7158
|
-
<!--
|
7159
|
-
<!-- sourcecode
|
7160
|
-
<!--
|
7348
|
+
<!-- =============== -->
|
7349
|
+
<!-- sourcecode -->
|
7350
|
+
<!-- =============== -->
|
7161
7351
|
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
7162
7352
|
|
7163
|
-
<
|
7164
|
-
|
7165
|
-
|
7166
|
-
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
7167
|
-
</xsl:if>
|
7168
|
-
|
7169
|
-
<xsl:if test="ancestor::*[local-name() = 'example']">
|
7170
|
-
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
7171
|
-
</xsl:if>
|
7172
|
-
|
7173
|
-
<xsl:copy-of select="@id"/>
|
7174
|
-
|
7175
|
-
<xsl:if test="parent::*[local-name() = 'note']">
|
7176
|
-
<xsl:attribute name="margin-left">
|
7177
|
-
<xsl:choose>
|
7178
|
-
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
7179
|
-
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
7180
|
-
</xsl:choose>
|
7181
|
-
</xsl:attribute>
|
7182
|
-
|
7183
|
-
</xsl:if>
|
7184
|
-
<fo:block-container margin-left="0mm">
|
7185
|
-
|
7186
|
-
<xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name BEFORE content -->
|
7187
|
-
|
7188
|
-
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
7189
|
-
<xsl:variable name="_font-size">
|
7353
|
+
<xsl:variable name="sourcecode_attributes">
|
7354
|
+
<xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
|
7355
|
+
<xsl:variable name="_font-size">
|
7190
7356
|
|
7191
|
-
|
7357
|
+
<!-- 9 -->
|
7192
7358
|
|
7193
|
-
|
7194
|
-
|
7195
|
-
|
7359
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
7360
|
+
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
7361
|
+
</xsl:if> -->
|
7196
7362
|
|
7197
|
-
|
7198
|
-
|
7199
|
-
|
7200
|
-
|
7363
|
+
<xsl:choose>
|
7364
|
+
<xsl:when test="ancestor::*[local-name() = 'table']">inherit</xsl:when>
|
7365
|
+
<xsl:otherwise>95%</xsl:otherwise><!-- 110% -->
|
7366
|
+
</xsl:choose>
|
7201
7367
|
|
7202
7368
|
</xsl:variable>
|
7203
7369
|
|
@@ -7212,26 +7378,74 @@
|
|
7212
7378
|
</xsl:choose>
|
7213
7379
|
</xsl:attribute>
|
7214
7380
|
</xsl:if>
|
7381
|
+
</xsl:element>
|
7382
|
+
</xsl:variable>
|
7215
7383
|
|
7216
|
-
|
7217
|
-
|
7218
|
-
|
7219
|
-
|
7384
|
+
<xsl:choose>
|
7385
|
+
<xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
|
7386
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
7387
|
+
<xsl:attribute name="{local-name()}">
|
7388
|
+
<xsl:value-of select="."/>
|
7389
|
+
</xsl:attribute>
|
7390
|
+
</xsl:for-each>
|
7391
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
7392
|
+
</xsl:when>
|
7393
|
+
|
7394
|
+
<xsl:otherwise>
|
7395
|
+
<fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
|
7396
|
+
|
7397
|
+
<xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
|
7220
7398
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
7221
|
-
|
7399
|
+
</xsl:if>
|
7400
|
+
|
7401
|
+
<xsl:if test="ancestor::*[local-name() = 'example']">
|
7222
7402
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
7223
|
-
<xsl:attribute name="padding-top">7.5mm</xsl:attribute>
|
7224
|
-
<xsl:attribute name="padding-bottom">7.5mm</xsl:attribute>
|
7225
|
-
<xsl:if test="following-sibling::*[1][local-name() = 'sourcecode'] and starts-with(*[local-name() = 'name']/text()[1], 'Figure ')">
|
7226
|
-
<xsl:attribute name="margin-bottom">16pt</xsl:attribute>
|
7227
|
-
</xsl:if>
|
7228
7403
|
</xsl:if>
|
7229
7404
|
|
7230
|
-
|
7231
|
-
</fo:block>
|
7405
|
+
<xsl:copy-of select="@id"/>
|
7232
7406
|
|
7233
|
-
|
7234
|
-
|
7407
|
+
<xsl:if test="parent::*[local-name() = 'note']">
|
7408
|
+
<xsl:attribute name="margin-left">
|
7409
|
+
<xsl:choose>
|
7410
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
7411
|
+
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
7412
|
+
</xsl:choose>
|
7413
|
+
</xsl:attribute>
|
7414
|
+
|
7415
|
+
</xsl:if>
|
7416
|
+
<fo:block-container margin-left="0mm">
|
7417
|
+
|
7418
|
+
<xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name BEFORE content -->
|
7419
|
+
|
7420
|
+
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
7421
|
+
|
7422
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
7423
|
+
<xsl:attribute name="{local-name()}">
|
7424
|
+
<xsl:value-of select="."/>
|
7425
|
+
</xsl:attribute>
|
7426
|
+
</xsl:for-each>
|
7427
|
+
|
7428
|
+
<!-- background for image -->
|
7429
|
+
<xsl:if test="starts-with(*[local-name() = 'name']/text()[1], 'Figure ')">
|
7430
|
+
<xsl:attribute name="background-color">rgb(236,242,246)</xsl:attribute>
|
7431
|
+
<xsl:attribute name="padding-left">11mm</xsl:attribute>
|
7432
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
7433
|
+
<xsl:attribute name="padding-right">11mm</xsl:attribute>
|
7434
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
7435
|
+
<xsl:attribute name="padding-top">7.5mm</xsl:attribute>
|
7436
|
+
<xsl:attribute name="padding-bottom">7.5mm</xsl:attribute>
|
7437
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'sourcecode'] and starts-with(*[local-name() = 'name']/text()[1], 'Figure ')">
|
7438
|
+
<xsl:attribute name="margin-bottom">16pt</xsl:attribute>
|
7439
|
+
</xsl:if>
|
7440
|
+
</xsl:if>
|
7441
|
+
|
7442
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
7443
|
+
</fo:block>
|
7444
|
+
|
7445
|
+
</fo:block-container>
|
7446
|
+
</fo:block-container>
|
7447
|
+
</xsl:otherwise>
|
7448
|
+
</xsl:choose>
|
7235
7449
|
</xsl:template>
|
7236
7450
|
|
7237
7451
|
<xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -7473,8 +7687,22 @@
|
|
7473
7687
|
</fo:block>
|
7474
7688
|
</xsl:if>
|
7475
7689
|
</xsl:template>
|
7476
|
-
<!--
|
7477
|
-
<!--
|
7690
|
+
<!-- =============== -->
|
7691
|
+
<!-- END sourcecode -->
|
7692
|
+
<!-- =============== -->
|
7693
|
+
|
7694
|
+
<!-- =============== -->
|
7695
|
+
<!-- pre -->
|
7696
|
+
<!-- =============== -->
|
7697
|
+
<xsl:template match="*[local-name()='pre']" name="pre">
|
7698
|
+
<fo:block xsl:use-attribute-sets="pre-style">
|
7699
|
+
<xsl:copy-of select="@id"/>
|
7700
|
+
<xsl:apply-templates/>
|
7701
|
+
</fo:block>
|
7702
|
+
</xsl:template>
|
7703
|
+
<!-- =============== -->
|
7704
|
+
<!-- pre -->
|
7705
|
+
<!-- =============== -->
|
7478
7706
|
|
7479
7707
|
<!-- ========== -->
|
7480
7708
|
<!-- permission -->
|
@@ -9441,7 +9669,9 @@
|
|
9441
9669
|
<!-- ===================================== -->
|
9442
9670
|
<!-- Update xml -->
|
9443
9671
|
<!-- ===================================== -->
|
9672
|
+
<!-- =========================================================================== -->
|
9444
9673
|
<!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
9674
|
+
<!-- =========================================================================== -->
|
9445
9675
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
9446
9676
|
<xsl:copy>
|
9447
9677
|
<xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
|
@@ -9533,10 +9763,15 @@
|
|
9533
9763
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
9534
9764
|
<xsl:apply-templates mode="update_xml_step1"/>
|
9535
9765
|
</xsl:template>
|
9536
|
-
|
9766
|
+
<!-- =========================================================================== -->
|
9537
9767
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
9768
|
+
<!-- =========================================================================== -->
|
9538
9769
|
|
9770
|
+
<!-- =========================================================================== -->
|
9539
9771
|
<!-- XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
|
9772
|
+
<!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
|
9773
|
+
<!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
|
9774
|
+
<!-- =========================================================================== -->
|
9540
9775
|
<!-- Example: <keep-together_within-line>ISO 10303-51</keep-together_within-line> -->
|
9541
9776
|
<xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
|
9542
9777
|
<xsl:copy>
|
@@ -9552,10 +9787,15 @@
|
|
9552
9787
|
<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 starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
9553
9788
|
|
9554
9789
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
9555
|
-
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
9556
9790
|
<xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
9557
9791
|
<xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
9558
|
-
<xsl:variable name="
|
9792
|
+
<xsl:variable name="text__" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
|
9793
|
+
<xsl:variable name="text_">
|
9794
|
+
<xsl:choose>
|
9795
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
|
9796
|
+
<xsl:otherwise><xsl:value-of select="$text__"/></xsl:otherwise>
|
9797
|
+
</xsl:choose>
|
9798
|
+
</xsl:variable>
|
9559
9799
|
<xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
|
9560
9800
|
<xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
|
9561
9801
|
<xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
|
@@ -9571,7 +9811,11 @@
|
|
9571
9811
|
</xsl:variable>
|
9572
9812
|
|
9573
9813
|
<!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
|
9574
|
-
|
9814
|
+
<!-- \S matches any non-whitespace character (equivalent to [^\r\n\t\f\v ]) -->
|
9815
|
+
<!-- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable> -->
|
9816
|
+
<!-- add < and > to \S -->
|
9817
|
+
<xsl:variable name="regex_S">[^\r\n\t\f\v \<>]</xsl:variable>
|
9818
|
+
<xsl:variable name="regex_solidus_units">((\b((<xsl:value-of select="$regex_S"/>{1,3}\/<xsl:value-of select="$regex_S"/>+)|(<xsl:value-of select="$regex_S"/>+\/<xsl:value-of select="$regex_S"/>{1,3}))\b)|(\/<xsl:value-of select="$regex_S"/>{1,3})\b)</xsl:variable>
|
9575
9819
|
<xsl:variable name="text3">
|
9576
9820
|
<text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
|
9577
9821
|
<xsl:choose>
|
@@ -9635,9 +9879,8 @@
|
|
9635
9879
|
<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
|
9636
9880
|
</xsl:choose>
|
9637
9881
|
</xsl:template>
|
9638
|
-
|
9639
9882
|
<!-- ===================================== -->
|
9640
|
-
<!--
|
9883
|
+
<!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
|
9641
9884
|
<!-- ===================================== -->
|
9642
9885
|
|
9643
9886
|
<!-- for correct rendering combining chars -->
|
@@ -10025,13 +10268,14 @@
|
|
10025
10268
|
</xsl:template>
|
10026
10269
|
|
10027
10270
|
<xsl:template name="setId">
|
10271
|
+
<xsl:param name="prefix"/>
|
10028
10272
|
<xsl:attribute name="id">
|
10029
10273
|
<xsl:choose>
|
10030
10274
|
<xsl:when test="@id">
|
10031
|
-
<xsl:value-of select="@id"/>
|
10275
|
+
<xsl:value-of select="concat($prefix, @id)"/>
|
10032
10276
|
</xsl:when>
|
10033
10277
|
<xsl:otherwise>
|
10034
|
-
<xsl:value-of select="generate-id()"/>
|
10278
|
+
<xsl:value-of select="concat($prefix, generate-id())"/>
|
10035
10279
|
</xsl:otherwise>
|
10036
10280
|
</xsl:choose>
|
10037
10281
|
</xsl:attribute>
|