metanorma-ieee 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ieee/html_convert.rb +1 -1
- data/lib/isodoc/ieee/ieee.amendment.xsl +225 -207
- data/lib/isodoc/ieee/ieee.standard.xsl +225 -207
- data/lib/isodoc/ieee/presentation_ref.rb +2 -2
- data/lib/isodoc/ieee/presentation_terms.rb +1 -1
- data/lib/isodoc/ieee/word_cleanup.rb +4 -0
- data/lib/metanorma/ieee/isodoc.rng +11 -1
- data/lib/metanorma/ieee/version.rb +1 -1
- data/lib/relaton/render/config.yml +3 -0
- 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: e84f9dd6b6e556837d431e572dbe1bacfaae32997260f02d900b0186a54d01de
|
4
|
+
data.tar.gz: ae742824b749285c825ebe9d4c88d259c318addfe2982ff5ef19211b4937ddad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db667c8dc612dd9f66c20e74cef3488b205fe3fa7c5715993667baedf0694a5fc9bb0d2c68dc3ce9fc308531c34f2a09b584a97103198199136c330cbcd36d7d
|
7
|
+
data.tar.gz: 57354088005c3641e05791bb3a05665d82d1257bd9dd2ae3cdeca56052a4bfd3ea203ef4a91173a9c31ef695eb05cc53b48e5f4b56c415b6374462421d641086
|
@@ -55,7 +55,7 @@ module IsoDoc
|
|
55
55
|
def affiliation_table1(para)
|
56
56
|
ret = "<table><thead>#{para_to_tr(para)}</thead><tbody>"
|
57
57
|
n = para.next_element
|
58
|
-
while n
|
58
|
+
while n&.name == "p" && n["type"] == "officeorgrepmember"
|
59
59
|
n1 = n.next_element
|
60
60
|
ret += para_to_tr(n.remove)
|
61
61
|
n = n1
|
@@ -2108,25 +2108,25 @@
|
|
2108
2108
|
</xsl:copy>
|
2109
2109
|
</xsl:template>
|
2110
2110
|
|
2111
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="flatxml">
|
2111
|
+
<!-- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="flatxml">
|
2112
2112
|
<xsl:variable name="p_fn_">
|
2113
2113
|
<xsl:call-template name="get_fn_list"/>
|
2114
2114
|
</xsl:variable>
|
2115
2115
|
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2116
2116
|
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2117
2117
|
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2118
|
-
<xsl:variable name="reference" select="@reference"/>
|
2118
|
+
<xsl:variable name="reference" select="@reference"/> --><!-- @reference added to bibitem/note in step 'update_xml_step2' -->
|
2119
2119
|
<!-- fn sequence number in document -->
|
2120
|
-
<xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2120
|
+
<!-- <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" />
|
2121
2121
|
<xsl:copy>
|
2122
|
-
<xsl:apply-templates select="@*" mode="flatxml"/>
|
2122
|
+
<xsl:apply-templates select="@*" mode="flatxml"/> -->
|
2123
2123
|
<!-- put actual reference number -->
|
2124
|
-
<xsl:attribute name="current_fn_number">
|
2124
|
+
<!-- <xsl:attribute name="current_fn_number">
|
2125
2125
|
<xsl:value-of select="$current_fn_number"/>
|
2126
2126
|
</xsl:attribute>
|
2127
2127
|
<xsl:apply-templates select="node()" mode="flatxml"/>
|
2128
2128
|
</xsl:copy>
|
2129
|
-
</xsl:template>
|
2129
|
+
</xsl:template> -->
|
2130
2130
|
|
2131
2131
|
<xsl:template match="ieee:p[@type = 'section-title']" priority="3" mode="flatxml">
|
2132
2132
|
<xsl:copy>
|
@@ -4548,6 +4548,12 @@
|
|
4548
4548
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4549
4549
|
</xsl:attribute-set>
|
4550
4550
|
|
4551
|
+
<xsl:attribute-set name="figure-block-style">
|
4552
|
+
|
4553
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
4554
|
+
|
4555
|
+
</xsl:attribute-set>
|
4556
|
+
|
4551
4557
|
<xsl:attribute-set name="figure-style">
|
4552
4558
|
|
4553
4559
|
</xsl:attribute-set>
|
@@ -4558,7 +4564,7 @@
|
|
4558
4564
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4559
4565
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
4560
4566
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
4561
|
-
<xsl:attribute name="
|
4567
|
+
<xsl:attribute name="space-after">6pt</xsl:attribute>
|
4562
4568
|
<xsl:attribute name="keep-with-previous">always</xsl:attribute>
|
4563
4569
|
|
4564
4570
|
</xsl:attribute-set>
|
@@ -6404,7 +6410,22 @@
|
|
6404
6410
|
|
6405
6411
|
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
6406
6412
|
<xsl:variable name="footnote_inline">
|
6407
|
-
<fo:inline
|
6413
|
+
<fo:inline>
|
6414
|
+
|
6415
|
+
<xsl:variable name="fn_styles">
|
6416
|
+
<xsl:choose>
|
6417
|
+
<xsl:when test="ancestor::*[local-name() = 'bibitem']">
|
6418
|
+
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
|
6419
|
+
</xsl:when>
|
6420
|
+
<xsl:otherwise>
|
6421
|
+
<fn_styles xsl:use-attribute-sets="fn-num-style"/>
|
6422
|
+
</xsl:otherwise>
|
6423
|
+
</xsl:choose>
|
6424
|
+
</xsl:variable>
|
6425
|
+
|
6426
|
+
<xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
|
6427
|
+
<xsl:copy-of select="."/>
|
6428
|
+
</xsl:for-each>
|
6408
6429
|
|
6409
6430
|
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
6410
6431
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
@@ -6477,7 +6498,10 @@
|
|
6477
6498
|
</xsl:for-each>
|
6478
6499
|
<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']/*">
|
6479
6500
|
<xsl:sort select="@displayorder" data-type="number"/>
|
6480
|
-
|
6501
|
+
<!-- commented:
|
6502
|
+
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
6503
|
+
because 'fn' there is in biblio-tag -->
|
6504
|
+
<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])]">
|
6481
6505
|
<!-- copy unique fn -->
|
6482
6506
|
<fn gen_id="{generate-id(.)}">
|
6483
6507
|
<xsl:copy-of select="@*"/>
|
@@ -7326,7 +7350,7 @@
|
|
7326
7350
|
|
7327
7351
|
<xsl:variable name="_font-size">
|
7328
7352
|
|
7329
|
-
<!--
|
7353
|
+
<!-- inherit -->
|
7330
7354
|
|
7331
7355
|
</xsl:variable>
|
7332
7356
|
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
@@ -8294,6 +8318,33 @@
|
|
8294
8318
|
</xsl:choose>
|
8295
8319
|
</xsl:template>
|
8296
8320
|
|
8321
|
+
<xsl:template name="getLang_fromCurrentNode">
|
8322
|
+
<xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
8323
|
+
<xsl:variable name="language">
|
8324
|
+
<xsl:choose>
|
8325
|
+
<xsl:when test="$language_current != ''">
|
8326
|
+
<xsl:value-of select="$language_current"/>
|
8327
|
+
</xsl:when>
|
8328
|
+
<xsl:otherwise>
|
8329
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
8330
|
+
<xsl:choose>
|
8331
|
+
<xsl:when test="$language_current_2 != ''">
|
8332
|
+
<xsl:value-of select="$language_current_2"/>
|
8333
|
+
</xsl:when>
|
8334
|
+
<xsl:otherwise>
|
8335
|
+
<xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
|
8336
|
+
</xsl:otherwise>
|
8337
|
+
</xsl:choose>
|
8338
|
+
</xsl:otherwise>
|
8339
|
+
</xsl:choose>
|
8340
|
+
</xsl:variable>
|
8341
|
+
|
8342
|
+
<xsl:choose>
|
8343
|
+
<xsl:when test="$language = 'English'">en</xsl:when>
|
8344
|
+
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
8345
|
+
</xsl:choose>
|
8346
|
+
</xsl:template>
|
8347
|
+
|
8297
8348
|
<xsl:template name="capitalizeWords">
|
8298
8349
|
<xsl:param name="str"/>
|
8299
8350
|
<xsl:variable name="str2" select="translate($str, '-', ' ')"/>
|
@@ -8928,7 +8979,7 @@
|
|
8928
8979
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
8929
8980
|
<xsl:variable name="isAdded" select="@added"/>
|
8930
8981
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
8931
|
-
<fo:block-container id="{@id}">
|
8982
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
8932
8983
|
|
8933
8984
|
<xsl:call-template name="setTrackChangesStyles">
|
8934
8985
|
<xsl:with-param name="isAdded" select="$isAdded"/>
|
@@ -9919,7 +9970,13 @@
|
|
9919
9970
|
</xsl:template>
|
9920
9971
|
|
9921
9972
|
<xsl:template match="text()" mode="contents_item">
|
9922
|
-
<xsl:
|
9973
|
+
<xsl:variable name="text">
|
9974
|
+
<!-- to split by '_' and other chars -->
|
9975
|
+
<text><xsl:call-template name="add-zero-spaces-java"/></text>
|
9976
|
+
</xsl:variable>
|
9977
|
+
<xsl:for-each select="xalan:nodeset($text)/text/text()">
|
9978
|
+
<xsl:call-template name="keep_together_standard_number"/>
|
9979
|
+
</xsl:for-each>
|
9923
9980
|
</xsl:template>
|
9924
9981
|
|
9925
9982
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
@@ -9930,34 +9987,52 @@
|
|
9930
9987
|
<!-- =============== -->
|
9931
9988
|
<!-- sourcecode -->
|
9932
9989
|
<!-- =============== -->
|
9933
|
-
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
9934
9990
|
|
9935
|
-
|
9936
|
-
|
9937
|
-
|
9991
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
|
9992
|
+
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
9993
|
+
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
9938
9994
|
|
9939
|
-
|
9995
|
+
<xsl:template match="*[local-name() = 'property']" mode="css">
|
9996
|
+
<xsl:attribute name="{@name}">
|
9997
|
+
<xsl:value-of select="@value"/>
|
9998
|
+
</xsl:attribute>
|
9999
|
+
</xsl:template>
|
9940
10000
|
|
9941
|
-
|
9942
|
-
|
9943
|
-
|
10001
|
+
<xsl:template name="get_sourcecode_attributes">
|
10002
|
+
<xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
|
10003
|
+
<xsl:variable name="_font-size">
|
9944
10004
|
|
9945
|
-
|
10005
|
+
<!-- inherit -->
|
9946
10006
|
|
9947
|
-
<xsl:
|
9948
|
-
|
9949
|
-
|
9950
|
-
|
9951
|
-
|
9952
|
-
|
9953
|
-
|
9954
|
-
|
9955
|
-
|
9956
|
-
|
9957
|
-
|
9958
|
-
|
10007
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
10008
|
+
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
10009
|
+
</xsl:if> -->
|
10010
|
+
|
10011
|
+
</xsl:variable>
|
10012
|
+
|
10013
|
+
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
10014
|
+
<xsl:if test="$font-size != ''">
|
10015
|
+
<xsl:attribute name="font-size">
|
10016
|
+
<xsl:choose>
|
10017
|
+
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
10018
|
+
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
10019
|
+
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
10020
|
+
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
10021
|
+
</xsl:choose>
|
10022
|
+
</xsl:attribute>
|
10023
|
+
</xsl:if>
|
10024
|
+
<xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
|
10025
|
+
</xsl:element>
|
10026
|
+
</xsl:template>
|
10027
|
+
|
10028
|
+
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
10029
|
+
|
10030
|
+
<xsl:variable name="sourcecode_attributes">
|
10031
|
+
<xsl:call-template name="get_sourcecode_attributes"/>
|
9959
10032
|
</xsl:variable>
|
9960
10033
|
|
10034
|
+
<!-- <xsl:copy-of select="$sourcecode_css"/> -->
|
10035
|
+
|
9961
10036
|
<xsl:choose>
|
9962
10037
|
<xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
|
9963
10038
|
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
@@ -10011,9 +10086,10 @@
|
|
10011
10086
|
</xsl:choose>
|
10012
10087
|
</xsl:template>
|
10013
10088
|
|
10014
|
-
<xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
10089
|
+
<xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
|
10015
10090
|
<xsl:choose>
|
10016
|
-
|
10091
|
+
<!-- disabled -->
|
10092
|
+
<xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
|
10017
10093
|
<xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
|
10018
10094
|
<xsl:choose>
|
10019
10095
|
<xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
|
@@ -10028,8 +10104,75 @@
|
|
10028
10104
|
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
10029
10105
|
</xsl:otherwise>
|
10030
10106
|
</xsl:choose>
|
10107
|
+
</xsl:template>
|
10108
|
+
|
10109
|
+
<!-- add sourcecode highlighting -->
|
10110
|
+
<xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
|
10111
|
+
<xsl:variable name="class" select="@class"/>
|
10112
|
+
<xsl:choose>
|
10113
|
+
<xsl:when test="$sourcecode_css//class[@name = $class]">
|
10114
|
+
<fo:inline>
|
10115
|
+
<xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
|
10116
|
+
<xsl:apply-templates/>
|
10117
|
+
</fo:inline>
|
10118
|
+
</xsl:when>
|
10119
|
+
<xsl:otherwise>
|
10120
|
+
<xsl:apply-templates/>
|
10121
|
+
</xsl:otherwise>
|
10122
|
+
</xsl:choose>
|
10123
|
+
</xsl:template>
|
10124
|
+
|
10125
|
+
<!-- outer table with line numbers for sourcecode -->
|
10126
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
|
10127
|
+
<fo:block>
|
10128
|
+
<fo:table width="100%" table-layout="fixed">
|
10129
|
+
<xsl:copy-of select="@id"/>
|
10130
|
+
<fo:table-column column-width="8%"/>
|
10131
|
+
<fo:table-column column-width="92%"/>
|
10132
|
+
<fo:table-body>
|
10133
|
+
<xsl:apply-templates/>
|
10134
|
+
</fo:table-body>
|
10135
|
+
</fo:table>
|
10136
|
+
</fo:block>
|
10137
|
+
</xsl:template>
|
10138
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
|
10139
|
+
<xsl:apply-templates/>
|
10140
|
+
</xsl:template>
|
10141
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
|
10142
|
+
<fo:table-row>
|
10143
|
+
<xsl:apply-templates/>
|
10144
|
+
</fo:table-row>
|
10145
|
+
</xsl:template>
|
10146
|
+
<!-- first td with line numbers -->
|
10147
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
|
10148
|
+
<fo:table-cell>
|
10149
|
+
<fo:block>
|
10150
|
+
|
10151
|
+
<!-- set attibutes for line numbers - same as sourcecode -->
|
10152
|
+
<xsl:variable name="sourcecode_attributes">
|
10153
|
+
<xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
|
10154
|
+
<xsl:call-template name="get_sourcecode_attributes"/>
|
10155
|
+
</xsl:for-each>
|
10156
|
+
</xsl:variable>
|
10157
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
|
10158
|
+
<xsl:attribute name="{local-name()}">
|
10159
|
+
<xsl:value-of select="."/>
|
10160
|
+
</xsl:attribute>
|
10161
|
+
</xsl:for-each>
|
10031
10162
|
|
10163
|
+
<xsl:apply-templates/>
|
10164
|
+
</fo:block>
|
10165
|
+
</fo:table-cell>
|
10166
|
+
</xsl:template>
|
10167
|
+
<!-- second td with sourcecode -->
|
10168
|
+
<xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
|
10169
|
+
<fo:table-cell>
|
10170
|
+
<fo:block>
|
10171
|
+
<xsl:apply-templates/>
|
10172
|
+
</fo:block>
|
10173
|
+
</fo:table-cell>
|
10032
10174
|
</xsl:template>
|
10175
|
+
<!-- END outer table with line numbers for sourcecode -->
|
10033
10176
|
|
10034
10177
|
<xsl:template name="add_spaces_to_sourcecode">
|
10035
10178
|
<xsl:variable name="text_step1">
|
@@ -11724,31 +11867,21 @@
|
|
11724
11867
|
<fo:block>
|
11725
11868
|
<fo:inline>
|
11726
11869
|
|
11727
|
-
|
11728
|
-
<xsl:
|
11729
|
-
|
11730
|
-
<xsl:when test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report')">
|
11731
|
-
<fo:inline color="{$color_blue}">
|
11732
|
-
<xsl:text>[ </xsl:text>
|
11733
|
-
<xsl:number format="1" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
|
11734
|
-
<xsl:text> ]</xsl:text>
|
11735
|
-
</fo:inline>
|
11736
|
-
</xsl:when>
|
11737
|
-
<xsl:otherwise>
|
11738
|
-
<xsl:text>[B</xsl:text>
|
11739
|
-
<xsl:number format="1" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
|
11740
|
-
<xsl:text>]</xsl:text>
|
11741
|
-
</xsl:otherwise>
|
11742
|
-
</xsl:choose>
|
11743
|
-
</xsl:if>
|
11744
|
-
<!-- ieee -->
|
11870
|
+
<xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report')">
|
11871
|
+
<xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
|
11872
|
+
</xsl:if>
|
11745
11873
|
|
11874
|
+
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
|
11875
|
+
<xsl:with-param name="biblio_tag_part">first</xsl:with-param>
|
11876
|
+
</xsl:apply-templates>
|
11746
11877
|
</fo:inline>
|
11747
11878
|
</fo:block>
|
11748
11879
|
</fo:list-item-label>
|
11749
11880
|
<fo:list-item-body start-indent="body-start()">
|
11750
11881
|
<fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
|
11751
|
-
<xsl:call-template name="processBibitem"
|
11882
|
+
<xsl:call-template name="processBibitem">
|
11883
|
+
<xsl:with-param name="biblio_tag_part">last</xsl:with-param>
|
11884
|
+
</xsl:call-template>
|
11752
11885
|
</fo:block>
|
11753
11886
|
</fo:list-item-body>
|
11754
11887
|
</fo:list-item>
|
@@ -11757,176 +11890,51 @@
|
|
11757
11890
|
</xsl:template> <!-- references[not(@normative='true')]/bibitem -->
|
11758
11891
|
|
11759
11892
|
<xsl:template name="processBibitem">
|
11893
|
+
<xsl:param name="biblio_tag_part">both</xsl:param>
|
11760
11894
|
|
11761
11895
|
<!-- start bibitem processing -->
|
11762
11896
|
<xsl:if test=".//*[local-name() = 'fn']">
|
11763
11897
|
<xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
|
11764
11898
|
</xsl:if>
|
11765
11899
|
|
11766
|
-
|
11767
|
-
|
11768
|
-
|
11769
|
-
<xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
|
11770
|
-
<xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
|
11771
|
-
</xsl:choose>
|
11772
|
-
</xsl:variable>
|
11773
|
-
<xsl:value-of select="$docidentifier"/>
|
11774
|
-
|
11775
|
-
<xsl:apply-templates select="*[local-name() = 'note']"/>
|
11776
|
-
|
11777
|
-
<xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
|
11778
|
-
<xsl:text>,</xsl:text>
|
11779
|
-
<xsl:text> </xsl:text>
|
11780
|
-
</xsl:if>
|
11781
|
-
|
11900
|
+
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
|
11901
|
+
<xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
|
11902
|
+
</xsl:apply-templates>
|
11782
11903
|
<xsl:apply-templates select="*[local-name() = 'formattedref']"/>
|
11783
11904
|
<!-- end bibitem processing -->
|
11784
11905
|
|
11785
11906
|
</xsl:template> <!-- processBibitem (bibitem) -->
|
11786
11907
|
|
11787
|
-
<xsl:template name="
|
11788
|
-
<xsl:
|
11789
|
-
|
11790
|
-
|
11791
|
-
|
11792
|
-
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
11793
|
-
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
11794
|
-
</xsl:if> -->
|
11795
|
-
<xsl:value-of select="$_doc_ident"/>
|
11796
|
-
</xsl:when>
|
11797
|
-
<xsl:otherwise>
|
11798
|
-
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
11799
|
-
<xsl:if test="$type != ''">
|
11800
|
-
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
11801
|
-
</xsl:if> -->
|
11802
|
-
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
|
11803
|
-
</xsl:otherwise>
|
11804
|
-
</xsl:choose>
|
11805
|
-
</xsl:template> <!-- processBibitemDocId -->
|
11908
|
+
<xsl:template match="*[local-name() = 'title']" mode="title">
|
11909
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
11910
|
+
</xsl:template>
|
11911
|
+
|
11912
|
+
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
|
11806
11913
|
|
11807
|
-
<xsl:template name="
|
11914
|
+
<xsl:template match="*[local-name() = 'formattedref']">
|
11915
|
+
<!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
|
11916
|
+
<xsl:text>, </xsl:text>
|
11917
|
+
</xsl:if> -->
|
11918
|
+
<xsl:apply-templates/>
|
11919
|
+
</xsl:template>
|
11920
|
+
|
11921
|
+
<xsl:template match="*[local-name() = 'biblio-tag']">
|
11922
|
+
<xsl:param name="biblio_tag_part">both</xsl:param>
|
11808
11923
|
<xsl:choose>
|
11809
|
-
<xsl:when test="
|
11810
|
-
<
|
11811
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
|
11812
|
-
</author>
|
11924
|
+
<xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
|
11925
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
11813
11926
|
</xsl:when>
|
11814
|
-
<xsl:when test="
|
11815
|
-
<
|
11816
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
|
11817
|
-
<xsl:text> </xsl:text>
|
11818
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
|
11819
|
-
</author>
|
11820
|
-
</xsl:when>
|
11821
|
-
<xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
|
11822
|
-
<author>
|
11823
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
|
11824
|
-
<xsl:text> </xsl:text>
|
11825
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
|
11826
|
-
</author>
|
11927
|
+
<xsl:when test="$biblio_tag_part = 'last'">
|
11928
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
11827
11929
|
</xsl:when>
|
11828
11930
|
<xsl:otherwise>
|
11829
11931
|
<xsl:apply-templates/>
|
11830
11932
|
</xsl:otherwise>
|
11831
11933
|
</xsl:choose>
|
11832
|
-
</xsl:template> <!-- processPersonalAuthor -->
|
11833
|
-
|
11834
|
-
<xsl:template name="renderDate">
|
11835
|
-
<xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
|
11836
|
-
<xsl:value-of select="*[local-name() = 'on']"/>
|
11837
|
-
</xsl:if>
|
11838
|
-
<xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
|
11839
|
-
<xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
|
11840
|
-
</xsl:if>
|
11841
|
-
</xsl:template>
|
11842
|
-
|
11843
|
-
<xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
|
11844
|
-
<xsl:value-of select="translate(.,'. ','')"/>
|
11845
|
-
</xsl:template>
|
11846
|
-
|
11847
|
-
<xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
11848
|
-
<xsl:value-of select="substring(.,1,1)"/>
|
11849
|
-
</xsl:template>
|
11850
|
-
|
11851
|
-
<xsl:template match="*[local-name() = 'title']" mode="title">
|
11852
|
-
<fo:inline><xsl:apply-templates/></fo:inline>
|
11853
|
-
</xsl:template>
|
11854
|
-
|
11855
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
|
11856
|
-
<!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
|
11857
|
-
<fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
|
11858
|
-
<xsl:apply-templates/>
|
11859
|
-
</fo:inline>
|
11860
|
-
</xsl:template>
|
11861
|
-
|
11862
|
-
<!-- bibitem/note renders as footnote -->
|
11863
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
|
11864
|
-
|
11865
|
-
<!-- list of footnotes to calculate actual footnotes number -->
|
11866
|
-
<xsl:variable name="p_fn_">
|
11867
|
-
<xsl:call-template name="get_fn_list"/>
|
11868
|
-
</xsl:variable>
|
11869
|
-
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
11870
|
-
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
11871
|
-
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
11872
|
-
<!-- fn sequence number in document -->
|
11873
|
-
<xsl:variable name="current_fn_number">
|
11874
|
-
<xsl:choose>
|
11875
|
-
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
11876
|
-
<xsl:otherwise>
|
11877
|
-
<!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
|
11878
|
-
<xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
|
11879
|
-
</xsl:otherwise>
|
11880
|
-
</xsl:choose>
|
11881
|
-
</xsl:variable>
|
11882
|
-
<fo:footnote>
|
11883
|
-
<xsl:variable name="number">
|
11884
|
-
|
11885
|
-
<xsl:value-of select="$current_fn_number"/>
|
11886
|
-
|
11887
|
-
</xsl:variable>
|
11888
|
-
|
11889
|
-
<xsl:variable name="current_fn_number_text">
|
11890
|
-
<xsl:value-of select="$number"/>
|
11891
|
-
|
11892
|
-
</xsl:variable>
|
11893
|
-
|
11894
|
-
<fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
|
11895
|
-
<fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
|
11896
|
-
<xsl:value-of select="$current_fn_number_text"/>
|
11897
|
-
</fo:basic-link>
|
11898
|
-
</fo:inline>
|
11899
|
-
<fo:footnote-body>
|
11900
|
-
<fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
|
11901
|
-
<fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
|
11902
|
-
<xsl:value-of select="$current_fn_number_text"/>
|
11903
|
-
</fo:inline>
|
11904
|
-
<xsl:apply-templates/>
|
11905
|
-
</fo:block>
|
11906
|
-
</fo:footnote-body>
|
11907
|
-
</fo:footnote>
|
11908
|
-
</xsl:template>
|
11909
|
-
|
11910
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
|
11911
|
-
<xsl:text> edition </xsl:text>
|
11912
|
-
<xsl:value-of select="."/>
|
11913
11934
|
</xsl:template>
|
11914
11935
|
|
11915
|
-
<xsl:template match="*[local-name() = '
|
11916
|
-
<xsl:text>
|
11917
|
-
<fo:inline xsl:use-attribute-sets="link-style">
|
11918
|
-
<fo:basic-link external-destination="." fox:alt-text=".">
|
11919
|
-
<xsl:value-of select="."/>
|
11920
|
-
</fo:basic-link>
|
11921
|
-
</fo:inline>
|
11922
|
-
<xsl:text>)</xsl:text>
|
11923
|
-
</xsl:template>
|
11924
|
-
|
11925
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
|
11926
|
-
|
11927
|
-
<xsl:template match="*[local-name() = 'formattedref']">
|
11928
|
-
|
11929
|
-
<xsl:apply-templates/>
|
11936
|
+
<xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
|
11937
|
+
<xsl:text> </xsl:text>
|
11930
11938
|
</xsl:template>
|
11931
11939
|
|
11932
11940
|
<!-- ======================= -->
|
@@ -12393,6 +12401,12 @@
|
|
12393
12401
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
12394
12402
|
<xsl:apply-templates mode="update_xml_step1"/>
|
12395
12403
|
</xsl:template>
|
12404
|
+
<xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
12405
|
+
<xsl:copy>
|
12406
|
+
<xsl:copy-of select="@*"/>
|
12407
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12408
|
+
</xsl:copy>
|
12409
|
+
</xsl:template>
|
12396
12410
|
<!-- =========================================================================== -->
|
12397
12411
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12398
12412
|
<!-- =========================================================================== -->
|
@@ -12466,17 +12480,17 @@
|
|
12466
12480
|
</xsl:template>
|
12467
12481
|
|
12468
12482
|
<!-- add @reference for bibitem/note, similar to fn/reference -->
|
12469
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="update_xml_step2">
|
12483
|
+
<!-- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="update_xml_step2">
|
12470
12484
|
<xsl:copy>
|
12471
12485
|
<xsl:apply-templates select="@*" mode="update_xml_step2"/>
|
12472
|
-
|
12486
|
+
|
12473
12487
|
<xsl:attribute name="reference">
|
12474
12488
|
<xsl:value-of select="concat('bibitem_', ../@id, '_', count(preceding-sibling::*[local-name() = 'note']))"/>
|
12475
12489
|
</xsl:attribute>
|
12476
|
-
|
12490
|
+
|
12477
12491
|
<xsl:apply-templates select="node()" mode="update_xml_step2"/>
|
12478
12492
|
</xsl:copy>
|
12479
|
-
</xsl:template>
|
12493
|
+
</xsl:template> -->
|
12480
12494
|
|
12481
12495
|
<!-- enclose sequence of 'char x' + 'combining char y' to <lang_none>xy</lang_none> -->
|
12482
12496
|
<xsl:variable name="regex_combining_chars">(.[̀-ͯ])</xsl:variable>
|
@@ -12971,6 +12985,10 @@
|
|
12971
12985
|
<xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
|
12972
12986
|
</xsl:template>
|
12973
12987
|
|
12988
|
+
<xsl:template name="getDocumentId_fromCurrentNode">
|
12989
|
+
<xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
|
12990
|
+
</xsl:template>
|
12991
|
+
|
12974
12992
|
<xsl:template name="namespaceCheck">
|
12975
12993
|
<xsl:variable name="documentNS" select="namespace-uri(/*)"/>
|
12976
12994
|
<xsl:variable name="XSLNS">
|