metanorma-ogc 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b9e35e003903e7672a0ee7d84881c84b79fa2ad88d4d64874c59f64158d1bac
4
- data.tar.gz: 26720e23bc8f29703580e55d66cef66cf93bc117832c0f10f2e375b61d329ce8
3
+ metadata.gz: 9af69a382e188415e112d83b854c95580a8c0baf68c6c4470bbcbe8e242c253e
4
+ data.tar.gz: 31ebc73dce8e3248b58f147255045b9c59d4a5e927d731774b81bb4c788eeeb4
5
5
  SHA512:
6
- metadata.gz: 14fd6a6cf3778bd7a7ae74dc90f4de5cef10bbec26d105d275b9b5716e4cb5cfb63b6cf14ce692f73a7d621777abdb8a4110b5dad9abc2b268d1f9d3b570a6cd
7
- data.tar.gz: 99fdc7b8ee2f1b86d45df83c980d403f0ad24de15f45537bdb1ccb90fda30ecf169e80bdcf16d46ec68451fce2eddbf1b1a851b3b1b783a98cdef0719eada40f
6
+ metadata.gz: 50d9654f1e5208d90e76b2991c3e228702da1089df1ae4800f268fb3b11a0ce67bb7eb014435c491559a845e2e81ef308c1ae2f3d9de694a0937f9e3cd3e4512
7
+ data.tar.gz: a4e5845363b0c8b4ae286867750cca04f91418ed8477becba552ce9c035e799f0bf024d20e25b9419b50838eb301c89b5511c3b1fa65feeb39149e51685cbe94
@@ -1,5 +1,4 @@
1
1
  require "isodoc"
2
- require_relative "biblio"
3
2
  require_relative "sections"
4
3
  require "fileutils"
5
4
 
@@ -117,7 +116,7 @@ module IsoDoc
117
116
  ret
118
117
  end
119
118
 
120
- def make_tr_attr(cell, row, totalrows, header)
119
+ def make_tr_attr(cell, row, totalrows, header, bordered)
121
120
  ret = super
