metanorma-ogc 2.0.7 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ogc/biblio.rb +1 -134
- data/lib/isodoc/ogc/html/html_ogc_titlepage.html +2 -0
- data/lib/isodoc/ogc/html/word_ogc_titlepage.html +3 -0
- data/lib/isodoc/ogc/html/word_ogc_titlepage_wp.html +3 -0
- data/lib/isodoc/ogc/init.rb +5 -6
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +547 -190
- data/lib/isodoc/ogc/ogc.best-practice.xsl +547 -190
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +547 -190
- data/lib/isodoc/ogc/ogc.community-practice.xsl +547 -190
- data/lib/isodoc/ogc/ogc.community-standard.xsl +547 -190
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +547 -190
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +547 -190
- data/lib/isodoc/ogc/ogc.other.xsl +547 -190
- data/lib/isodoc/ogc/ogc.policy.xsl +547 -190
- data/lib/isodoc/ogc/ogc.reference-model.xsl +547 -190
- data/lib/isodoc/ogc/ogc.release-notes.xsl +547 -190
- data/lib/isodoc/ogc/ogc.standard.xsl +547 -190
- data/lib/isodoc/ogc/ogc.test-suite.xsl +547 -190
- data/lib/isodoc/ogc/ogc.user-guide.xsl +547 -190
- data/lib/isodoc/ogc/ogc.white-paper.xsl +552 -197
- data/lib/isodoc/ogc/presentation_xml_convert.rb +15 -10
- data/lib/isodoc/ogc/word_convert.rb +3 -3
- data/lib/isodoc/ogc/xref.rb +6 -2
- data/lib/metanorma/ogc/biblio.rng +62 -10
- data/lib/metanorma/ogc/isodoc.rng +56 -0
- data/lib/metanorma/ogc/version.rb +1 -1
- data/lib/relaton/render/config.yml +10 -0
- data/lib/relaton/render/date.rb +9 -0
- data/lib/relaton/render/fields.rb +23 -0
- data/lib/relaton/render/general.rb +25 -0
- data/lib/relaton/render/parse.rb +11 -0
- data/metanorma-ogc.gemspec +1 -1
- metadata +9 -4
@@ -87,7 +87,13 @@
|
|
87
87
|
|
88
88
|
<xsl:template match="/">
|
89
89
|
<xsl:call-template name="namespaceCheck"/>
|
90
|
-
<fo:root
|
90
|
+
<fo:root xml:lang="{$lang}">
|
91
|
+
<xsl:variable name="root-style">
|
92
|
+
<root-style xsl:use-attribute-sets="root-style"/>
|
93
|
+
</xsl:variable>
|
94
|
+
<xsl:call-template name="insertRootStyle">
|
95
|
+
<xsl:with-param name="root-style" select="$root-style"/>
|
96
|
+
</xsl:call-template>
|
91
97
|
<fo:layout-master-set>
|
92
98
|
|
93
99
|
<!-- Document pages -->
|
@@ -138,10 +144,7 @@
|
|
138
144
|
<fo:block margin-top="6pt">URL for this OGC® document: <xsl:value-of select="$url"/></fo:block>
|
139
145
|
</xsl:if>
|
140
146
|
|
141
|
-
<xsl:
|
142
|
-
<xsl:if test="normalize-space($edition) != ''">
|
143
|
-
<fo:block margin-top="6pt">Version: <xsl:value-of select="$edition"/></fo:block>
|
144
|
-
</xsl:if>
|
147
|
+
<xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:edition[normalize-space(@language) = '']"/>
|
145
148
|
|
146
149
|
<fo:block margin-top="6pt"><xsl:text>Category: </xsl:text>
|
147
150
|
<xsl:call-template name="capitalizeWords">
|
@@ -365,16 +368,21 @@
|
|
365
368
|
</fo:block>
|
366
369
|
</xsl:template>
|
367
370
|
|
371
|
+
|
368
372
|
<xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:edition">
|
369
|
-
<
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
+
<xsl:variable name="edition" select="."/>
|
374
|
+
<xsl:if test="normalize-space($edition) != ''">
|
375
|
+
<fo:block margin-top="6pt">
|
376
|
+
<xsl:call-template name="capitalize">
|
377
|
+
<xsl:with-param name="str">
|
378
|
+
<xsl:call-template name="getLocalizedString">
|
379
|
+
<xsl:with-param name="key">version</xsl:with-param>
|
380
|
+
</xsl:call-template>
|
381
|
+
</xsl:with-param>
|
373
382
|
</xsl:call-template>
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
</fo:block>
|
383
|
+
<xsl:text>: </xsl:text><xsl:value-of select="$edition"/>
|
384
|
+
</fo:block>
|
385
|
+
</xsl:if>
|
378
386
|
</xsl:template>
|
379
387
|
|
380
388
|
|
@@ -632,7 +640,7 @@
|
|
632
640
|
</xsl:choose>
|
633
641
|
</xsl:template>
|
634
642
|
|
635
|
-
<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
|
643
|
+
<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:variable name="lang">
|
636
644
|
<xsl:call-template name="getLang"/>
|
637
645
|
</xsl:variable><xsl:variable name="pageWidth_">
|
638
646
|
215.9
|
@@ -647,20 +655,7 @@
|
|
647
655
|
</xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
|
648
656
|
25.4
|
649
657
|
</xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
|
650
|
-
|
651
|
-
<title-edition lang="en">
|
652
|
-
|
653
|
-
<xsl:text>Version</xsl:text>
|
654
|
-
|
655
|
-
</title-edition>
|
656
658
|
|
657
|
-
<title-edition lang="fr">
|
658
|
-
<xsl:text>Édition </xsl:text>
|
659
|
-
</title-edition>
|
660
|
-
|
661
|
-
<title-edition lang="ru">
|
662
|
-
<xsl:text>Издание </xsl:text>
|
663
|
-
</title-edition>
|
664
659
|
|
665
660
|
<!-- These titles of Table of contents renders different than determined in localized-strings -->
|
666
661
|
<title-toc lang="en">
|
@@ -741,7 +736,7 @@
|
|
741
736
|
</xsl:variable><xsl:variable name="bibdata">
|
742
737
|
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
|
743
738
|
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
|
744
|
-
</xsl:variable><xsl:variable name="linebreak">
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space"></xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
|
739
|
+
</xsl:variable><xsl:variable name="linebreak">
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space"></xsl:variable><xsl:variable name="hair_space"> </xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
|
745
740
|
<xsl:param name="name"/>
|
746
741
|
<xsl:param name="lang"/>
|
747
742
|
<xsl:variable name="lang_">
|
@@ -784,7 +779,30 @@
|
|
784
779
|
|
785
780
|
|
786
781
|
|
787
|
-
</xsl:attribute-set><xsl:
|
782
|
+
</xsl:attribute-set><xsl:template name="insertRootStyle">
|
783
|
+
<xsl:param name="root-style"/>
|
784
|
+
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
785
|
+
|
786
|
+
<xsl:variable name="additional_fonts_">
|
787
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
788
|
+
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
789
|
+
</xsl:for-each>
|
790
|
+
</xsl:variable>
|
791
|
+
<xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
|
792
|
+
|
793
|
+
<xsl:for-each select="$root-style_/root-style/@*">
|
794
|
+
<xsl:choose>
|
795
|
+
<xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
|
796
|
+
<xsl:attribute name="{local-name()}">
|
797
|
+
<xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
|
798
|
+
</xsl:attribute>
|
799
|
+
</xsl:when>
|
800
|
+
<xsl:otherwise>
|
801
|
+
<xsl:copy-of select="."/>
|
802
|
+
</xsl:otherwise>
|
803
|
+
</xsl:choose>
|
804
|
+
</xsl:for-each>
|
805
|
+
</xsl:template><xsl:attribute-set name="copyright-statement-style">
|
788
806
|
|
789
807
|
</xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
|
790
808
|
|
@@ -863,7 +881,6 @@
|
|
863
881
|
|
864
882
|
|
865
883
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style">
|
866
|
-
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
867
884
|
|
868
885
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
869
886
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
@@ -990,6 +1007,7 @@
|
|
990
1007
|
|
991
1008
|
|
992
1009
|
|
1010
|
+
|
993
1011
|
</xsl:attribute-set><xsl:attribute-set name="example-name-style">
|
994
1012
|
|
995
1013
|
|
@@ -1384,7 +1402,7 @@
|
|
1384
1402
|
|
1385
1403
|
|
1386
1404
|
|
1387
|
-
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1405
|
+
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1388
1406
|
|
1389
1407
|
|
1390
1408
|
|
@@ -2119,22 +2137,32 @@
|
|
2119
2137
|
<xsl:sort select="@displayorder" data-type="number"/>
|
2120
2138
|
<xsl:apply-templates select="."/>
|
2121
2139
|
</xsl:for-each>
|
2122
|
-
</xsl:template><xsl:variable name="
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2140
|
+
</xsl:template><xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable><xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable><xsl:template match="text()" name="text">
|
2141
|
+
|
2142
|
+
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
2143
|
+
<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))"/>
|
2144
|
+
<xsl:call-template name="replace_fo_inline_tags">
|
2145
|
+
<xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
|
2146
|
+
<xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
|
2147
|
+
<xsl:with-param name="text" select="$text"/>
|
2148
|
+
</xsl:call-template>
|
2149
|
+
|
2150
|
+
</xsl:template><xsl:template name="replace_fo_inline_tags">
|
2151
|
+
<xsl:param name="tag_open"/>
|
2152
|
+
<xsl:param name="tag_close"/>
|
2129
2153
|
<xsl:param name="text"/>
|
2130
2154
|
<xsl:choose>
|
2131
2155
|
<xsl:when test="contains($text, $tag_open)">
|
2132
2156
|
<xsl:value-of select="substring-before($text, $tag_open)"/>
|
2133
|
-
<xsl:text disable-output-escaping="yes"><fo:inline keep-together.within-line="always"></xsl:text>
|
2157
|
+
<!-- <xsl:text disable-output-escaping="yes"><fo:inline keep-together.within-line="always"></xsl:text> -->
|
2134
2158
|
<xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
|
2135
|
-
<
|
2136
|
-
|
2137
|
-
|
2159
|
+
<fo:inline keep-together.within-line="always">
|
2160
|
+
<xsl:value-of select="substring-before($text_after, $tag_close)"/>
|
2161
|
+
</fo:inline>
|
2162
|
+
<!-- <xsl:text disable-output-escaping="yes"></fo:inline></xsl:text> -->
|
2163
|
+
<xsl:call-template name="replace_fo_inline_tags">
|
2164
|
+
<xsl:with-param name="tag_open" select="$tag_open"/>
|
2165
|
+
<xsl:with-param name="tag_close" select="$tag_close"/>
|
2138
2166
|
<xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
|
2139
2167
|
</xsl:call-template>
|
2140
2168
|
</xsl:when>
|
@@ -2142,6 +2170,8 @@
|
|
2142
2170
|
</xsl:choose>
|
2143
2171
|
</xsl:template><xsl:template match="*[local-name()='br']">
|
2144
2172
|
<xsl:value-of select="$linebreak"/>
|
2173
|
+
</xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']">
|
2174
|
+
<fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
|
2145
2175
|
</xsl:template><xsl:template match="*[local-name()='copyright-statement']">
|
2146
2176
|
<fo:block xsl:use-attribute-sets="copyright-statement-style">
|
2147
2177
|
<xsl:apply-templates/>
|
@@ -2250,8 +2280,23 @@
|
|
2250
2280
|
</xsl:call-template>
|
2251
2281
|
|
2252
2282
|
</xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
|
2253
|
-
|
2254
|
-
|
2283
|
+
<xsl:choose>
|
2284
|
+
<xsl:when test="parent::*[local-name() = 'keep-together_within-line']">
|
2285
|
+
<xsl:value-of select="."/>
|
2286
|
+
</xsl:when>
|
2287
|
+
<xsl:otherwise>
|
2288
|
+
<xsl:call-template name="addZeroWidthSpacesToTextNodes"/>
|
2289
|
+
</xsl:otherwise>
|
2290
|
+
</xsl:choose>
|
2291
|
+
</xsl:template><xsl:template name="addZeroWidthSpacesToTextNodes">
|
2292
|
+
<xsl:variable name="text"><text><xsl:call-template name="text"/></text></xsl:variable>
|
2293
|
+
<!-- <xsl:copy-of select="$text"/> -->
|
2294
|
+
<xsl:for-each select="xalan:nodeset($text)/text/node()">
|
2295
|
+
<xsl:choose>
|
2296
|
+
<xsl:when test="self::text()"><xsl:call-template name="add-zero-spaces-java"/></xsl:when>
|
2297
|
+
<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
|
2298
|
+
</xsl:choose>
|
2299
|
+
</xsl:for-each>
|
2255
2300
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
2256
2301
|
|
2257
2302
|
<xsl:variable name="table-preamble">
|
@@ -2372,16 +2417,9 @@
|
|
2372
2417
|
</xsl:for-each>
|
2373
2418
|
</xsl:when>
|
2374
2419
|
<xsl:otherwise>
|
2375
|
-
<xsl:
|
2376
|
-
<xsl:
|
2377
|
-
|
2378
|
-
<fo:table-column column-width="proportional-column-width(2)"/>
|
2379
|
-
</xsl:when>
|
2380
|
-
<xsl:otherwise>
|
2381
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
2382
|
-
</xsl:otherwise>
|
2383
|
-
</xsl:choose>
|
2384
|
-
</xsl:for-each>
|
2420
|
+
<xsl:call-template name="insertTableColumnWidth">
|
2421
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
2422
|
+
</xsl:call-template>
|
2385
2423
|
</xsl:otherwise>
|
2386
2424
|
</xsl:choose>
|
2387
2425
|
|
@@ -2544,6 +2582,7 @@
|
|
2544
2582
|
<xsl:with-param name="text" select="$td_text"/>
|
2545
2583
|
</xsl:call-template>
|
2546
2584
|
</xsl:variable>
|
2585
|
+
<!-- <xsl:message>string_with_added_zerospaces=<xsl:value-of select="$string_with_added_zerospaces"/></xsl:message> -->
|
2547
2586
|
<xsl:call-template name="tokenize">
|
2548
2587
|
<!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
|
2549
2588
|
<!-- 2009 thinspace -->
|
@@ -2556,6 +2595,7 @@
|
|
2556
2595
|
<xsl:with-param name="words" select="xalan:nodeset($words)"/>
|
2557
2596
|
</xsl:call-template>
|
2558
2597
|
</xsl:variable>
|
2598
|
+
<!-- <xsl:message>max_length=<xsl:value-of select="$max_length"/></xsl:message> -->
|
2559
2599
|
<width>
|
2560
2600
|
<xsl:variable name="divider">
|
2561
2601
|
<xsl:choose>
|
@@ -2588,6 +2628,10 @@
|
|
2588
2628
|
<xsl:with-param name="table" select="$table"/>
|
2589
2629
|
</xsl:call-template>
|
2590
2630
|
</xsl:if>
|
2631
|
+
</xsl:template><xsl:template match="*[@keep-together.within-line]/text()" priority="2" mode="td_text">
|
2632
|
+
<!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message>
|
2633
|
+
<xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> -->
|
2634
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/>
|
2591
2635
|
</xsl:template><xsl:template match="text()" mode="td_text">
|
2592
2636
|
<xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
|
2593
2637
|
</xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
|
@@ -2689,16 +2733,9 @@
|
|
2689
2733
|
</xsl:for-each>
|
2690
2734
|
</xsl:when>
|
2691
2735
|
<xsl:otherwise>
|
2692
|
-
<xsl:
|
2693
|
-
<xsl:
|
2694
|
-
|
2695
|
-
<fo:table-column column-width="proportional-column-width(2)"/>
|
2696
|
-
</xsl:when>
|
2697
|
-
<xsl:otherwise>
|
2698
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
2699
|
-
</xsl:otherwise>
|
2700
|
-
</xsl:choose>
|
2701
|
-
</xsl:for-each>
|
2736
|
+
<xsl:call-template name="insertTableColumnWidth">
|
2737
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
2738
|
+
</xsl:call-template>
|
2702
2739
|
</xsl:otherwise>
|
2703
2740
|
</xsl:choose>
|
2704
2741
|
|
@@ -3250,8 +3287,10 @@
|
|
3250
3287
|
<!-- and (not(../@class) or ../@class !='pseudocode') -->
|
3251
3288
|
</xsl:variable>
|
3252
3289
|
|
3290
|
+
<xsl:variable name="onlyOneComponent" select="normalize-space($parent = 'formula' and count(*[local-name()='dt']) = 1)"/>
|
3291
|
+
|
3253
3292
|
<xsl:choose>
|
3254
|
-
<xsl:when test="$
|
3293
|
+
<xsl:when test="$onlyOneComponent = 'true'"> <!-- only one component -->
|
3255
3294
|
|
3256
3295
|
<fo:block margin-bottom="12pt" text-align="left">
|
3257
3296
|
|
@@ -3266,7 +3305,7 @@
|
|
3266
3305
|
<xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
|
3267
3306
|
</fo:block>
|
3268
3307
|
|
3269
|
-
</xsl:when>
|
3308
|
+
</xsl:when> <!-- END: only one component -->
|
3270
3309
|
<xsl:when test="$parent = 'formula'"> <!-- a few components -->
|
3271
3310
|
<fo:block margin-bottom="12pt" text-align="left">
|
3272
3311
|
|
@@ -3280,8 +3319,8 @@
|
|
3280
3319
|
</xsl:variable>
|
3281
3320
|
<xsl:value-of select="$title-where"/>
|
3282
3321
|
</fo:block>
|
3283
|
-
</xsl:when>
|
3284
|
-
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
|
3322
|
+
</xsl:when> <!-- END: a few components -->
|
3323
|
+
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
|
3285
3324
|
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
|
3286
3325
|
|
3287
3326
|
|
@@ -3294,11 +3333,11 @@
|
|
3294
3333
|
</xsl:variable>
|
3295
3334
|
<xsl:value-of select="$title-key"/>
|
3296
3335
|
</fo:block>
|
3297
|
-
</xsl:when>
|
3336
|
+
</xsl:when> <!-- END: definition list in a figure -->
|
3298
3337
|
</xsl:choose>
|
3299
3338
|
|
3300
3339
|
<!-- a few components -->
|
3301
|
-
<xsl:if test="
|
3340
|
+
<xsl:if test="$onlyOneComponent = 'false'">
|
3302
3341
|
<fo:block>
|
3303
3342
|
|
3304
3343
|
|
@@ -3337,21 +3376,28 @@
|
|
3337
3376
|
<xsl:apply-templates mode="dl"/>
|
3338
3377
|
</tbody>
|
3339
3378
|
</xsl:variable>
|
3340
|
-
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
3379
|
+
<!-- DEBUG: html-table<xsl:copy-of select="$html-table"/> -->
|
3341
3380
|
<xsl:variable name="colwidths">
|
3342
3381
|
<xsl:call-template name="calculate-column-widths">
|
3343
3382
|
<xsl:with-param name="cols-count" select="2"/>
|
3344
3383
|
<xsl:with-param name="table" select="$html-table"/>
|
3345
3384
|
</xsl:call-template>
|
3346
3385
|
</xsl:variable>
|
3347
|
-
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
3386
|
+
<!-- DEBUG: colwidths=<xsl:copy-of select="$colwidths"/> -->
|
3348
3387
|
<xsl:variable name="maxlength_dt">
|
3349
3388
|
<xsl:call-template name="getMaxLength_dt"/>
|
3350
3389
|
</xsl:variable>
|
3390
|
+
<xsl:variable name="isContainsKeepTogetherTag_">
|
3391
|
+
false
|
3392
|
+
</xsl:variable>
|
3393
|
+
<xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
|
3394
|
+
<!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
|
3351
3395
|
<xsl:call-template name="setColumnWidth_dl">
|
3352
3396
|
<xsl:with-param name="colwidths" select="$colwidths"/>
|
3353
3397
|
<xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
|
3398
|
+
<xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
|
3354
3399
|
</xsl:call-template>
|
3400
|
+
|
3355
3401
|
<fo:table-body>
|
3356
3402
|
<xsl:apply-templates>
|
3357
3403
|
<xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
|
@@ -3360,12 +3406,13 @@
|
|
3360
3406
|
</fo:table>
|
3361
3407
|
</fo:block>
|
3362
3408
|
</fo:block>
|
3363
|
-
</xsl:if>
|
3409
|
+
</xsl:if> <!-- END: a few components -->
|
3364
3410
|
</fo:block-container>
|
3365
3411
|
</fo:block-container>
|
3366
3412
|
</xsl:template><xsl:template name="setColumnWidth_dl">
|
3367
3413
|
<xsl:param name="colwidths"/>
|
3368
3414
|
<xsl:param name="maxlength_dt"/>
|
3415
|
+
<xsl:param name="isContainsKeepTogetherTag"/>
|
3369
3416
|
<xsl:choose>
|
3370
3417
|
<xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
|
3371
3418
|
<fo:table-column column-width="50%"/>
|
@@ -3373,6 +3420,11 @@
|
|
3373
3420
|
</xsl:when>
|
3374
3421
|
<xsl:otherwise>
|
3375
3422
|
<xsl:choose>
|
3423
|
+
<xsl:when test="$isContainsKeepTogetherTag">
|
3424
|
+
<xsl:call-template name="insertTableColumnWidth">
|
3425
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
3426
|
+
</xsl:call-template>
|
3427
|
+
</xsl:when>
|
3376
3428
|
<!-- to set width check most wide chars like `W` -->
|
3377
3429
|
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 2"> <!-- if dt contains short text like t90, a, etc -->
|
3378
3430
|
<fo:table-column column-width="7%"/>
|
@@ -3403,20 +3455,25 @@
|
|
3403
3455
|
<fo:table-column column-width="60%"/>
|
3404
3456
|
</xsl:when>
|
3405
3457
|
<xsl:otherwise>
|
3406
|
-
<xsl:
|
3407
|
-
<xsl:
|
3408
|
-
|
3409
|
-
<fo:table-column column-width="proportional-column-width(2)"/>
|
3410
|
-
</xsl:when>
|
3411
|
-
<xsl:otherwise>
|
3412
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
3413
|
-
</xsl:otherwise>
|
3414
|
-
</xsl:choose>
|
3415
|
-
</xsl:for-each>
|
3458
|
+
<xsl:call-template name="insertTableColumnWidth">
|
3459
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
3460
|
+
</xsl:call-template>
|
3416
3461
|
</xsl:otherwise>
|
3417
3462
|
</xsl:choose>
|
3418
3463
|
</xsl:otherwise>
|
3419
3464
|
</xsl:choose>
|
3465
|
+
</xsl:template><xsl:template name="insertTableColumnWidth">
|
3466
|
+
<xsl:param name="colwidths"/>
|
3467
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
3468
|
+
<xsl:choose>
|
3469
|
+
<xsl:when test=". = 1 or . = 0">
|
3470
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
3471
|
+
</xsl:when>
|
3472
|
+
<xsl:otherwise>
|
3473
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
3474
|
+
</xsl:otherwise>
|
3475
|
+
</xsl:choose>
|
3476
|
+
</xsl:for-each>
|
3420
3477
|
</xsl:template><xsl:template name="getMaxLength_dt">
|
3421
3478
|
<xsl:variable name="lengths">
|
3422
3479
|
<xsl:for-each select="*[local-name()='dt']">
|
@@ -3440,7 +3497,6 @@
|
|
3440
3497
|
<xsl:value-of select="$maxLength"/>
|
3441
3498
|
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
|
3442
3499
|
<xsl:param name="key_iso"/>
|
3443
|
-
|
3444
3500
|
<!-- <tr>
|
3445
3501
|
<td>NOTE</td>
|
3446
3502
|
<td>
|
@@ -3448,18 +3504,30 @@
|
|
3448
3504
|
</td>
|
3449
3505
|
</tr>
|
3450
3506
|
-->
|
3451
|
-
|
3507
|
+
<!-- OLD Variant -->
|
3508
|
+
<!-- <fo:table-row>
|
3452
3509
|
<fo:table-cell>
|
3453
3510
|
<fo:block margin-top="6pt">
|
3454
3511
|
<xsl:if test="normalize-space($key_iso) = 'true'">
|
3455
3512
|
<xsl:attribute name="margin-top">0</xsl:attribute>
|
3456
3513
|
</xsl:if>
|
3457
|
-
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
3514
|
+
<xsl:apply-templates select="*[local-name() = 'name']" />
|
3458
3515
|
</fo:block>
|
3459
3516
|
</fo:table-cell>
|
3460
3517
|
<fo:table-cell>
|
3461
3518
|
<fo:block>
|
3462
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
3519
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]" />
|
3520
|
+
</fo:block>
|
3521
|
+
</fo:table-cell>
|
3522
|
+
</fo:table-row> -->
|
3523
|
+
<!-- <tr>
|
3524
|
+
<td number-columns-spanned="2">NOTE <xsl:apply-templates /> </td>
|
3525
|
+
</tr>
|
3526
|
+
-->
|
3527
|
+
<fo:table-row>
|
3528
|
+
<fo:table-cell number-columns-spanned="2">
|
3529
|
+
<fo:block>
|
3530
|
+
<xsl:call-template name="note"/>
|
3463
3531
|
</fo:block>
|
3464
3532
|
</fo:table-cell>
|
3465
3533
|
</fo:table-row>
|
@@ -3561,13 +3629,15 @@
|
|
3561
3629
|
<xsl:choose>
|
3562
3630
|
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
3563
3631
|
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
3564
|
-
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
3632
|
+
<xsl:when test="ancestor::*[local-name()='note'] or ancestor::*[local-name()='example']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
3565
3633
|
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
3566
3634
|
</xsl:choose>
|
3567
3635
|
</xsl:attribute>
|
3568
3636
|
</xsl:if>
|
3569
3637
|
<xsl:apply-templates/>
|
3570
3638
|
</fo:inline>
|
3639
|
+
</xsl:template><xsl:template match="*[local-name()='tt']/text()" priority="2">
|
3640
|
+
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
3571
3641
|
</xsl:template><xsl:template match="*[local-name()='underline']">
|
3572
3642
|
<fo:inline text-decoration="underline">
|
3573
3643
|
<xsl:apply-templates/>
|
@@ -3715,41 +3785,50 @@
|
|
3715
3785
|
<fo:block break-after="page"/>
|
3716
3786
|
<fo:block> </fo:block>
|
3717
3787
|
<fo:block break-after="page"/>
|
3788
|
+
</xsl:template><xsl:template match="*[local-name() = 'span']">
|
3789
|
+
<xsl:apply-templates/>
|
3718
3790
|
</xsl:template><xsl:template name="tokenize">
|
3719
3791
|
<xsl:param name="text"/>
|
3720
3792
|
<xsl:param name="separator" select="' '"/>
|
3721
3793
|
<xsl:choose>
|
3722
3794
|
<xsl:when test="not(contains($text, $separator))">
|
3723
3795
|
<word>
|
3724
|
-
<xsl:variable name="str_no_en_chars" select="normalize-space(translate($text, $en_chars, ''))"/>
|
3725
|
-
<xsl:variable name="len_str_no_en_chars" select="string-length($str_no_en_chars)"/>
|
3726
3796
|
<xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
|
3727
|
-
<xsl:variable name="len_str">
|
3728
|
-
<xsl:choose>
|
3729
|
-
<xsl:when test="normalize-space(translate($text, $upper, '')) = ''"> <!-- english word in CAPITAL letters -->
|
3730
|
-
<xsl:value-of select="$len_str_tmp * 1.5"/>
|
3731
|
-
</xsl:when>
|
3732
|
-
<xsl:otherwise>
|
3733
|
-
<xsl:value-of select="$len_str_tmp"/>
|
3734
|
-
</xsl:otherwise>
|
3735
|
-
</xsl:choose>
|
3736
|
-
</xsl:variable>
|
3737
|
-
|
3738
|
-
<!-- <xsl:if test="$len_str_no_en_chars div $len_str > 0.8">
|
3739
|
-
<xsl:message>
|
3740
|
-
div=<xsl:value-of select="$len_str_no_en_chars div $len_str"/>
|
3741
|
-
len_str=<xsl:value-of select="$len_str"/>
|
3742
|
-
len_str_no_en_chars=<xsl:value-of select="$len_str_no_en_chars"/>
|
3743
|
-
</xsl:message>
|
3744
|
-
</xsl:if> -->
|
3745
|
-
<!-- <len_str_no_en_chars><xsl:value-of select="$len_str_no_en_chars"/></len_str_no_en_chars>
|
3746
|
-
<len_str><xsl:value-of select="$len_str"/></len_str> -->
|
3747
3797
|
<xsl:choose>
|
3748
|
-
<xsl:when test="$
|
3749
|
-
<xsl:value-of select="$
|
3798
|
+
<xsl:when test="normalize-space(translate($text, 'X', '')) = ''"> <!-- special case for keep-together.within-line -->
|
3799
|
+
<xsl:value-of select="$len_str_tmp"/>
|
3750
3800
|
</xsl:when>
|
3751
3801
|
<xsl:otherwise>
|
3752
|
-
<xsl:
|
3802
|
+
<xsl:variable name="str_no_en_chars" select="normalize-space(translate($text, $en_chars, ''))"/>
|
3803
|
+
<xsl:variable name="len_str_no_en_chars" select="string-length($str_no_en_chars)"/>
|
3804
|
+
<xsl:variable name="len_str">
|
3805
|
+
<xsl:choose>
|
3806
|
+
<xsl:when test="normalize-space(translate($text, $upper, '')) = ''"> <!-- english word in CAPITAL letters -->
|
3807
|
+
<xsl:value-of select="$len_str_tmp * 1.5"/>
|
3808
|
+
</xsl:when>
|
3809
|
+
<xsl:otherwise>
|
3810
|
+
<xsl:value-of select="$len_str_tmp"/>
|
3811
|
+
</xsl:otherwise>
|
3812
|
+
</xsl:choose>
|
3813
|
+
</xsl:variable>
|
3814
|
+
|
3815
|
+
<!-- <xsl:if test="$len_str_no_en_chars div $len_str > 0.8">
|
3816
|
+
<xsl:message>
|
3817
|
+
div=<xsl:value-of select="$len_str_no_en_chars div $len_str"/>
|
3818
|
+
len_str=<xsl:value-of select="$len_str"/>
|
3819
|
+
len_str_no_en_chars=<xsl:value-of select="$len_str_no_en_chars"/>
|
3820
|
+
</xsl:message>
|
3821
|
+
</xsl:if> -->
|
3822
|
+
<!-- <len_str_no_en_chars><xsl:value-of select="$len_str_no_en_chars"/></len_str_no_en_chars>
|
3823
|
+
<len_str><xsl:value-of select="$len_str"/></len_str> -->
|
3824
|
+
<xsl:choose>
|
3825
|
+
<xsl:when test="$len_str_no_en_chars div $len_str > 0.8"> <!-- means non-english string -->
|
3826
|
+
<xsl:value-of select="$len_str - $len_str_no_en_chars"/>
|
3827
|
+
</xsl:when>
|
3828
|
+
<xsl:otherwise>
|
3829
|
+
<xsl:value-of select="$len_str"/>
|
3830
|
+
</xsl:otherwise>
|
3831
|
+
</xsl:choose>
|
3753
3832
|
</xsl:otherwise>
|
3754
3833
|
</xsl:choose>
|
3755
3834
|
</word>
|
@@ -3835,24 +3914,28 @@
|
|
3835
3914
|
</xsl:template><xsl:template name="add-zero-spaces-equal">
|
3836
3915
|
<xsl:param name="text" select="."/>
|
3837
3916
|
<xsl:variable name="zero-space-after-equals">==========</xsl:variable>
|
3917
|
+
<xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
|
3838
3918
|
<xsl:variable name="zero-space-after-equal">=</xsl:variable>
|
3919
|
+
<xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
|
3839
3920
|
<xsl:variable name="zero-space"></xsl:variable>
|
3840
3921
|
<xsl:choose>
|
3841
3922
|
<xsl:when test="contains($text, $zero-space-after-equals)">
|
3842
|
-
<xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
|
3923
|
+
<!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
|
3843
3924
|
<xsl:value-of select="$zero-space-after-equals"/>
|
3844
3925
|
<xsl:value-of select="$zero-space"/>
|
3845
3926
|
<xsl:call-template name="add-zero-spaces-equal">
|
3846
3927
|
<xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
|
3847
|
-
</xsl:call-template>
|
3928
|
+
</xsl:call-template> -->
|
3929
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
|
3848
3930
|
</xsl:when>
|
3849
3931
|
<xsl:when test="contains($text, $zero-space-after-equal)">
|
3850
|
-
<xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
|
3932
|
+
<!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
|
3851
3933
|
<xsl:value-of select="$zero-space-after-equal"/>
|
3852
3934
|
<xsl:value-of select="$zero-space"/>
|
3853
3935
|
<xsl:call-template name="add-zero-spaces-equal">
|
3854
3936
|
<xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
|
3855
|
-
</xsl:call-template>
|
3937
|
+
</xsl:call-template> -->
|
3938
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
|
3856
3939
|
</xsl:when>
|
3857
3940
|
<xsl:otherwise>
|
3858
3941
|
<xsl:value-of select="$text"/>
|
@@ -4020,6 +4103,9 @@
|
|
4020
4103
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
4021
4104
|
|
4022
4105
|
<fo:inline xsl:use-attribute-sets="mathml-style">
|
4106
|
+
|
4107
|
+
|
4108
|
+
|
4023
4109
|
|
4024
4110
|
|
4025
4111
|
<xsl:call-template name="setTrackChangesStyles">
|
@@ -4027,48 +4113,80 @@
|
|
4027
4113
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
4028
4114
|
</xsl:call-template>
|
4029
4115
|
|
4116
|
+
<xsl:if test="$add_math_as_text = 'true'">
|
4117
|
+
<!-- insert helper tag -->
|
4118
|
+
<!-- set unique font-size (fiction) -->
|
4119
|
+
<xsl:variable name="font-size_sfx"><xsl:number level="any"/></xsl:variable>
|
4120
|
+
<fo:inline color="white" font-size="1.{$font-size_sfx}pt" font-style="normal" font-weight="normal"><xsl:value-of select="$zero_width_space"/></fo:inline> <!-- zero width space -->
|
4121
|
+
</xsl:if>
|
4030
4122
|
|
4031
|
-
|
4032
|
-
|
4033
|
-
<xsl:apply-templates select="." mode="mathml"/>
|
4123
|
+
<xsl:variable name="mathml_content">
|
4124
|
+
<xsl:apply-templates select="." mode="mathml_actual_text"/>
|
4034
4125
|
</xsl:variable>
|
4035
|
-
<fo:instream-foreign-object fox:alt-text="Math">
|
4036
4126
|
|
4127
|
+
|
4128
|
+
<xsl:call-template name="mathml_instream_object">
|
4129
|
+
<xsl:with-param name="mathml_content" select="$mathml_content"/>
|
4130
|
+
</xsl:call-template>
|
4037
4131
|
|
4038
|
-
|
4039
|
-
<xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
|
4040
|
-
<xsl:variable name="comment_text_">
|
4041
|
-
<xsl:choose>
|
4042
|
-
<xsl:when test="normalize-space($comment_text_following) != ''">
|
4043
|
-
<xsl:value-of select="$comment_text_following"/>
|
4044
|
-
</xsl:when>
|
4045
|
-
<xsl:otherwise>
|
4046
|
-
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
4047
|
-
</xsl:otherwise>
|
4048
|
-
</xsl:choose>
|
4049
|
-
</xsl:variable>
|
4050
|
-
<xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
|
4051
|
-
|
4052
|
-
<xsl:if test="normalize-space($comment_text) != ''">
|
4053
|
-
<!-- put Mathin Alternate Text -->
|
4054
|
-
<xsl:attribute name="fox:alt-text">
|
4055
|
-
<xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
|
4056
|
-
</xsl:attribute>
|
4057
|
-
</xsl:if>
|
4058
|
-
|
4059
|
-
<xsl:variable name="mathml_content">
|
4060
|
-
<xsl:apply-templates select="." mode="mathml_actual_text"/>
|
4061
|
-
</xsl:variable>
|
4062
|
-
<!-- put MathML in Actual Text -->
|
4063
|
-
<xsl:attribute name="fox:actual-text">
|
4064
|
-
<xsl:value-of select="$mathml_content"/>
|
4065
|
-
</xsl:attribute>
|
4066
|
-
|
4067
|
-
|
4068
|
-
|
4069
|
-
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
4070
|
-
</fo:instream-foreign-object>
|
4132
|
+
|
4071
4133
|
</fo:inline>
|
4134
|
+
</xsl:template><xsl:template name="getMathml_comment_text">
|
4135
|
+
<xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
|
4136
|
+
<xsl:variable name="comment_text_">
|
4137
|
+
<xsl:choose>
|
4138
|
+
<xsl:when test="normalize-space($comment_text_following) != ''">
|
4139
|
+
<xsl:value-of select="$comment_text_following"/>
|
4140
|
+
</xsl:when>
|
4141
|
+
<xsl:otherwise>
|
4142
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
4143
|
+
</xsl:otherwise>
|
4144
|
+
</xsl:choose>
|
4145
|
+
</xsl:variable>
|
4146
|
+
<xsl:variable name="comment_text_2" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
|
4147
|
+
<xsl:variable name="comment_text" select="java:trim(java:java.lang.String.new($comment_text_2))"/>
|
4148
|
+
<xsl:value-of select="$comment_text"/>
|
4149
|
+
</xsl:template><xsl:template name="mathml_instream_object">
|
4150
|
+
<xsl:param name="comment_text"/>
|
4151
|
+
<xsl:param name="mathml_content"/>
|
4152
|
+
|
4153
|
+
<xsl:variable name="comment_text_">
|
4154
|
+
<xsl:choose>
|
4155
|
+
<xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
|
4156
|
+
<xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
|
4157
|
+
</xsl:choose>
|
4158
|
+
</xsl:variable>
|
4159
|
+
|
4160
|
+
<xsl:variable name="mathml">
|
4161
|
+
<xsl:apply-templates select="." mode="mathml"/>
|
4162
|
+
</xsl:variable>
|
4163
|
+
|
4164
|
+
<fo:instream-foreign-object fox:alt-text="Math">
|
4165
|
+
|
4166
|
+
|
4167
|
+
|
4168
|
+
|
4169
|
+
|
4170
|
+
|
4171
|
+
|
4172
|
+
<!-- put MathML in Actual Text -->
|
4173
|
+
<!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
|
4174
|
+
<xsl:attribute name="fox:actual-text">
|
4175
|
+
<xsl:value-of select="$mathml_content"/>
|
4176
|
+
</xsl:attribute>
|
4177
|
+
|
4178
|
+
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
4179
|
+
<xsl:if test="normalize-space($comment_text_) != ''">
|
4180
|
+
<!-- put Mathin Alternate Text -->
|
4181
|
+
<xsl:attribute name="fox:alt-text">
|
4182
|
+
<xsl:value-of select="$comment_text_"/>
|
4183
|
+
</xsl:attribute>
|
4184
|
+
</xsl:if>
|
4185
|
+
<!-- </xsl:if> -->
|
4186
|
+
|
4187
|
+
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
4188
|
+
|
4189
|
+
</fo:instream-foreign-object>
|
4072
4190
|
</xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
|
4073
4191
|
<!-- <xsl:text>a+b</xsl:text> -->
|
4074
4192
|
<xsl:text><</xsl:text>
|
@@ -4099,7 +4217,9 @@
|
|
4099
4217
|
<!-- replace start and end spaces to non-break space -->
|
4100
4218
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
4101
4219
|
</xsl:copy>
|
4102
|
-
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="
|
4220
|
+
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="mathml:mtd/mathml:mo/text()[. = '/']" mode="mathml">
|
4221
|
+
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
4222
|
+
</xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
4103
4223
|
<xsl:variable name="target">
|
4104
4224
|
<xsl:choose>
|
4105
4225
|
<xsl:when test="@updatetype = 'true'">
|
@@ -4332,7 +4452,12 @@
|
|
4332
4452
|
|
4333
4453
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
4334
4454
|
|
4455
|
+
<xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
|
4456
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
4457
|
+
</xsl:if>
|
4458
|
+
|
4335
4459
|
|
4460
|
+
|
4336
4461
|
|
4337
4462
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
4338
4463
|
<!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
|
@@ -4691,18 +4816,33 @@
|
|
4691
4816
|
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
4692
4817
|
<xsl:copy>
|
4693
4818
|
<xsl:apply-templates select="@*" mode="svg_update"/>
|
4694
|
-
<xsl:variable name="
|
4819
|
+
<xsl:variable name="viewbox_">
|
4695
4820
|
<xsl:call-template name="split">
|
4696
4821
|
<xsl:with-param name="pText" select="@viewBox"/>
|
4697
4822
|
<xsl:with-param name="sep" select="' '"/>
|
4698
4823
|
</xsl:call-template>
|
4699
4824
|
</xsl:variable>
|
4825
|
+
<xsl:variable name="viewbox" select="xalan:nodeset($viewbox_)"/>
|
4826
|
+
<xsl:variable name="width" select="normalize-space($viewbox//item[3])"/>
|
4827
|
+
<xsl:variable name="height" select="normalize-space($viewbox//item[4])"/>
|
4828
|
+
|
4700
4829
|
<xsl:attribute name="width">
|
4701
|
-
<xsl:
|
4830
|
+
<xsl:choose>
|
4831
|
+
<xsl:when test="$width != ''">
|
4832
|
+
<xsl:value-of select="round($width)"/>
|
4833
|
+
</xsl:when>
|
4834
|
+
<xsl:otherwise>400</xsl:otherwise> <!-- default width -->
|
4835
|
+
</xsl:choose>
|
4702
4836
|
</xsl:attribute>
|
4703
4837
|
<xsl:attribute name="height">
|
4704
|
-
<xsl:
|
4838
|
+
<xsl:choose>
|
4839
|
+
<xsl:when test="$height != ''">
|
4840
|
+
<xsl:value-of select="round($height)"/>
|
4841
|
+
</xsl:when>
|
4842
|
+
<xsl:otherwise>400</xsl:otherwise> <!-- default height -->
|
4843
|
+
</xsl:choose>
|
4705
4844
|
</xsl:attribute>
|
4845
|
+
|
4706
4846
|
<xsl:apply-templates mode="svg_update"/>
|
4707
4847
|
</xsl:copy>
|
4708
4848
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
|
@@ -4897,7 +5037,11 @@
|
|
4897
5037
|
<xsl:apply-templates mode="bookmarks"/>
|
4898
5038
|
</xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
4899
5039
|
<xsl:apply-templates select="."/>
|
4900
|
-
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/><xsl:template match="*[local-name() = '
|
5040
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/><xsl:template match="*[local-name() = 'span']" mode="contents">
|
5041
|
+
<xsl:apply-templates mode="contents"/>
|
5042
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
5043
|
+
<xsl:apply-templates mode="bookmarks"/>
|
5044
|
+
</xsl:template><xsl:template match="*[local-name() = 'span']" mode="bookmarks">
|
4901
5045
|
<xsl:apply-templates mode="bookmarks"/>
|
4902
5046
|
</xsl:template><xsl:template name="addBookmarks">
|
4903
5047
|
<xsl:param name="contents"/>
|
@@ -5168,7 +5312,9 @@
|
|
5168
5312
|
<xsl:apply-templates/>
|
5169
5313
|
</xsl:otherwise>
|
5170
5314
|
</xsl:choose>
|
5171
|
-
</xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = '
|
5315
|
+
</xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'xref']" mode="contents">
|
5316
|
+
<xsl:value-of select="."/>
|
5317
|
+
</xsl:template><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
|
5172
5318
|
<xsl:text> </xsl:text>
|
5173
5319
|
</xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
5174
5320
|
<xsl:copy>
|
@@ -5199,9 +5345,22 @@
|
|
5199
5345
|
</xsl:when>
|
5200
5346
|
<xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise>
|
5201
5347
|
</xsl:choose>
|
5348
|
+
</xsl:template><xsl:template match="text()" mode="contents_item">
|
5349
|
+
<xsl:call-template name="keep_together_standard_number"/>
|
5350
|
+
</xsl:template><xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
5351
|
+
<xsl:apply-templates mode="contents_item"/>
|
5202
5352
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
5203
5353
|
|
5204
5354
|
<fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
|
5355
|
+
|
5356
|
+
<xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
|
5357
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
5358
|
+
</xsl:if>
|
5359
|
+
|
5360
|
+
<xsl:if test="ancestor::*[local-name() = 'example']">
|
5361
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
5362
|
+
</xsl:if>
|
5363
|
+
|
5205
5364
|
<xsl:copy-of select="@id"/>
|
5206
5365
|
|
5207
5366
|
<xsl:if test="parent::*[local-name() = 'note']">
|
@@ -5301,17 +5460,15 @@
|
|
5301
5460
|
|
5302
5461
|
<!-- split text by zero-width space -->
|
5303
5462
|
<xsl:variable name="text_step4">
|
5304
|
-
<xsl:call-template name="
|
5463
|
+
<xsl:call-template name="split_for_interspers">
|
5305
5464
|
<xsl:with-param name="pText" select="$text_step3"/>
|
5306
5465
|
<xsl:with-param name="sep" select="$zero_width_space"/>
|
5307
|
-
<xsl:with-param name="normalize-space">false</xsl:with-param>
|
5308
|
-
<xsl:with-param name="keep_sep">true</xsl:with-param>
|
5309
5466
|
</xsl:call-template>
|
5310
5467
|
</xsl:variable>
|
5311
5468
|
|
5312
|
-
<xsl:for-each select="xalan:nodeset($text_step4)/
|
5469
|
+
<xsl:for-each select="xalan:nodeset($text_step4)/node()">
|
5313
5470
|
<xsl:choose>
|
5314
|
-
<xsl:when test="
|
5471
|
+
<xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
|
5315
5472
|
<xsl:call-template name="interspers">
|
5316
5473
|
<xsl:with-param name="str" select="."/>
|
5317
5474
|
</xsl:call-template>
|
@@ -5322,6 +5479,30 @@
|
|
5322
5479
|
</xsl:choose>
|
5323
5480
|
</xsl:for-each>
|
5324
5481
|
|
5482
|
+
</xsl:template><xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable><xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable><xsl:template name="split_for_interspers">
|
5483
|
+
<xsl:param name="pText" select="."/>
|
5484
|
+
<xsl:param name="sep" select="','"/>
|
5485
|
+
<!-- word with length more than 30 will be interspersed with zero-width space -->
|
5486
|
+
<xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
|
5487
|
+
<xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
|
5488
|
+
<xsl:call-template name="replace_tag_interspers">
|
5489
|
+
<xsl:with-param name="text" select="$text"/>
|
5490
|
+
</xsl:call-template>
|
5491
|
+
</xsl:template><xsl:template name="replace_tag_interspers">
|
5492
|
+
<xsl:param name="text"/>
|
5493
|
+
<xsl:choose>
|
5494
|
+
<xsl:when test="contains($text, $interspers_tag_open)">
|
5495
|
+
<xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
|
5496
|
+
<xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
|
5497
|
+
<interspers>
|
5498
|
+
<xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
|
5499
|
+
</interspers>
|
5500
|
+
<xsl:call-template name="replace_tag_interspers">
|
5501
|
+
<xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
|
5502
|
+
</xsl:call-template>
|
5503
|
+
</xsl:when>
|
5504
|
+
<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
|
5505
|
+
</xsl:choose>
|
5325
5506
|
</xsl:template><xsl:template name="interspers">
|
5326
5507
|
<xsl:param name="str"/>
|
5327
5508
|
<xsl:param name="char" select="$zero_width_space"/>
|
@@ -5667,39 +5848,67 @@
|
|
5667
5848
|
</xsl:otherwise>
|
5668
5849
|
</xsl:choose>
|
5669
5850
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
5670
|
-
|
5671
|
-
|
5851
|
+
|
5852
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
|
5853
|
+
|
5672
5854
|
|
5855
|
+
|
5673
5856
|
<xsl:variable name="fo_element">
|
5674
|
-
<xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
|
5857
|
+
<xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
|
5675
5858
|
block
|
5676
5859
|
</xsl:variable>
|
5677
5860
|
|
5678
|
-
|
5679
|
-
<xsl:apply-templates select="*[local-name()='name']">
|
5680
|
-
<xsl:with-param name="fo_element" select="$fo_element"/>
|
5681
|
-
</xsl:apply-templates>
|
5861
|
+
<fo:block-container margin-left="0mm">
|
5682
5862
|
|
5683
|
-
|
5684
|
-
|
5685
|
-
<
|
5686
|
-
|
5687
|
-
|
5863
|
+
<xsl:choose>
|
5864
|
+
|
5865
|
+
<xsl:when test="contains(normalize-space($fo_element), 'block')">
|
5866
|
+
|
5867
|
+
<!-- display name 'EXAMPLE' in a separate block -->
|
5868
|
+
<fo:block>
|
5869
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
5688
5870
|
<xsl:with-param name="fo_element" select="$fo_element"/>
|
5689
5871
|
</xsl:apply-templates>
|
5872
|
+
</fo:block>
|
5873
|
+
|
5874
|
+
<fo:block-container xsl:use-attribute-sets="example-body-style">
|
5875
|
+
<fo:block-container margin-left="0mm" margin-right="0mm">
|
5876
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
5877
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
5878
|
+
</xsl:apply-templates>
|
5879
|
+
</fo:block-container>
|
5690
5880
|
</fo:block-container>
|
5691
|
-
</
|
5692
|
-
|
5693
|
-
|
5694
|
-
|
5695
|
-
|
5696
|
-
|
5697
|
-
|
5698
|
-
|
5699
|
-
|
5700
|
-
|
5701
|
-
|
5702
|
-
|
5881
|
+
</xsl:when> <!-- end block -->
|
5882
|
+
|
5883
|
+
<xsl:otherwise> <!-- inline -->
|
5884
|
+
|
5885
|
+
<!-- display 'EXAMPLE' and first element in the same line -->
|
5886
|
+
<fo:block>
|
5887
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
5888
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
5889
|
+
</xsl:apply-templates>
|
5890
|
+
<fo:inline>
|
5891
|
+
<xsl:apply-templates select="*[not(local-name() = 'name')][1]">
|
5892
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
5893
|
+
</xsl:apply-templates>
|
5894
|
+
</fo:inline>
|
5895
|
+
</fo:block>
|
5896
|
+
|
5897
|
+
<xsl:if test="*[not(local-name() = 'name')][position() > 1]">
|
5898
|
+
<!-- display further elements in blocks -->
|
5899
|
+
<fo:block-container xsl:use-attribute-sets="example-body-style">
|
5900
|
+
<fo:block-container margin-left="0mm" margin-right="0mm">
|
5901
|
+
<xsl:apply-templates select="*[not(local-name() = 'name')][position() > 1]">
|
5902
|
+
<xsl:with-param name="fo_element" select="'block'"/>
|
5903
|
+
</xsl:apply-templates>
|
5904
|
+
</fo:block-container>
|
5905
|
+
</fo:block-container>
|
5906
|
+
</xsl:if>
|
5907
|
+
</xsl:otherwise> <!-- end inline -->
|
5908
|
+
|
5909
|
+
</xsl:choose>
|
5910
|
+
</fo:block-container>
|
5911
|
+
</fo:block-container>
|
5703
5912
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
|
5704
5913
|
<xsl:param name="fo_element">block</xsl:param>
|
5705
5914
|
|
@@ -5731,10 +5940,16 @@
|
|
5731
5940
|
</xsl:variable>
|
5732
5941
|
<xsl:choose>
|
5733
5942
|
<xsl:when test="starts-with(normalize-space($element), 'block')">
|
5734
|
-
<fo:block
|
5735
|
-
|
5736
|
-
|
5737
|
-
|
5943
|
+
<fo:block-container>
|
5944
|
+
<xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
|
5945
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
5946
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
5947
|
+
</xsl:if>
|
5948
|
+
<fo:block xsl:use-attribute-sets="example-p-style">
|
5949
|
+
|
5950
|
+
<xsl:apply-templates/>
|
5951
|
+
</fo:block>
|
5952
|
+
</fo:block-container>
|
5738
5953
|
</xsl:when>
|
5739
5954
|
<xsl:otherwise>
|
5740
5955
|
<fo:inline xsl:use-attribute-sets="example-p-style">
|
@@ -5779,7 +5994,7 @@
|
|
5779
5994
|
</xsl:otherwise>
|
5780
5995
|
</xsl:choose> -->
|
5781
5996
|
</fo:block>
|
5782
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
|
5997
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
|
5783
5998
|
<xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
|
5784
5999
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
5785
6000
|
<xsl:if test="normalize-space() != ''">
|
@@ -5916,7 +6131,16 @@
|
|
5916
6131
|
</fo:inline>
|
5917
6132
|
</xsl:when>
|
5918
6133
|
<xsl:otherwise> <!-- if there is key('bibitems_hidden', $current_bibitemid) -->
|
5919
|
-
|
6134
|
+
|
6135
|
+
<!-- if in bibitem[@hidden='true'] there is url[@type='src'], then create hyperlink -->
|
6136
|
+
<xsl:variable name="uri_src" select="normalize-space($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'src'])"/>
|
6137
|
+
<xsl:choose>
|
6138
|
+
<xsl:when test="$uri_src != ''">
|
6139
|
+
<fo:basic-link external-destination="{$uri_src}" fox:alt-text="{$uri_src}"><xsl:apply-templates/></fo:basic-link>
|
6140
|
+
</xsl:when>
|
6141
|
+
<xsl:otherwise><fo:inline><xsl:apply-templates/></fo:inline></xsl:otherwise>
|
6142
|
+
</xsl:choose>
|
6143
|
+
|
5920
6144
|
</xsl:otherwise>
|
5921
6145
|
</xsl:choose>
|
5922
6146
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
@@ -6101,10 +6325,24 @@
|
|
6101
6325
|
|
6102
6326
|
</fo:block>
|
6103
6327
|
<xsl:apply-templates/>
|
6104
|
-
</xsl:template><xsl:template match="*[local-name() = 'review']">
|
6328
|
+
</xsl:template><xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
|
6105
6329
|
<!-- comment 2019-11-29 -->
|
6106
6330
|
<!-- <fo:block font-weight="bold">Review:</fo:block>
|
6107
6331
|
<xsl:apply-templates /> -->
|
6332
|
+
|
6333
|
+
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
|
6334
|
+
|
6335
|
+
<xsl:choose>
|
6336
|
+
<!-- if there isn't the attribute '@from', then -->
|
6337
|
+
<xsl:when test="$id_from = ''">
|
6338
|
+
<fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
6339
|
+
</xsl:when>
|
6340
|
+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
6341
|
+
<xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
6342
|
+
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
6343
|
+
</xsl:when>
|
6344
|
+
</xsl:choose>
|
6345
|
+
|
6108
6346
|
</xsl:template><xsl:template match="*[local-name() = 'name']/text()">
|
6109
6347
|
<!-- 0xA0 to space replacement -->
|
6110
6348
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
@@ -6461,7 +6699,10 @@
|
|
6461
6699
|
<!-- to split by '_' and other chars -->
|
6462
6700
|
<xsl:call-template name="add-zero-spaces-java"/>
|
6463
6701
|
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
6464
|
-
<fo:inline id="{@id}" font-size="1pt"/>
|
6702
|
+
<!-- <fo:inline id="{@id}" font-size="1pt"/> -->
|
6703
|
+
<fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
|
6704
|
+
<!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
|
6705
|
+
<xsl:if test="not(following-sibling::node()[normalize-space() != ''])"> </xsl:if>
|
6465
6706
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
6466
6707
|
<!-- <row>
|
6467
6708
|
<date>05-07-2013</date>
|
@@ -7129,6 +7370,120 @@
|
|
7129
7370
|
<xsl:apply-templates select="." mode="update_xml_step1"/>
|
7130
7371
|
</xsl:for-each>
|
7131
7372
|
</xsl:copy>
|
7373
|
+
</xsl:template><xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
7374
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
7375
|
+
</xsl:template><xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
|
7376
|
+
<xsl:copy>
|
7377
|
+
<xsl:apply-templates select="@*|node()" mode="update_xml_enclose_keep-together_within-line"/>
|
7378
|
+
</xsl:copy>
|
7379
|
+
</xsl:template><xsl:variable name="express_reference_separators">_.\</xsl:variable><xsl:variable name="express_reference_characters" select="concat($upper,$lower,'1234567890',$express_reference_separators)"/><xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable><xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
7380
|
+
|
7381
|
+
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
7382
|
+
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
7383
|
+
<xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
7384
|
+
<xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
7385
|
+
<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))"/>
|
7386
|
+
<xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
|
7387
|
+
<xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
|
7388
|
+
<xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
|
7389
|
+
<xsl:with-param name="text" select="$text_"/>
|
7390
|
+
</xsl:call-template></text></xsl:variable>
|
7391
|
+
|
7392
|
+
<xsl:variable name="parent" select="local-name(..)"/>
|
7393
|
+
|
7394
|
+
<xsl:variable name="text2">
|
7395
|
+
<text><xsl:for-each select="xalan:nodeset($text)/text/node()">
|
7396
|
+
<xsl:copy-of select="."/>
|
7397
|
+
</xsl:for-each></text>
|
7398
|
+
</xsl:variable>
|
7399
|
+
|
7400
|
+
<!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
|
7401
|
+
<xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable>
|
7402
|
+
<xsl:variable name="text3">
|
7403
|
+
<text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
|
7404
|
+
<xsl:choose>
|
7405
|
+
<xsl:when test="self::text()">
|
7406
|
+
<xsl:variable name="text_units_" select="java:replaceAll(java:java.lang.String.new(.),$regex_solidus_units,concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
|
7407
|
+
<xsl:variable name="text_units"><text><xsl:call-template name="replace_text_tags">
|
7408
|
+
<xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
|
7409
|
+
<xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
|
7410
|
+
<xsl:with-param name="text" select="$text_units_"/>
|
7411
|
+
</xsl:call-template></text></xsl:variable>
|
7412
|
+
<xsl:copy-of select="xalan:nodeset($text_units)/text/node()"/>
|
7413
|
+
</xsl:when>
|
7414
|
+
<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
|
7415
|
+
</xsl:choose>
|
7416
|
+
</xsl:for-each></text>
|
7417
|
+
</xsl:variable>
|
7418
|
+
|
7419
|
+
<xsl:choose>
|
7420
|
+
<xsl:when test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
|
7421
|
+
<!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
|
7422
|
+
<xsl:variable name="regex_dots_units">((\b((\S{1,3}\.\S+)|(\S+\.\S{1,3}))\b)|(\.\S{1,3})\b)</xsl:variable>
|
7423
|
+
<xsl:for-each select="xalan:nodeset($text3)/text/node()">
|
7424
|
+
<xsl:choose>
|
7425
|
+
<xsl:when test="self::text()">
|
7426
|
+
<xsl:variable name="text_dots_" select="java:replaceAll(java:java.lang.String.new(.),$regex_dots_units,concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
|
7427
|
+
<xsl:variable name="text_dots"><text><xsl:call-template name="replace_text_tags">
|
7428
|
+
<xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
|
7429
|
+
<xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
|
7430
|
+
<xsl:with-param name="text" select="$text_dots_"/>
|
7431
|
+
</xsl:call-template></text></xsl:variable>
|
7432
|
+
<xsl:copy-of select="xalan:nodeset($text_dots)/text/node()"/>
|
7433
|
+
</xsl:when>
|
7434
|
+
<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... -->
|
7435
|
+
</xsl:choose>
|
7436
|
+
</xsl:for-each>
|
7437
|
+
</xsl:when>
|
7438
|
+
<xsl:otherwise><xsl:copy-of select="xalan:nodeset($text3)/text/node()"/></xsl:otherwise>
|
7439
|
+
</xsl:choose>
|
7440
|
+
|
7441
|
+
</xsl:template><xsl:template name="replace_text_tags">
|
7442
|
+
<xsl:param name="tag_open"/>
|
7443
|
+
<xsl:param name="tag_close"/>
|
7444
|
+
<xsl:param name="text"/>
|
7445
|
+
<xsl:choose>
|
7446
|
+
<xsl:when test="contains($text, $tag_open)">
|
7447
|
+
<xsl:value-of select="substring-before($text, $tag_open)"/>
|
7448
|
+
<xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
|
7449
|
+
|
7450
|
+
<xsl:element name="{substring-before(substring-after($tag_open, '###'),'###')}">
|
7451
|
+
<xsl:value-of select="substring-before($text_after, $tag_close)"/>
|
7452
|
+
</xsl:element>
|
7453
|
+
|
7454
|
+
<xsl:call-template name="replace_text_tags">
|
7455
|
+
<xsl:with-param name="tag_open" select="$tag_open"/>
|
7456
|
+
<xsl:with-param name="tag_close" select="$tag_close"/>
|
7457
|
+
<xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
|
7458
|
+
</xsl:call-template>
|
7459
|
+
</xsl:when>
|
7460
|
+
<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
|
7461
|
+
</xsl:choose>
|
7462
|
+
</xsl:template><xsl:template name="printEdition">
|
7463
|
+
<xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
7464
|
+
<xsl:text> </xsl:text>
|
7465
|
+
<xsl:choose>
|
7466
|
+
<xsl:when test="$edition_i18n != ''">
|
7467
|
+
<!-- Example: <edition language="fr">deuxième édition</edition> -->
|
7468
|
+
<xsl:call-template name="capitalize">
|
7469
|
+
<xsl:with-param name="str" select="$edition_i18n"/>
|
7470
|
+
</xsl:call-template>
|
7471
|
+
</xsl:when>
|
7472
|
+
<xsl:otherwise>
|
7473
|
+
<xsl:variable name="edition" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
|
7474
|
+
<xsl:if test="$edition != ''"> <!-- Example: 1.3 -->
|
7475
|
+
<xsl:call-template name="capitalize">
|
7476
|
+
<xsl:with-param name="str">
|
7477
|
+
<xsl:call-template name="getLocalizedString">
|
7478
|
+
<xsl:with-param name="key">edition</xsl:with-param>
|
7479
|
+
</xsl:call-template>
|
7480
|
+
</xsl:with-param>
|
7481
|
+
</xsl:call-template>
|
7482
|
+
<xsl:text> </xsl:text>
|
7483
|
+
<xsl:value-of select="$edition"/>
|
7484
|
+
</xsl:if>
|
7485
|
+
</xsl:otherwise>
|
7486
|
+
</xsl:choose>
|
7132
7487
|
</xsl:template><xsl:template name="convertDate">
|
7133
7488
|
<xsl:param name="date"/>
|
7134
7489
|
<xsl:param name="format" select="'short'"/>
|