metanorma-m3aawg 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/m3aawg/html/htmlstyle.css +5 -2
- data/lib/isodoc/m3aawg/m3aawg.policy.xsl +216 -184
- data/lib/isodoc/m3aawg/m3aawg.report.xsl +216 -184
- data/lib/metanorma/m3aawg/isodoc.rng +11 -1
- data/lib/metanorma/m3aawg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 520661f46047c4c0f2a11a5485a3b562d9c97f8c472c00c126ca2538c6d793ee
|
4
|
+
data.tar.gz: 3f2f195f6f220741ac8a64880c1d494676851478b69883318fc93a4f364c8203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24da8605761b7e73c21a02c826818445428aba6db28227499cb361df4728e568966684d20a3e3324cd326adda656178be640c874fec970cdb2a1c9663a9b6634
|
7
|
+
data.tar.gz: 7addc8e4535ec7e32f2365e823c756b6ca6c0830eccf497c23fd7dcf9f75d35fea17360c28303726015295d5c1326454b9e039f7e9698668cd96f26f6ce1eafd
|
@@ -655,8 +655,11 @@ a:hover {
|
|
655
655
|
background: #69C5DC;
|
656
656
|
box-shadow: 3px 0 0 #69C5DC, -3px 0 0 #69C5DC; }
|
657
657
|
|
658
|
-
|
659
|
-
|
658
|
+
*::selection {
|
659
|
+
background: #69C5DC;
|
660
|
+
color: white; }
|
661
|
+
|
662
|
+
*::-moz-selection {
|
660
663
|
background: #69C5DC;
|
661
664
|
color: white; }
|
662
665
|
|
@@ -1425,6 +1425,12 @@
|
|
1425
1425
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1426
1426
|
</xsl:attribute-set>
|
1427
1427
|
|
1428
|
+
<xsl:attribute-set name="figure-block-style">
|
1429
|
+
|
1430
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1431
|
+
|
1432
|
+
</xsl:attribute-set>
|
1433
|
+
|
1428
1434
|
<xsl:attribute-set name="figure-style">
|
1429
1435
|
|
1430
1436
|
</xsl:attribute-set>
|
@@ -1433,7 +1439,7 @@
|
|
1433
1439
|
|
1434
1440
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
1435
1441
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
1436
|
-
<xsl:attribute name="
|
1442
|
+
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
1437
1443
|
<xsl:attribute name="keep-with-previous">always</xsl:attribute>
|
1438
1444
|
|
1439
1445
|
</xsl:attribute-set>
|
@@ -2835,6 +2841,10 @@
|
|
2835
2841
|
<xsl:with-param name="continued">true</xsl:with-param>
|
2836
2842
|
</xsl:apply-templates>
|
2837
2843
|
|
2844
|
+
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
2845
|
+
<fo:block/>
|
2846
|
+
</xsl:if>
|
2847
|
+
|
2838
2848
|
</fo:table-cell>
|
2839
2849
|
</fo:table-row>
|
2840
2850
|
</xsl:template> <!-- table-header-title -->
|
@@ -3219,7 +3229,22 @@
|
|
3219
3229
|
|
3220
3230
|
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
3221
3231
|
<xsl:variable name="footnote_inline">
|
3222
|
-
<fo:inline
|
3232
|
+
<fo:inline>
|
3233
|
+
|
3234
|
+
<xsl:variable name="fn_styles">
|
3235
|
+
<xsl:choose>
|
3236
|
+
<xsl:when test="ancestor::*[local-name() = 'bibitem']">
|
3237
|
+
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
|
3238
|
+
</xsl:when>
|
3239
|
+
<xsl:otherwise>
|
3240
|
+
<fn_styles xsl:use-attribute-sets="fn-num-style"/>
|
3241
|
+
</xsl:otherwise>
|
3242
|
+
</xsl:choose>
|
3243
|
+
</xsl:variable>
|
3244
|
+
|
3245
|
+
<xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
|
3246
|
+
<xsl:copy-of select="."/>
|
3247
|
+
</xsl:for-each>
|
3223
3248
|
|
3224
3249
|
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
3225
3250
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
@@ -3283,7 +3308,10 @@
|
|
3283
3308
|
</xsl:for-each>
|
3284
3309
|
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
|
3285
3310
|
<xsl:sort select="@displayorder" data-type="number"/>
|
3286
|
-
|
3311
|
+
<!-- commented:
|
3312
|
+
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
3313
|
+
because 'fn' there is in biblio-tag -->
|
3314
|
+
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
3287
3315
|
<!-- copy unique fn -->
|
3288
3316
|
<fn gen_id="{generate-id(.)}">
|
3289
3317
|
<xsl:copy-of select="@*"/>
|
@@ -4132,7 +4160,7 @@
|
|
4132
4160
|
|
4133
4161
|
<xsl:variable name="_font-size">
|
4134
4162
|
|
4135
|
-
<!--
|
4163
|
+
<!-- inherit -->
|
4136
4164
|
|
4137
4165
|
<xsl:choose>
|
4138
4166
|
<xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
|
@@ -5105,6 +5133,33 @@
|
|
5105
5133
|
</xsl:choose>
|
5106
5134
|
</xsl:template>
|
5107
5135
|
|
5136
|
+
<xsl:template name="getLang_fromCurrentNode">
|
5137
|
+
<xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
5138
|
+
<xsl:variable name="language">
|
5139
|
+
<xsl:choose>
|
5140
|
+
<xsl:when test="$language_current != ''">
|
5141
|
+
<xsl:value-of select="$language_current"/>
|
5142
|
+
</xsl:when>
|
5143
|
+
<xsl:otherwise>
|
5144
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
5145
|
+
<xsl:choose>
|
5146
|
+
<xsl:when test="$language_current_2 != ''">
|
5147
|
+
<xsl:value-of select="$language_current_2"/>
|
5148
|
+
</xsl:when>
|
5149
|
+
<xsl:otherwise>
|
5150
|
+
<xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
|
5151
|
+
</xsl:otherwise>
|
5152
|
+
</xsl:choose>
|
5153
|
+
</xsl:otherwise>
|
5154
|
+
</xsl:choose>
|
5155
|
+
</xsl:variable>
|
5156
|
+
|
5157
|
+
<xsl:choose>
|
5158
|
+
<xsl:when test="$language = 'English'">en</xsl:when>
|
5159
|
+
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
5160
|
+
</xsl:choose>
|
5161
|
+
</xsl:template>
|
5162
|
+
|
5108
5163
|
<xsl:template name="capitalizeWords">
|
5109
5164
|
<xsl:param name="str"/>
|
5110
5165
|
<xsl:variable name="str2" select="translate($str, '-', ' ')"/>
|
@@ -5725,7 +5780,7 @@
|
|
5725
5780
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
5726
5781
|
<xsl:variable name="isAdded" select="@added"/>
|
5727
5782
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
5728
|
-
<fo:block-container id="{@id}">
|
5783
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
5729
5784
|
|
5730
5785
|
<xsl:call-template name="setTrackChangesStyles">
|
5731
5786
|
<xsl:with-param name="isAdded" select="$isAdded"/>
|
@@ -6711,7 +6766,13 @@
|
|
6711
6766
|
</xsl:template>
|
6712
6767
|
|
6713
6768
|
<xsl:template match="text()" mode="contents_item">
|
6714
|
-
<xsl:
|
6769
|
+
<xsl:variable name="text">
|
6770
|
+
<!-- to split by '_' and other chars -->
|
6771
|
+
<text><xsl:call-template name="add-zero-spaces-java"/></text>
|
6772
|
+
</xsl:variable>
|
6773
|
+
<xsl:for-each select="xalan:nodeset($text)/text/text()">
|
6774
|
+
<xsl:call-template name="keep_together_standard_number"/>
|
6775
|
+
</xsl:for-each>
|
6715
6776
|
</xsl:template>
|
6716
6777
|
|
6717
6778
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
@@ -6722,34 +6783,52 @@
|
|
6722
6783
|
<!-- =============== -->
|
6723
6784
|
<!-- sourcecode -->
|
6724
6785
|
<!-- =============== -->
|
6725
|
-
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
6726
6786
|
|
6727
|
-
|
6728
|
-
|
6729
|
-
|
6787
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
|
6788
|
+
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
6789
|
+
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
6730
6790
|
|
6731
|
-
|
6791
|
+
<xsl:template match="*[local-name() = 'property']" mode="css">
|
6792
|
+
<xsl:attribute name="{@name}">
|
6793
|
+
<xsl:value-of select="@value"/>
|
6794
|
+
</xsl:attribute>
|
6795
|
+
</xsl:template>
|
6732
6796
|
|
6733
|
-
|
6734
|
-
|
6735
|
-
|
6797
|
+
<xsl:template name="get_sourcecode_attributes">
|
6798
|
+
<xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
|
6799
|
+
<xsl:variable name="_font-size">
|
6736
6800
|
|
6737
|
-
|
6801
|
+
<!-- inherit -->
|
6738
6802
|
|
6739
|
-
<xsl:
|
6740
|
-
|
6741
|
-
|
6742
|
-
|
6743
|
-
|
6744
|
-
|
6745
|
-
|
6746
|
-
|
6747
|
-
|
6748
|
-
|
6749
|
-
|
6750
|
-
|
6803
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
6804
|
+
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
6805
|
+
</xsl:if> -->
|
6806
|
+
|
6807
|
+
</xsl:variable>
|
6808
|
+
|
6809
|
+
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
6810
|
+
<xsl:if test="$font-size != ''">
|
6811
|
+
<xsl:attribute name="font-size">
|
6812
|
+
<xsl:choose>
|
6813
|
+
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
6814
|
+
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
6815
|
+
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
6816
|
+
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
6817
|
+
</xsl:choose>
|
6818
|
+
</xsl:attribute>
|
6819
|
+
</xsl:if>
|
6820
|
+
<xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
|
6821
|
+
</xsl:element>
|
6822
|
+
</xsl:template>
|
6823
|
+
|
6824
|
+
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
6825
|
+
|
6826
|
+
<xsl:variable name="sourcecode_attributes">
|
6827
|
+
<xsl:call-template name="get_sourcecode_attributes"/>
|
6751
6828
|
</xsl:variable>
|
6752
6829
|
|
6830
|
+
<!-- <xsl:copy-of select="$sourcecode_css"/> -->
|
6831
|
+
|
6753
6832
|
<xsl:choose>
|
6754
6833
|
<xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
|
6755
6834
|
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
@@ -6803,9 +6882,10 @@
|
|
6803
6882
|
</xsl:choose>
|
6804
6883
|
</xsl:template>
|
6805
6884
|
|
6806
|
-
<xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
6885
|
+
<xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
|
6807
6886
|
<xsl:choose>
|
6808
|
-
|
6887
|
+
<!-- disabled -->
|
6888
|
+
<xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
|
6809
6889
|
<xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
|
6810
6890
|
<xsl:choose>
|
6811
6891
|
<xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
|
@@ -6820,8 +6900,75 @@
|
|
6820
6900
|
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
6821
6901
|
</xsl:otherwise>
|
6822
6902
|
</xsl:choose>
|
6903
|
+
</xsl:template>
|
6904
|
+
|
6905
|
+
<!-- add sourcecode highlighting -->
|
6906
|
+
<xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
|
6907
|
+
<xsl:variable name="class" select="@class"/>
|
6908
|
+
<xsl:choose>
|
6909
|
+
<xsl:when test="$sourcecode_css//class[@name = $class]">
|
6910
|
+
<fo:inline>
|
6911
|
+
<xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
|
6912
|
+
<xsl:apply-templates/>
|
6913
|
+
</fo:inline>
|
6914
|
+
</xsl:when>
|
6915
|
+
<xsl:otherwise>
|
6916
|
+
<xsl:apply-templates/>
|
6917
|
+
</xsl:otherwise>
|
6918
|
+
</xsl:choose>
|
6919
|
+
</xsl:template>
|
6823
6920
|
|
6921
|
+
<!-- outer table with line numbers for sourcecode -->
|
6922
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
|
6923
|
+
<fo:block>
|
6924
|
+
<fo:table width="100%" table-layout="fixed">
|
6925
|
+
<xsl:copy-of select="@id"/>
|
6926
|
+
<fo:table-column column-width="8%"/>
|
6927
|
+
<fo:table-column column-width="92%"/>
|
6928
|
+
<fo:table-body>
|
6929
|
+
<xsl:apply-templates/>
|
6930
|
+
</fo:table-body>
|
6931
|
+
</fo:table>
|
6932
|
+
</fo:block>
|
6933
|
+
</xsl:template>
|
6934
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
|
6935
|
+
<xsl:apply-templates/>
|
6824
6936
|
</xsl:template>
|
6937
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
|
6938
|
+
<fo:table-row>
|
6939
|
+
<xsl:apply-templates/>
|
6940
|
+
</fo:table-row>
|
6941
|
+
</xsl:template>
|
6942
|
+
<!-- first td with line numbers -->
|
6943
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
|
6944
|
+
<fo:table-cell>
|
6945
|
+
<fo:block>
|
6946
|
+
|
6947
|
+
<!-- set attibutes for line numbers - same as sourcecode -->
|
6948
|
+
<xsl:variable name="sourcecode_attributes">
|
6949
|
+
<xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
|
6950
|
+
<xsl:call-template name="get_sourcecode_attributes"/>
|
6951
|
+
</xsl:for-each>
|
6952
|
+
</xsl:variable>
|
6953
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
|
6954
|
+
<xsl:attribute name="{local-name()}">
|
6955
|
+
<xsl:value-of select="."/>
|
6956
|
+
</xsl:attribute>
|
6957
|
+
</xsl:for-each>
|
6958
|
+
|
6959
|
+
<xsl:apply-templates/>
|
6960
|
+
</fo:block>
|
6961
|
+
</fo:table-cell>
|
6962
|
+
</xsl:template>
|
6963
|
+
<!-- second td with sourcecode -->
|
6964
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
|
6965
|
+
<fo:table-cell>
|
6966
|
+
<fo:block>
|
6967
|
+
<xsl:apply-templates/>
|
6968
|
+
</fo:block>
|
6969
|
+
</fo:table-cell>
|
6970
|
+
</xsl:template>
|
6971
|
+
<!-- END outer table with line numbers for sourcecode -->
|
6825
6972
|
|
6826
6973
|
<xsl:template name="add_spaces_to_sourcecode">
|
6827
6974
|
<xsl:variable name="text_step1">
|
@@ -8511,17 +8658,17 @@
|
|
8511
8658
|
<fo:block>
|
8512
8659
|
<fo:inline>
|
8513
8660
|
|
8514
|
-
|
8515
|
-
|
8516
|
-
|
8517
|
-
</xsl:if>
|
8518
|
-
|
8661
|
+
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
|
8662
|
+
<xsl:with-param name="biblio_tag_part">first</xsl:with-param>
|
8663
|
+
</xsl:apply-templates>
|
8519
8664
|
</fo:inline>
|
8520
8665
|
</fo:block>
|
8521
8666
|
</fo:list-item-label>
|
8522
8667
|
<fo:list-item-body start-indent="body-start()">
|
8523
8668
|
<fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
|
8524
|
-
<xsl:call-template name="processBibitem"
|
8669
|
+
<xsl:call-template name="processBibitem">
|
8670
|
+
<xsl:with-param name="biblio_tag_part">last</xsl:with-param>
|
8671
|
+
</xsl:call-template>
|
8525
8672
|
</fo:block>
|
8526
8673
|
</fo:list-item-body>
|
8527
8674
|
</fo:list-item>
|
@@ -8530,176 +8677,51 @@
|
|
8530
8677
|
</xsl:template> <!-- references[not(@normative='true')]/bibitem -->
|
8531
8678
|
|
8532
8679
|
<xsl:template name="processBibitem">
|
8680
|
+
<xsl:param name="biblio_tag_part">both</xsl:param>
|
8533
8681
|
|
8534
8682
|
<!-- start bibitem processing -->
|
8535
8683
|
<xsl:if test=".//*[local-name() = 'fn']">
|
8536
8684
|
<xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
|
8537
8685
|
</xsl:if>
|
8538
8686
|
|
8539
|
-
|
8540
|
-
|
8541
|
-
|
8542
|
-
<xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
|
8543
|
-
<xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
|
8544
|
-
</xsl:choose>
|
8545
|
-
</xsl:variable>
|
8546
|
-
<xsl:value-of select="$docidentifier"/>
|
8547
|
-
|
8548
|
-
<xsl:apply-templates select="*[local-name() = 'note']"/>
|
8549
|
-
|
8550
|
-
<xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
|
8551
|
-
<xsl:text>,</xsl:text>
|
8552
|
-
<xsl:text> </xsl:text>
|
8553
|
-
</xsl:if>
|
8554
|
-
|
8687
|
+
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
|
8688
|
+
<xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
|
8689
|
+
</xsl:apply-templates>
|
8555
8690
|
<xsl:apply-templates select="*[local-name() = 'formattedref']"/>
|
8556
8691
|
<!-- end bibitem processing -->
|
8557
8692
|
|
8558
8693
|
</xsl:template> <!-- processBibitem (bibitem) -->
|
8559
8694
|
|
8560
|
-
<xsl:template name="
|
8561
|
-
<xsl:
|
8562
|
-
|
8563
|
-
|
8564
|
-
|
8565
|
-
|
8566
|
-
|
8567
|
-
|
8568
|
-
|
8569
|
-
|
8570
|
-
|
8571
|
-
|
8572
|
-
<xsl:if test="$type != ''">
|
8573
|
-
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
8574
|
-
</xsl:if> -->
|
8575
|
-
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
|
8576
|
-
</xsl:otherwise>
|
8577
|
-
</xsl:choose>
|
8578
|
-
</xsl:template> <!-- processBibitemDocId -->
|
8695
|
+
<xsl:template match="*[local-name() = 'title']" mode="title">
|
8696
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
8697
|
+
</xsl:template>
|
8698
|
+
|
8699
|
+
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
|
8700
|
+
|
8701
|
+
<xsl:template match="*[local-name() = 'formattedref']">
|
8702
|
+
<!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
|
8703
|
+
<xsl:text>, </xsl:text>
|
8704
|
+
</xsl:if> -->
|
8705
|
+
<xsl:apply-templates/>
|
8706
|
+
</xsl:template>
|
8579
8707
|
|
8580
|
-
<xsl:template name="
|
8708
|
+
<xsl:template match="*[local-name() = 'biblio-tag']">
|
8709
|
+
<xsl:param name="biblio_tag_part">both</xsl:param>
|
8581
8710
|
<xsl:choose>
|
8582
|
-
<xsl:when test="
|
8583
|
-
<
|
8584
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
|
8585
|
-
</author>
|
8586
|
-
</xsl:when>
|
8587
|
-
<xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
|
8588
|
-
<author>
|
8589
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
|
8590
|
-
<xsl:text> </xsl:text>
|
8591
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
|
8592
|
-
</author>
|
8711
|
+
<xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
|
8712
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
8593
8713
|
</xsl:when>
|
8594
|
-
<xsl:when test="
|
8595
|
-
<
|
8596
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
|
8597
|
-
<xsl:text> </xsl:text>
|
8598
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
|
8599
|
-
</author>
|
8714
|
+
<xsl:when test="$biblio_tag_part = 'last'">
|
8715
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
8600
8716
|
</xsl:when>
|
8601
8717
|
<xsl:otherwise>
|
8602
8718
|
<xsl:apply-templates/>
|
8603
8719
|
</xsl:otherwise>
|
8604
8720
|
</xsl:choose>
|
8605
|
-
</xsl:template> <!-- processPersonalAuthor -->
|
8606
|
-
|
8607
|
-
<xsl:template name="renderDate">
|
8608
|
-
<xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
|
8609
|
-
<xsl:value-of select="*[local-name() = 'on']"/>
|
8610
|
-
</xsl:if>
|
8611
|
-
<xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
|
8612
|
-
<xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
|
8613
|
-
</xsl:if>
|
8614
|
-
</xsl:template>
|
8615
|
-
|
8616
|
-
<xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
|
8617
|
-
<xsl:value-of select="translate(.,'. ','')"/>
|
8618
|
-
</xsl:template>
|
8619
|
-
|
8620
|
-
<xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
8621
|
-
<xsl:value-of select="substring(.,1,1)"/>
|
8622
8721
|
</xsl:template>
|
8623
8722
|
|
8624
|
-
<xsl:template match="*[local-name() = '
|
8625
|
-
<
|
8626
|
-
</xsl:template>
|
8627
|
-
|
8628
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
|
8629
|
-
<!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
|
8630
|
-
<fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
|
8631
|
-
<xsl:apply-templates/>
|
8632
|
-
</fo:inline>
|
8633
|
-
</xsl:template>
|
8634
|
-
|
8635
|
-
<!-- bibitem/note renders as footnote -->
|
8636
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
|
8637
|
-
|
8638
|
-
<!-- list of footnotes to calculate actual footnotes number -->
|
8639
|
-
<xsl:variable name="p_fn_">
|
8640
|
-
<xsl:call-template name="get_fn_list"/>
|
8641
|
-
</xsl:variable>
|
8642
|
-
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
8643
|
-
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
8644
|
-
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
8645
|
-
<!-- fn sequence number in document -->
|
8646
|
-
<xsl:variable name="current_fn_number">
|
8647
|
-
<xsl:choose>
|
8648
|
-
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
8649
|
-
<xsl:otherwise>
|
8650
|
-
<!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
|
8651
|
-
<xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
|
8652
|
-
</xsl:otherwise>
|
8653
|
-
</xsl:choose>
|
8654
|
-
</xsl:variable>
|
8655
|
-
<fo:footnote>
|
8656
|
-
<xsl:variable name="number">
|
8657
|
-
|
8658
|
-
<xsl:value-of select="$current_fn_number"/>
|
8659
|
-
|
8660
|
-
</xsl:variable>
|
8661
|
-
|
8662
|
-
<xsl:variable name="current_fn_number_text">
|
8663
|
-
<xsl:value-of select="$number"/>
|
8664
|
-
|
8665
|
-
</xsl:variable>
|
8666
|
-
|
8667
|
-
<fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
|
8668
|
-
<fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
|
8669
|
-
<xsl:value-of select="$current_fn_number_text"/>
|
8670
|
-
</fo:basic-link>
|
8671
|
-
</fo:inline>
|
8672
|
-
<fo:footnote-body>
|
8673
|
-
<fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
|
8674
|
-
<fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
|
8675
|
-
<xsl:value-of select="$current_fn_number_text"/>
|
8676
|
-
</fo:inline>
|
8677
|
-
<xsl:apply-templates/>
|
8678
|
-
</fo:block>
|
8679
|
-
</fo:footnote-body>
|
8680
|
-
</fo:footnote>
|
8681
|
-
</xsl:template>
|
8682
|
-
|
8683
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
|
8684
|
-
<xsl:text> edition </xsl:text>
|
8685
|
-
<xsl:value-of select="."/>
|
8686
|
-
</xsl:template>
|
8687
|
-
|
8688
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
|
8689
|
-
<xsl:text> (</xsl:text>
|
8690
|
-
<fo:inline xsl:use-attribute-sets="link-style">
|
8691
|
-
<fo:basic-link external-destination="." fox:alt-text=".">
|
8692
|
-
<xsl:value-of select="."/>
|
8693
|
-
</fo:basic-link>
|
8694
|
-
</fo:inline>
|
8695
|
-
<xsl:text>)</xsl:text>
|
8696
|
-
</xsl:template>
|
8697
|
-
|
8698
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
|
8699
|
-
|
8700
|
-
<xsl:template match="*[local-name() = 'formattedref']">
|
8701
|
-
|
8702
|
-
<xsl:apply-templates/>
|
8723
|
+
<xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
|
8724
|
+
<xsl:text> </xsl:text>
|
8703
8725
|
</xsl:template>
|
8704
8726
|
|
8705
8727
|
<!-- ======================= -->
|
@@ -9125,6 +9147,12 @@
|
|
9125
9147
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
9126
9148
|
<xsl:apply-templates mode="update_xml_step1"/>
|
9127
9149
|
</xsl:template>
|
9150
|
+
<xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
9151
|
+
<xsl:copy>
|
9152
|
+
<xsl:copy-of select="@*"/>
|
9153
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
9154
|
+
</xsl:copy>
|
9155
|
+
</xsl:template>
|
9128
9156
|
<!-- =========================================================================== -->
|
9129
9157
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
9130
9158
|
<!-- =========================================================================== -->
|
@@ -9605,6 +9633,10 @@
|
|
9605
9633
|
<xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
|
9606
9634
|
</xsl:template>
|
9607
9635
|
|
9636
|
+
<xsl:template name="getDocumentId_fromCurrentNode">
|
9637
|
+
<xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
|
9638
|
+
</xsl:template>
|
9639
|
+
|
9608
9640
|
<xsl:template name="namespaceCheck">
|
9609
9641
|
<xsl:variable name="documentNS" select="namespace-uri(/*)"/>
|
9610
9642
|
<xsl:variable name="XSLNS">
|
@@ -1425,6 +1425,12 @@
|
|
1425
1425
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1426
1426
|
</xsl:attribute-set>
|
1427
1427
|
|
1428
|
+
<xsl:attribute-set name="figure-block-style">
|
1429
|
+
|
1430
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1431
|
+
|
1432
|
+
</xsl:attribute-set>
|
1433
|
+
|
1428
1434
|
<xsl:attribute-set name="figure-style">
|
1429
1435
|
|
1430
1436
|
</xsl:attribute-set>
|
@@ -1433,7 +1439,7 @@
|
|
1433
1439
|
|
1434
1440
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
1435
1441
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
1436
|
-
<xsl:attribute name="
|
1442
|
+
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
1437
1443
|
<xsl:attribute name="keep-with-previous">always</xsl:attribute>
|
1438
1444
|
|
1439
1445
|
</xsl:attribute-set>
|
@@ -2835,6 +2841,10 @@
|
|
2835
2841
|
<xsl:with-param name="continued">true</xsl:with-param>
|
2836
2842
|
</xsl:apply-templates>
|
2837
2843
|
|
2844
|
+
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
2845
|
+
<fo:block/>
|
2846
|
+
</xsl:if>
|
2847
|
+
|
2838
2848
|
</fo:table-cell>
|
2839
2849
|
</fo:table-row>
|
2840
2850
|
</xsl:template> <!-- table-header-title -->
|
@@ -3219,7 +3229,22 @@
|
|
3219
3229
|
|
3220
3230
|
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
3221
3231
|
<xsl:variable name="footnote_inline">
|
3222
|
-
<fo:inline
|
3232
|
+
<fo:inline>
|
3233
|
+
|
3234
|
+
<xsl:variable name="fn_styles">
|
3235
|
+
<xsl:choose>
|
3236
|
+
<xsl:when test="ancestor::*[local-name() = 'bibitem']">
|
3237
|
+
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
|
3238
|
+
</xsl:when>
|
3239
|
+
<xsl:otherwise>
|
3240
|
+
<fn_styles xsl:use-attribute-sets="fn-num-style"/>
|
3241
|
+
</xsl:otherwise>
|
3242
|
+
</xsl:choose>
|
3243
|
+
</xsl:variable>
|
3244
|
+
|
3245
|
+
<xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
|
3246
|
+
<xsl:copy-of select="."/>
|
3247
|
+
</xsl:for-each>
|
3223
3248
|
|
3224
3249
|
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
3225
3250
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
@@ -3283,7 +3308,10 @@
|
|
3283
3308
|
</xsl:for-each>
|
3284
3309
|
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
|
3285
3310
|
<xsl:sort select="@displayorder" data-type="number"/>
|
3286
|
-
|
3311
|
+
<!-- commented:
|
3312
|
+
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
3313
|
+
because 'fn' there is in biblio-tag -->
|
3314
|
+
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
3287
3315
|
<!-- copy unique fn -->
|
3288
3316
|
<fn gen_id="{generate-id(.)}">
|
3289
3317
|
<xsl:copy-of select="@*"/>
|
@@ -4132,7 +4160,7 @@
|
|
4132
4160
|
|
4133
4161
|
<xsl:variable name="_font-size">
|
4134
4162
|
|
4135
|
-
<!--
|
4163
|
+
<!-- inherit -->
|
4136
4164
|
|
4137
4165
|
<xsl:choose>
|
4138
4166
|
<xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
|
@@ -5105,6 +5133,33 @@
|
|
5105
5133
|
</xsl:choose>
|
5106
5134
|
</xsl:template>
|
5107
5135
|
|
5136
|
+
<xsl:template name="getLang_fromCurrentNode">
|
5137
|
+
<xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
5138
|
+
<xsl:variable name="language">
|
5139
|
+
<xsl:choose>
|
5140
|
+
<xsl:when test="$language_current != ''">
|
5141
|
+
<xsl:value-of select="$language_current"/>
|
5142
|
+
</xsl:when>
|
5143
|
+
<xsl:otherwise>
|
5144
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
5145
|
+
<xsl:choose>
|
5146
|
+
<xsl:when test="$language_current_2 != ''">
|
5147
|
+
<xsl:value-of select="$language_current_2"/>
|
5148
|
+
</xsl:when>
|
5149
|
+
<xsl:otherwise>
|
5150
|
+
<xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
|
5151
|
+
</xsl:otherwise>
|
5152
|
+
</xsl:choose>
|
5153
|
+
</xsl:otherwise>
|
5154
|
+
</xsl:choose>
|
5155
|
+
</xsl:variable>
|
5156
|
+
|
5157
|
+
<xsl:choose>
|
5158
|
+
<xsl:when test="$language = 'English'">en</xsl:when>
|
5159
|
+
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
5160
|
+
</xsl:choose>
|
5161
|
+
</xsl:template>
|
5162
|
+
|
5108
5163
|
<xsl:template name="capitalizeWords">
|
5109
5164
|
<xsl:param name="str"/>
|
5110
5165
|
<xsl:variable name="str2" select="translate($str, '-', ' ')"/>
|
@@ -5725,7 +5780,7 @@
|
|
5725
5780
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
5726
5781
|
<xsl:variable name="isAdded" select="@added"/>
|
5727
5782
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
5728
|
-
<fo:block-container id="{@id}">
|
5783
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
5729
5784
|
|
5730
5785
|
<xsl:call-template name="setTrackChangesStyles">
|
5731
5786
|
<xsl:with-param name="isAdded" select="$isAdded"/>
|
@@ -6711,7 +6766,13 @@
|
|
6711
6766
|
</xsl:template>
|
6712
6767
|
|
6713
6768
|
<xsl:template match="text()" mode="contents_item">
|
6714
|
-
<xsl:
|
6769
|
+
<xsl:variable name="text">
|
6770
|
+
<!-- to split by '_' and other chars -->
|
6771
|
+
<text><xsl:call-template name="add-zero-spaces-java"/></text>
|
6772
|
+
</xsl:variable>
|
6773
|
+
<xsl:for-each select="xalan:nodeset($text)/text/text()">
|
6774
|
+
<xsl:call-template name="keep_together_standard_number"/>
|
6775
|
+
</xsl:for-each>
|
6715
6776
|
</xsl:template>
|
6716
6777
|
|
6717
6778
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
@@ -6722,34 +6783,52 @@
|
|
6722
6783
|
<!-- =============== -->
|
6723
6784
|
<!-- sourcecode -->
|
6724
6785
|
<!-- =============== -->
|
6725
|
-
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
6726
6786
|
|
6727
|
-
|
6728
|
-
|
6729
|
-
|
6787
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
|
6788
|
+
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
6789
|
+
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
6730
6790
|
|
6731
|
-
|
6791
|
+
<xsl:template match="*[local-name() = 'property']" mode="css">
|
6792
|
+
<xsl:attribute name="{@name}">
|
6793
|
+
<xsl:value-of select="@value"/>
|
6794
|
+
</xsl:attribute>
|
6795
|
+
</xsl:template>
|
6732
6796
|
|
6733
|
-
|
6734
|
-
|
6735
|
-
|
6797
|
+
<xsl:template name="get_sourcecode_attributes">
|
6798
|
+
<xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
|
6799
|
+
<xsl:variable name="_font-size">
|
6736
6800
|
|
6737
|
-
|
6801
|
+
<!-- inherit -->
|
6738
6802
|
|
6739
|
-
<xsl:
|
6740
|
-
|
6741
|
-
|
6742
|
-
|
6743
|
-
|
6744
|
-
|
6745
|
-
|
6746
|
-
|
6747
|
-
|
6748
|
-
|
6749
|
-
|
6750
|
-
|
6803
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
6804
|
+
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
6805
|
+
</xsl:if> -->
|
6806
|
+
|
6807
|
+
</xsl:variable>
|
6808
|
+
|
6809
|
+
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
6810
|
+
<xsl:if test="$font-size != ''">
|
6811
|
+
<xsl:attribute name="font-size">
|
6812
|
+
<xsl:choose>
|
6813
|
+
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
6814
|
+
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
6815
|
+
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
6816
|
+
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
6817
|
+
</xsl:choose>
|
6818
|
+
</xsl:attribute>
|
6819
|
+
</xsl:if>
|
6820
|
+
<xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
|
6821
|
+
</xsl:element>
|
6822
|
+
</xsl:template>
|
6823
|
+
|
6824
|
+
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
6825
|
+
|
6826
|
+
<xsl:variable name="sourcecode_attributes">
|
6827
|
+
<xsl:call-template name="get_sourcecode_attributes"/>
|
6751
6828
|
</xsl:variable>
|
6752
6829
|
|
6830
|
+
<!-- <xsl:copy-of select="$sourcecode_css"/> -->
|
6831
|
+
|
6753
6832
|
<xsl:choose>
|
6754
6833
|
<xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
|
6755
6834
|
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
@@ -6803,9 +6882,10 @@
|
|
6803
6882
|
</xsl:choose>
|
6804
6883
|
</xsl:template>
|
6805
6884
|
|
6806
|
-
<xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
6885
|
+
<xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
|
6807
6886
|
<xsl:choose>
|
6808
|
-
|
6887
|
+
<!-- disabled -->
|
6888
|
+
<xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
|
6809
6889
|
<xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
|
6810
6890
|
<xsl:choose>
|
6811
6891
|
<xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
|
@@ -6820,8 +6900,75 @@
|
|
6820
6900
|
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
6821
6901
|
</xsl:otherwise>
|
6822
6902
|
</xsl:choose>
|
6903
|
+
</xsl:template>
|
6904
|
+
|
6905
|
+
<!-- add sourcecode highlighting -->
|
6906
|
+
<xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
|
6907
|
+
<xsl:variable name="class" select="@class"/>
|
6908
|
+
<xsl:choose>
|
6909
|
+
<xsl:when test="$sourcecode_css//class[@name = $class]">
|
6910
|
+
<fo:inline>
|
6911
|
+
<xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
|
6912
|
+
<xsl:apply-templates/>
|
6913
|
+
</fo:inline>
|
6914
|
+
</xsl:when>
|
6915
|
+
<xsl:otherwise>
|
6916
|
+
<xsl:apply-templates/>
|
6917
|
+
</xsl:otherwise>
|
6918
|
+
</xsl:choose>
|
6919
|
+
</xsl:template>
|
6823
6920
|
|
6921
|
+
<!-- outer table with line numbers for sourcecode -->
|
6922
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
|
6923
|
+
<fo:block>
|
6924
|
+
<fo:table width="100%" table-layout="fixed">
|
6925
|
+
<xsl:copy-of select="@id"/>
|
6926
|
+
<fo:table-column column-width="8%"/>
|
6927
|
+
<fo:table-column column-width="92%"/>
|
6928
|
+
<fo:table-body>
|
6929
|
+
<xsl:apply-templates/>
|
6930
|
+
</fo:table-body>
|
6931
|
+
</fo:table>
|
6932
|
+
</fo:block>
|
6933
|
+
</xsl:template>
|
6934
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
|
6935
|
+
<xsl:apply-templates/>
|
6824
6936
|
</xsl:template>
|
6937
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
|
6938
|
+
<fo:table-row>
|
6939
|
+
<xsl:apply-templates/>
|
6940
|
+
</fo:table-row>
|
6941
|
+
</xsl:template>
|
6942
|
+
<!-- first td with line numbers -->
|
6943
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
|
6944
|
+
<fo:table-cell>
|
6945
|
+
<fo:block>
|
6946
|
+
|
6947
|
+
<!-- set attibutes for line numbers - same as sourcecode -->
|
6948
|
+
<xsl:variable name="sourcecode_attributes">
|
6949
|
+
<xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
|
6950
|
+
<xsl:call-template name="get_sourcecode_attributes"/>
|
6951
|
+
</xsl:for-each>
|
6952
|
+
</xsl:variable>
|
6953
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
|
6954
|
+
<xsl:attribute name="{local-name()}">
|
6955
|
+
<xsl:value-of select="."/>
|
6956
|
+
</xsl:attribute>
|
6957
|
+
</xsl:for-each>
|
6958
|
+
|
6959
|
+
<xsl:apply-templates/>
|
6960
|
+
</fo:block>
|
6961
|
+
</fo:table-cell>
|
6962
|
+
</xsl:template>
|
6963
|
+
<!-- second td with sourcecode -->
|
6964
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
|
6965
|
+
<fo:table-cell>
|
6966
|
+
<fo:block>
|
6967
|
+
<xsl:apply-templates/>
|
6968
|
+
</fo:block>
|
6969
|
+
</fo:table-cell>
|
6970
|
+
</xsl:template>
|
6971
|
+
<!-- END outer table with line numbers for sourcecode -->
|
6825
6972
|
|
6826
6973
|
<xsl:template name="add_spaces_to_sourcecode">
|
6827
6974
|
<xsl:variable name="text_step1">
|
@@ -8511,17 +8658,17 @@
|
|
8511
8658
|
<fo:block>
|
8512
8659
|
<fo:inline>
|
8513
8660
|
|
8514
|
-
|
8515
|
-
|
8516
|
-
|
8517
|
-
</xsl:if>
|
8518
|
-
|
8661
|
+
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
|
8662
|
+
<xsl:with-param name="biblio_tag_part">first</xsl:with-param>
|
8663
|
+
</xsl:apply-templates>
|
8519
8664
|
</fo:inline>
|
8520
8665
|
</fo:block>
|
8521
8666
|
</fo:list-item-label>
|
8522
8667
|
<fo:list-item-body start-indent="body-start()">
|
8523
8668
|
<fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
|
8524
|
-
<xsl:call-template name="processBibitem"
|
8669
|
+
<xsl:call-template name="processBibitem">
|
8670
|
+
<xsl:with-param name="biblio_tag_part">last</xsl:with-param>
|
8671
|
+
</xsl:call-template>
|
8525
8672
|
</fo:block>
|
8526
8673
|
</fo:list-item-body>
|
8527
8674
|
</fo:list-item>
|
@@ -8530,176 +8677,51 @@
|
|
8530
8677
|
</xsl:template> <!-- references[not(@normative='true')]/bibitem -->
|
8531
8678
|
|
8532
8679
|
<xsl:template name="processBibitem">
|
8680
|
+
<xsl:param name="biblio_tag_part">both</xsl:param>
|
8533
8681
|
|
8534
8682
|
<!-- start bibitem processing -->
|
8535
8683
|
<xsl:if test=".//*[local-name() = 'fn']">
|
8536
8684
|
<xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
|
8537
8685
|
</xsl:if>
|
8538
8686
|
|
8539
|
-
|
8540
|
-
|
8541
|
-
|
8542
|
-
<xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
|
8543
|
-
<xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
|
8544
|
-
</xsl:choose>
|
8545
|
-
</xsl:variable>
|
8546
|
-
<xsl:value-of select="$docidentifier"/>
|
8547
|
-
|
8548
|
-
<xsl:apply-templates select="*[local-name() = 'note']"/>
|
8549
|
-
|
8550
|
-
<xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
|
8551
|
-
<xsl:text>,</xsl:text>
|
8552
|
-
<xsl:text> </xsl:text>
|
8553
|
-
</xsl:if>
|
8554
|
-
|
8687
|
+
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
|
8688
|
+
<xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
|
8689
|
+
</xsl:apply-templates>
|
8555
8690
|
<xsl:apply-templates select="*[local-name() = 'formattedref']"/>
|
8556
8691
|
<!-- end bibitem processing -->
|
8557
8692
|
|
8558
8693
|
</xsl:template> <!-- processBibitem (bibitem) -->
|
8559
8694
|
|
8560
|
-
<xsl:template name="
|
8561
|
-
<xsl:
|
8562
|
-
|
8563
|
-
|
8564
|
-
|
8565
|
-
|
8566
|
-
|
8567
|
-
|
8568
|
-
|
8569
|
-
|
8570
|
-
|
8571
|
-
|
8572
|
-
<xsl:if test="$type != ''">
|
8573
|
-
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
8574
|
-
</xsl:if> -->
|
8575
|
-
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
|
8576
|
-
</xsl:otherwise>
|
8577
|
-
</xsl:choose>
|
8578
|
-
</xsl:template> <!-- processBibitemDocId -->
|
8695
|
+
<xsl:template match="*[local-name() = 'title']" mode="title">
|
8696
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
8697
|
+
</xsl:template>
|
8698
|
+
|
8699
|
+
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
|
8700
|
+
|
8701
|
+
<xsl:template match="*[local-name() = 'formattedref']">
|
8702
|
+
<!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
|
8703
|
+
<xsl:text>, </xsl:text>
|
8704
|
+
</xsl:if> -->
|
8705
|
+
<xsl:apply-templates/>
|
8706
|
+
</xsl:template>
|
8579
8707
|
|
8580
|
-
<xsl:template name="
|
8708
|
+
<xsl:template match="*[local-name() = 'biblio-tag']">
|
8709
|
+
<xsl:param name="biblio_tag_part">both</xsl:param>
|
8581
8710
|
<xsl:choose>
|
8582
|
-
<xsl:when test="
|
8583
|
-
<
|
8584
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
|
8585
|
-
</author>
|
8586
|
-
</xsl:when>
|
8587
|
-
<xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
|
8588
|
-
<author>
|
8589
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
|
8590
|
-
<xsl:text> </xsl:text>
|
8591
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
|
8592
|
-
</author>
|
8711
|
+
<xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
|
8712
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
8593
8713
|
</xsl:when>
|
8594
|
-
<xsl:when test="
|
8595
|
-
<
|
8596
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
|
8597
|
-
<xsl:text> </xsl:text>
|
8598
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
|
8599
|
-
</author>
|
8714
|
+
<xsl:when test="$biblio_tag_part = 'last'">
|
8715
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
8600
8716
|
</xsl:when>
|
8601
8717
|
<xsl:otherwise>
|
8602
8718
|
<xsl:apply-templates/>
|
8603
8719
|
</xsl:otherwise>
|
8604
8720
|
</xsl:choose>
|
8605
|
-
</xsl:template> <!-- processPersonalAuthor -->
|
8606
|
-
|
8607
|
-
<xsl:template name="renderDate">
|
8608
|
-
<xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
|
8609
|
-
<xsl:value-of select="*[local-name() = 'on']"/>
|
8610
|
-
</xsl:if>
|
8611
|
-
<xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
|
8612
|
-
<xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
|
8613
|
-
</xsl:if>
|
8614
|
-
</xsl:template>
|
8615
|
-
|
8616
|
-
<xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
|
8617
|
-
<xsl:value-of select="translate(.,'. ','')"/>
|
8618
|
-
</xsl:template>
|
8619
|
-
|
8620
|
-
<xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
8621
|
-
<xsl:value-of select="substring(.,1,1)"/>
|
8622
8721
|
</xsl:template>
|
8623
8722
|
|
8624
|
-
<xsl:template match="*[local-name() = '
|
8625
|
-
<
|
8626
|
-
</xsl:template>
|
8627
|
-
|
8628
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
|
8629
|
-
<!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
|
8630
|
-
<fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
|
8631
|
-
<xsl:apply-templates/>
|
8632
|
-
</fo:inline>
|
8633
|
-
</xsl:template>
|
8634
|
-
|
8635
|
-
<!-- bibitem/note renders as footnote -->
|
8636
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
|
8637
|
-
|
8638
|
-
<!-- list of footnotes to calculate actual footnotes number -->
|
8639
|
-
<xsl:variable name="p_fn_">
|
8640
|
-
<xsl:call-template name="get_fn_list"/>
|
8641
|
-
</xsl:variable>
|
8642
|
-
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
8643
|
-
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
8644
|
-
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
8645
|
-
<!-- fn sequence number in document -->
|
8646
|
-
<xsl:variable name="current_fn_number">
|
8647
|
-
<xsl:choose>
|
8648
|
-
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
8649
|
-
<xsl:otherwise>
|
8650
|
-
<!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
|
8651
|
-
<xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
|
8652
|
-
</xsl:otherwise>
|
8653
|
-
</xsl:choose>
|
8654
|
-
</xsl:variable>
|
8655
|
-
<fo:footnote>
|
8656
|
-
<xsl:variable name="number">
|
8657
|
-
|
8658
|
-
<xsl:value-of select="$current_fn_number"/>
|
8659
|
-
|
8660
|
-
</xsl:variable>
|
8661
|
-
|
8662
|
-
<xsl:variable name="current_fn_number_text">
|
8663
|
-
<xsl:value-of select="$number"/>
|
8664
|
-
|
8665
|
-
</xsl:variable>
|
8666
|
-
|
8667
|
-
<fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
|
8668
|
-
<fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
|
8669
|
-
<xsl:value-of select="$current_fn_number_text"/>
|
8670
|
-
</fo:basic-link>
|
8671
|
-
</fo:inline>
|
8672
|
-
<fo:footnote-body>
|
8673
|
-
<fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
|
8674
|
-
<fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
|
8675
|
-
<xsl:value-of select="$current_fn_number_text"/>
|
8676
|
-
</fo:inline>
|
8677
|
-
<xsl:apply-templates/>
|
8678
|
-
</fo:block>
|
8679
|
-
</fo:footnote-body>
|
8680
|
-
</fo:footnote>
|
8681
|
-
</xsl:template>
|
8682
|
-
|
8683
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
|
8684
|
-
<xsl:text> edition </xsl:text>
|
8685
|
-
<xsl:value-of select="."/>
|
8686
|
-
</xsl:template>
|
8687
|
-
|
8688
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
|
8689
|
-
<xsl:text> (</xsl:text>
|
8690
|
-
<fo:inline xsl:use-attribute-sets="link-style">
|
8691
|
-
<fo:basic-link external-destination="." fox:alt-text=".">
|
8692
|
-
<xsl:value-of select="."/>
|
8693
|
-
</fo:basic-link>
|
8694
|
-
</fo:inline>
|
8695
|
-
<xsl:text>)</xsl:text>
|
8696
|
-
</xsl:template>
|
8697
|
-
|
8698
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
|
8699
|
-
|
8700
|
-
<xsl:template match="*[local-name() = 'formattedref']">
|
8701
|
-
|
8702
|
-
<xsl:apply-templates/>
|
8723
|
+
<xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
|
8724
|
+
<xsl:text> </xsl:text>
|
8703
8725
|
</xsl:template>
|
8704
8726
|
|
8705
8727
|
<!-- ======================= -->
|
@@ -9125,6 +9147,12 @@
|
|
9125
9147
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
9126
9148
|
<xsl:apply-templates mode="update_xml_step1"/>
|
9127
9149
|
</xsl:template>
|
9150
|
+
<xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
9151
|
+
<xsl:copy>
|
9152
|
+
<xsl:copy-of select="@*"/>
|
9153
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
9154
|
+
</xsl:copy>
|
9155
|
+
</xsl:template>
|
9128
9156
|
<!-- =========================================================================== -->
|
9129
9157
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
9130
9158
|
<!-- =========================================================================== -->
|
@@ -9605,6 +9633,10 @@
|
|
9605
9633
|
<xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
|
9606
9634
|
</xsl:template>
|
9607
9635
|
|
9636
|
+
<xsl:template name="getDocumentId_fromCurrentNode">
|
9637
|
+
<xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
|
9638
|
+
</xsl:template>
|
9639
|
+
|
9608
9640
|
<xsl:template name="namespaceCheck">
|
9609
9641
|
<xsl:variable name="documentNS" select="namespace-uri(/*)"/>
|
9610
9642
|
<xsl:variable name="XSLNS">
|
@@ -571,6 +571,11 @@
|
|
571
571
|
<ref name="MultilingualRenderingType"/>
|
572
572
|
</attribute>
|
573
573
|
</optional>
|
574
|
+
<optional>
|
575
|
+
<attribute name="linenums">
|
576
|
+
<data type="boolean"/>
|
577
|
+
</attribute>
|
578
|
+
</optional>
|
574
579
|
<optional>
|
575
580
|
<ref name="tname"/>
|
576
581
|
</optional>
|
@@ -1238,6 +1243,11 @@
|
|
1238
1243
|
</define>
|
1239
1244
|
<define name="concept">
|
1240
1245
|
<element name="concept">
|
1246
|
+
<optional>
|
1247
|
+
<attribute name="bold">
|
1248
|
+
<data type="boolean"/>
|
1249
|
+
</attribute>
|
1250
|
+
</optional>
|
1241
1251
|
<optional>
|
1242
1252
|
<attribute name="ital">
|
1243
1253
|
<data type="boolean"/>
|
@@ -2653,7 +2663,7 @@
|
|
2653
2663
|
<value>full</value>
|
2654
2664
|
<value>short</value>
|
2655
2665
|
<value>id</value>
|
2656
|
-
<
|
2666
|
+
<text/>
|
2657
2667
|
</choice>
|
2658
2668
|
</define>
|
2659
2669
|
<define name="erefTypeWithConnective">
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-m3aawg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|