122
121
  if cell.at("./ancestor::xmlns:table[@class = 'recommendation'] | "\
123
122
  "./ancestor::xmlns:table[@class = 'requirement'] | "\
@@ -926,12 +926,15 @@ a, a:visited {
926
926
 
927
927
  a:hover {
928
928
  color: #00335b;
929
- background: white;
930
- box-shadow: 3px 0 0 white, -3px 0 0 white; }
929
+ background: #39CCCC;
930
+ box-shadow: 3px 0 0 #39CCCC, -3px 0 0 #39CCCC; }
931
931
 
932
- ::selection,
933
- ::-moz-selection {
934
- background: white;
932
+ *::selection {
933
+ background: #39CCCC;
934
+ color: #00335b; }
935
+
936
+ *::-moz-selection {
937
+ background: #39CCCC;
935
938
  color: #00335b; }
936
939
 
937
940
  /* Bibliograhy */
@@ -392,7 +392,7 @@ span.AdmittedLabel {
392
392
 
393
393
  /* Links, selection */
394
394
 
395
- @include elementStyles(#2e81c2, white, #00335b);
395
+ @include elementStyles(#2e81c2, #39CCCC, #00335b);
396
396
 
397
397
 
398
398
  /* Bibliograhy */
@@ -1067,10 +1067,10 @@
1067
1067
  <xsl:call-template name="getLevelTermName"/>
1068
1068
  </xsl:variable>
1069
1069
  <fo:block space-before="36pt" margin-bottom="10pt" keep-with-next="always" role="H{$levelTerm}">
1070
- <fo:list-block color="{$color_blue}" keep-with-next="always" provisional-distance-between-starts="{string-length()*3}mm">
1070
+ <fo:list-block color="{$color_blue}" keep-with-next="always" provisional-distance-between-starts="{string-length()*3.2}mm">
1071
1071
  <fo:list-item>
1072
1072
  <fo:list-item-label end-indent="label-end()">
1073
- <fo:block><fo:inline font-size="18pt" padding-right="1mm"><xsl:apply-templates/></fo:inline></fo:block>
1073
+ <fo:block><fo:inline font-size="18pt"><xsl:apply-templates/></fo:inline></fo:block> <!-- padding-right="1mm" -->
1074
1074
  </fo:list-item-label>
1075
1075
  <fo:list-item-body start-indent="body-start()">
1076
1076
  <fo:block>
@@ -2322,6 +2322,12 @@
2322
2322
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2323
2323
  </xsl:attribute-set>
2324
2324
 
2325
+ <xsl:attribute-set name="figure-block-style">
2326
+
2327
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2328
+
2329
+ </xsl:attribute-set>
2330
+
2325
2331
  <xsl:attribute-set name="figure-style">
2326
2332
 
2327
2333
  </xsl:attribute-set>
@@ -2331,8 +2337,7 @@
2331
2337
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
2332
2338
  <!-- <xsl:attribute name="margin-top">12pt</xsl:attribute> -->
2333
2339
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
2334
- <!-- <xsl:attribute name="margin-bottom">6pt</xsl:attribute> -->
2335
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2340
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
2336
2341
  <!-- <xsl:attribute name="keep-with-next">always</xsl:attribute> -->
2337
2342
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2338
2343
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -3762,6 +3767,10 @@
3762
3767
  <xsl:with-param name="continued">true</xsl:with-param>
3763
3768
  </xsl:apply-templates>
3764
3769
 
3770
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
3771
+ <fo:block/>
3772
+ </xsl:if>
3773
+
3765
3774
  </fo:table-cell>
3766
3775
  </fo:table-row>
3767
3776
  </xsl:template> <!-- table-header-title -->
@@ -4160,7 +4169,22 @@
4160
4169
 
4161
4170
  <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4162
4171
  <xsl:variable name="footnote_inline">
4163
- <fo:inline xsl:use-attribute-sets="fn-num-style">
4172
+ <fo:inline>
4173
+
4174
+ <xsl:variable name="fn_styles">
4175
+ <xsl:choose>
4176
+ <xsl:when test="ancestor::*[local-name() = 'bibitem']">
4177
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
4178
+ </xsl:when>
4179
+ <xsl:otherwise>
4180
+ <fn_styles xsl:use-attribute-sets="fn-num-style"/>
4181
+ </xsl:otherwise>
4182
+ </xsl:choose>
4183
+ </xsl:variable>
4184
+
4185
+ <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
4186
+ <xsl:copy-of select="."/>
4187
+ </xsl:for-each>
4164
4188
 
4165
4189
  <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4166
4190
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
@@ -4224,7 +4248,10 @@
4224
4248
  </xsl:for-each>
4225
4249
  <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']/*">
4226
4250
  <xsl:sort select="@displayorder" data-type="number"/>
4227
- <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[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])]">
4251
+ <!-- commented:
4252
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
4253
+ because 'fn' there is in biblio-tag -->
4254
+ <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])]">
4228
4255
  <!-- copy unique fn -->
4229
4256
  <fn gen_id="{generate-id(.)}">
4230
4257
  <xsl:copy-of select="@*"/>
@@ -5084,7 +5111,7 @@
5084
5111
 
5085
5112
  <xsl:variable name="_font-size">
5086
5113
 
5087
- <!-- 10 -->
5114
+ <!-- inherit -->
5088
5115
 
5089
5116
  <xsl:choose>
5090
5117
  <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
@@ -6057,6 +6084,33 @@
6057
6084
  </xsl:choose>
6058
6085
  </xsl:template>
6059
6086
 
6087
+ <xsl:template name="getLang_fromCurrentNode">
6088
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
6089
+ <xsl:variable name="language">
6090
+ <xsl:choose>
6091
+ <xsl:when test="$language_current != ''">
6092
+ <xsl:value-of select="$language_current"/>
6093
+ </xsl:when>
6094
+ <xsl:otherwise>
6095
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
6096
+ <xsl:choose>
6097
+ <xsl:when test="$language_current_2 != ''">
6098
+ <xsl:value-of select="$language_current_2"/>
6099
+ </xsl:when>
6100
+ <xsl:otherwise>
6101
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
6102
+ </xsl:otherwise>
6103
+ </xsl:choose>
6104
+ </xsl:otherwise>
6105
+ </xsl:choose>
6106
+ </xsl:variable>
6107
+
6108
+ <xsl:choose>
6109
+ <xsl:when test="$language = 'English'">en</xsl:when>
6110
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
6111
+ </xsl:choose>
6112
+ </xsl:template>
6113
+
6060
6114
  <xsl:template name="capitalizeWords">
6061
6115
  <xsl:param name="str"/>
6062
6116
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -6681,7 +6735,7 @@
6681
6735
  <xsl:template match="*[local-name() = 'figure']" name="figure">
6682
6736
  <xsl:variable name="isAdded" select="@added"/>
6683
6737
  <xsl:variable name="isDeleted" select="@deleted"/>
6684
- <fo:block-container id="{@id}">
6738
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6685
6739
 
6686
6740
  <xsl:call-template name="setTrackChangesStyles">
6687
6741
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -7685,7 +7739,13 @@
7685
7739
  </xsl:template>
7686
7740
 
7687
7741
  <xsl:template match="text()" mode="contents_item">
7688
- <xsl:call-template name="keep_together_standard_number"/>
7742
+ <xsl:variable name="text">
7743
+ <!-- to split by '_' and other chars -->
7744
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
7745
+ </xsl:variable>
7746
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
7747
+ <xsl:call-template name="keep_together_standard_number"/>
7748
+ </xsl:for-each>
7689
7749
  </xsl:template>
7690
7750
 
7691
7751
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -7696,39 +7756,57 @@
7696
7756
  <!-- =============== -->
7697
7757
  <!-- sourcecode -->
7698
7758
  <!-- =============== -->
7699
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7700
7759
 
7701
- <xsl:variable name="sourcecode_attributes">
7702
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
7703
- <xsl:variable name="_font-size">
7760
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
7761
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
7762
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
7704
7763
 
7705
- <!-- 9 -->
7764
+ <xsl:template match="*[local-name() = 'property']" mode="css">
7765
+ <xsl:attribute name="{@name}">
7766
+ <xsl:value-of select="@value"/>
7767
+ </xsl:attribute>
7768
+ </xsl:template>
7706
7769
 
7707
- <!-- <xsl:if test="$namespace = 'ieee'">
7708
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
7709
- </xsl:if> -->
7770
+ <xsl:template name="get_sourcecode_attributes">
7771
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
7772
+ <xsl:variable name="_font-size">
7710
7773
 
7711
- <xsl:choose>
7712
- <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
7713
- <xsl:otherwise>9.5</xsl:otherwise>
7714
- </xsl:choose>
7774
+ <!-- inherit -->
7715
7775
 
7716
- </xsl:variable>
7776
+ <!-- <xsl:if test="$namespace = 'ieee'">
7777
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
7778
+ </xsl:if> -->
7717
7779
 
7718
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
7719
- <xsl:if test="$font-size != ''">
7720
- <xsl:attribute name="font-size">
7721
- <xsl:choose>
7722
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
7723
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
7724
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
7725
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
7726
- </xsl:choose>
7727
- </xsl:attribute>
7728
- </xsl:if>
7729
- </xsl:element>
7780
+ <xsl:choose>
7781
+ <xsl:when test="ancestor::*[local-name() = 'table'][not(@type = 'sourcecode')]">8.5</xsl:when>
7782
+ <xsl:otherwise>9.5</xsl:otherwise>
7783
+ </xsl:choose>
7784
+
7785
+ </xsl:variable>
7786
+
7787
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
7788
+ <xsl:if test="$font-size != ''">
7789
+ <xsl:attribute name="font-size">
7790
+ <xsl:choose>
7791
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
7792
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
7793
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
7794
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
7795
+ </xsl:choose>
7796
+ </xsl:attribute>
7797
+ </xsl:if>
7798
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
7799
+ </xsl:element>
7800
+ </xsl:template>
7801
+
7802
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7803
+
7804
+ <xsl:variable name="sourcecode_attributes">
7805
+ <xsl:call-template name="get_sourcecode_attributes"/>
7730
7806
  </xsl:variable>
7731
7807
 
7808
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
7809
+
7732
7810
  <xsl:choose>
7733
7811
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
7734
7812
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -7794,9 +7872,10 @@
7794
7872
  </xsl:choose>
7795
7873
  </xsl:template>
7796
7874
 
7797
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
7875
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
7798
7876
  <xsl:choose>
7799
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
7877
+ <!-- disabled -->
7878
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
7800
7879
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
7801
7880
  <xsl:choose>
7802
7881
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -7811,8 +7890,75 @@
7811
7890
  <xsl:call-template name="add_spaces_to_sourcecode"/>
7812
7891
  </xsl:otherwise>
7813
7892
  </xsl:choose>
7893
+ </xsl:template>
7894
+
7895
+ <!-- add sourcecode highlighting -->
7896
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
7897
+ <xsl:variable name="class" select="@class"/>
7898
+ <xsl:choose>
7899
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
7900
+ <fo:inline>
7901
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
7902
+ <xsl:apply-templates/>
7903
+ </fo:inline>
7904
+ </xsl:when>
7905
+ <xsl:otherwise>
7906
+ <xsl:apply-templates/>
7907
+ </xsl:otherwise>
7908
+ </xsl:choose>
7909
+ </xsl:template>
7910
+
7911
+ <!-- outer table with line numbers for sourcecode -->
7912
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
7913
+ <fo:block>
7914
+ <fo:table width="100%" table-layout="fixed">
7915
+ <xsl:copy-of select="@id"/>
7916
+ <fo:table-column column-width="8%"/>
7917
+ <fo:table-column column-width="92%"/>
7918
+ <fo:table-body>
7919
+ <xsl:apply-templates/>
7920
+ </fo:table-body>
7921
+ </fo:table>
7922
+ </fo:block>
7923
+ </xsl:template>
7924
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
7925
+ <xsl:apply-templates/>
7926
+ </xsl:template>
7927
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
7928
+ <fo:table-row>
7929
+ <xsl:apply-templates/>
7930
+ </fo:table-row>
7931
+ </xsl:template>
7932
+ <!-- first td with line numbers -->
7933
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
7934
+ <fo:table-cell>
7935
+ <fo:block>
7936
+
7937
+ <!-- set attibutes for line numbers - same as sourcecode -->
7938
+ <xsl:variable name="sourcecode_attributes">
7939
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
7940
+ <xsl:call-template name="get_sourcecode_attributes"/>
7941
+ </xsl:for-each>
7942
+ </xsl:variable>
7943
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
7944
+ <xsl:attribute name="{local-name()}">
7945
+ <xsl:value-of select="."/>
7946
+ </xsl:attribute>
7947
+ </xsl:for-each>
7814
7948
 
7949
+ <xsl:apply-templates/>
7950
+ </fo:block>
7951
+ </fo:table-cell>
7815
7952
  </xsl:template>
7953
+ <!-- second td with sourcecode -->
7954
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
7955
+ <fo:table-cell>
7956
+ <fo:block>
7957
+ <xsl:apply-templates/>
7958
+ </fo:block>
7959
+ </fo:table-cell>
7960
+ </xsl:template>
7961
+ <!-- END outer table with line numbers for sourcecode -->
7816
7962
 
7817
7963
  <xsl:template name="add_spaces_to_sourcecode">
7818
7964
  <xsl:variable name="text_step1">
@@ -9514,14 +9660,17 @@
9514
9660
  <fo:block>
9515
9661
  <fo:inline>
9516
9662
 
9517
- <xsl:number format="1." count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
9518
-
9663
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9664
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
9665
+ </xsl:apply-templates>
9519
9666
  </fo:inline>
9520
9667
  </fo:block>
9521
9668
  </fo:list-item-label>
9522
9669
  <fo:list-item-body start-indent="body-start()">
9523
9670
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
9524
- <xsl:call-template name="processBibitem"/>
9671
+ <xsl:call-template name="processBibitem">
9672
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
9673
+ </xsl:call-template>
9525
9674
  </fo:block>
9526
9675
  </fo:list-item-body>
9527
9676
  </fo:list-item>
@@ -9530,166 +9679,51 @@
9530
9679
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9531
9680
 
9532
9681
  <xsl:template name="processBibitem">
9682
+ <xsl:param name="biblio_tag_part">both</xsl:param>
9533
9683
 
9534
- <!-- start OGC bibitem processing -->
9535
- <xsl:if test=".//ogc:fn">
9684
+ <!-- start bibitem processing -->
9685
+ <xsl:if test=".//*[local-name() = 'fn']">
9536
9686
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
9537
9687
  </xsl:if>
9688
+
9689
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9690
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
9691
+ </xsl:apply-templates>
9538
9692
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
9539
- <!-- end OGC bibitem processing-->
9693
+ <!-- end bibitem processing -->
9540
9694
 
9541
9695
  </xsl:template> <!-- processBibitem (bibitem) -->
9542
9696
 
9543
- <xsl:template name="processBibitemDocId">
9544
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
9545
- <xsl:choose>
9546
- <xsl:when test="normalize-space($_doc_ident) != ''">
9547
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
9548
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
9549
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
9550
- </xsl:if> -->
9551
- <xsl:value-of select="$_doc_ident"/>
9552
- </xsl:when>
9553
- <xsl:otherwise>
9554
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
9555
- <xsl:if test="$type != ''">
9556
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
9557
- </xsl:if> -->
9558
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
9559
- </xsl:otherwise>
9560
- </xsl:choose>
9561
- </xsl:template> <!-- processBibitemDocId -->
9697
+ <xsl:template match="*[local-name() = 'title']" mode="title">
9698
+ <fo:inline><xsl:apply-templates/></fo:inline>
9699
+ </xsl:template>
9700
+
9701
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
9702
+
9703
+ <xsl:template match="*[local-name() = 'formattedref']">
9704
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
9705
+ <xsl:text>, </xsl:text>
9706
+ </xsl:if> -->
9707
+ <xsl:apply-templates/>
9708
+ </xsl:template>
9562
9709
 
9563
- <xsl:template name="processPersonalAuthor">
9710
+ <xsl:template match="*[local-name() = 'biblio-tag']">
9711
+ <xsl:param name="biblio_tag_part">both</xsl:param>
9564
9712
  <xsl:choose>
9565
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
9566
- <author>
9567
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
9568
- </author>
9713
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
9714
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
9569
9715
  </xsl:when>
9570
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
9571
- <author>
9572
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
9573
- <xsl:text> </xsl:text>
9574
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
9575
- </author>
9576
- </xsl:when>
9577
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
9578
- <author>
9579
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
9580
- <xsl:text> </xsl:text>
9581
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
9582
- </author>
9716
+ <xsl:when test="$biblio_tag_part = 'last'">
9717
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
9583
9718
  </xsl:when>
9584
9719
  <xsl:otherwise>
9585
9720
  <xsl:apply-templates/>
9586
9721
  </xsl:otherwise>
9587
9722
  </xsl:choose>
9588
- </xsl:template> <!-- processPersonalAuthor -->
9589
-
9590
- <xsl:template name="renderDate">
9591
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
9592
- <xsl:value-of select="*[local-name() = 'on']"/>
9593
- </xsl:if>
9594
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
9595
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
9596
- </xsl:if>
9597
- </xsl:template>
9598
-
9599
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
9600
- <xsl:value-of select="translate(.,'. ','')"/>
9601
- </xsl:template>
9602
-
9603
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
9604
- <xsl:value-of select="substring(.,1,1)"/>
9605
- </xsl:template>
9606
-
9607
- <xsl:template match="*[local-name() = 'title']" mode="title">
9608
- <fo:inline><xsl:apply-templates/></fo:inline>
9609
- </xsl:template>
9610
-
9611
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
9612
- <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
9613
- <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
9614
- <xsl:apply-templates/>
9615
- </fo:inline>
9616
- </xsl:template>
9617
-
9618
- <!-- bibitem/note renders as footnote -->
9619
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
9620
-
9621
- <!-- list of footnotes to calculate actual footnotes number -->
9622
- <xsl:variable name="p_fn_">
9623
- <xsl:call-template name="get_fn_list"/>
9624
- </xsl:variable>
9625
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
9626
- <xsl:variable name="gen_id" select="generate-id(.)"/>
9627
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
9628
- <!-- fn sequence number in document -->
9629
- <xsl:variable name="current_fn_number">
9630
- <xsl:choose>
9631
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
9632
- <xsl:otherwise>
9633
- <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
9634
- <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
9635
- </xsl:otherwise>
9636
- </xsl:choose>
9637
- </xsl:variable>
9638
- <fo:footnote>
9639
- <xsl:variable name="number">
9640
-
9641
- <xsl:choose>
9642
- <xsl:when test="ancestor::*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]">
9643
- <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
9644
- </xsl:when>
9645
- <xsl:otherwise>
9646
- <xsl:value-of select="$current_fn_number"/>
9647
- </xsl:otherwise>
9648
- </xsl:choose>
9649
-
9650
- </xsl:variable>
9651
-
9652
- <xsl:variable name="current_fn_number_text">
9653
- <xsl:value-of select="$number"/>
9654
-
9655
- </xsl:variable>
9656
-
9657
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
9658
- <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
9659
- <xsl:value-of select="$current_fn_number_text"/>
9660
- </fo:basic-link>
9661
- </fo:inline>
9662
- <fo:footnote-body>
9663
- <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
9664
- <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
9665
- <xsl:value-of select="$current_fn_number_text"/>
9666
- </fo:inline>
9667
- <xsl:apply-templates/>
9668
- </fo:block>
9669
- </fo:footnote-body>
9670
- </fo:footnote>
9671
- </xsl:template>
9672
-
9673
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
9674
- <xsl:text> edition </xsl:text>
9675
- <xsl:value-of select="."/>
9676
- </xsl:template>
9677
-
9678
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
9679
- <xsl:text> (</xsl:text>
9680
- <fo:inline xsl:use-attribute-sets="link-style">
9681
- <fo:basic-link external-destination="." fox:alt-text=".">
9682
- <xsl:value-of select="."/>
9683
- </fo:basic-link>
9684
- </fo:inline>
9685
- <xsl:text>)</xsl:text>
9686
9723
  </xsl:template>
9687
9724
 
9688
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
9689
-
9690
- <xsl:template match="*[local-name() = 'formattedref']">
9691
-
9692
- <xsl:apply-templates/>
9725
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
9726
+ <xsl:text> </xsl:text>
9693
9727
  </xsl:template>
9694
9728
 
9695
9729
  <!-- ======================= -->
@@ -10118,6 +10152,12 @@
10118
10152
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10119
10153
  <xsl:apply-templates mode="update_xml_step1"/>
10120
10154
  </xsl:template>
10155
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10156
+ <xsl:copy>
10157
+ <xsl:copy-of select="@*"/>
10158
+ <xsl:apply-templates mode="update_xml_step1"/>
10159
+ </xsl:copy>
10160
+ </xsl:template>
10121
10161
  <!-- =========================================================================== -->
10122
10162
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10123
10163
  <!-- =========================================================================== -->
@@ -10598,6 +10638,10 @@
10598
10638
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
10599
10639
  </xsl:template>
10600
10640
 
10641
+ <xsl:template name="getDocumentId_fromCurrentNode">
10642
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
10643
+ </xsl:template>
10644
+
10601
10645
  <xsl:template name="namespaceCheck">
10602
10646
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
10603
10647
  <xsl:variable name="XSLNS">