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.
@@ -1505,6 +1505,12 @@
1505
1505
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1506
1506
  </xsl:attribute-set>
1507
1507
 
1508
+ <xsl:attribute-set name="figure-block-style">
1509
+
1510
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1511
+
1512
+ </xsl:attribute-set>
1513
+
1508
1514
  <xsl:attribute-set name="figure-style">
1509
1515
 
1510
1516
  </xsl:attribute-set>
@@ -1517,7 +1523,7 @@
1517
1523
  <xsl:attribute name="font-weight">normal</xsl:attribute>
1518
1524
  <xsl:attribute name="font-style">italic</xsl:attribute>
1519
1525
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
1520
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1526
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1521
1527
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1522
1528
 
1523
1529
  </xsl:attribute-set>
@@ -2962,6 +2968,10 @@
2962
2968
  <xsl:with-param name="continued">true</xsl:with-param>
2963
2969
  </xsl:apply-templates>
2964
2970
 
2971
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
2972
+ <fo:block/>
2973
+ </xsl:if>
2974
+
2965
2975
  </fo:table-cell>
2966
2976
  </fo:table-row>
2967
2977
  </xsl:template> <!-- table-header-title -->
@@ -3346,7 +3356,22 @@
3346
3356
 
3347
3357
  <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3348
3358
  <xsl:variable name="footnote_inline">
3349
- <fo:inline xsl:use-attribute-sets="fn-num-style">
3359
+ <fo:inline>
3360
+
3361
+ <xsl:variable name="fn_styles">
3362
+ <xsl:choose>
3363
+ <xsl:when test="ancestor::*[local-name() = 'bibitem']">
3364
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
3365
+ </xsl:when>
3366
+ <xsl:otherwise>
3367
+ <fn_styles xsl:use-attribute-sets="fn-num-style"/>
3368
+ </xsl:otherwise>
3369
+ </xsl:choose>
3370
+ </xsl:variable>
3371
+
3372
+ <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
3373
+ <xsl:copy-of select="."/>
3374
+ </xsl:for-each>
3350
3375
 
3351
3376
  <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
3352
3377
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
@@ -3410,7 +3435,10 @@
3410
3435
  </xsl:for-each>
3411
3436
  <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']/*">
3412
3437
  <xsl:sort select="@displayorder" data-type="number"/>
3413
- <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])]">
3438
+ <!-- commented:
3439
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3440
+ because 'fn' there is in biblio-tag -->
3441
+ <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])]">
3414
3442
  <!-- copy unique fn -->
3415
3443
  <fn gen_id="{generate-id(.)}">
3416
3444
  <xsl:copy-of select="@*"/>
@@ -4270,7 +4298,7 @@
4270
4298
 
4271
4299
  <xsl:variable name="_font-size">
4272
4300
 
4273
- <!-- 10 -->
4301
+ <!-- inherit -->
4274
4302
 
4275
4303
  <xsl:choose>
4276
4304
  <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
@@ -5243,6 +5271,33 @@
5243
5271
  </xsl:choose>
5244
5272
  </xsl:template>
5245
5273
 
5274
+ <xsl:template name="getLang_fromCurrentNode">
5275
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5276
+ <xsl:variable name="language">
5277
+ <xsl:choose>
5278
+ <xsl:when test="$language_current != ''">
5279
+ <xsl:value-of select="$language_current"/>
5280
+ </xsl:when>
5281
+ <xsl:otherwise>
5282
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5283
+ <xsl:choose>
5284
+ <xsl:when test="$language_current_2 != ''">
5285
+ <xsl:value-of select="$language_current_2"/>
5286
+ </xsl:when>
5287
+ <xsl:otherwise>
5288
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
5289
+ </xsl:otherwise>
5290
+ </xsl:choose>
5291
+ </xsl:otherwise>
5292
+ </xsl:choose>
5293
+ </xsl:variable>
5294
+
5295
+ <xsl:choose>
5296
+ <xsl:when test="$language = 'English'">en</xsl:when>
5297
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
5298
+ </xsl:choose>
5299
+ </xsl:template>
5300
+
5246
5301
  <xsl:template name="capitalizeWords">
5247
5302
  <xsl:param name="str"/>
5248
5303
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -5863,7 +5918,7 @@
5863
5918
  <xsl:template match="*[local-name() = 'figure']" name="figure">
5864
5919
  <xsl:variable name="isAdded" select="@added"/>
5865
5920
  <xsl:variable name="isDeleted" select="@deleted"/>
5866
- <fo:block-container id="{@id}">
5921
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
5867
5922
 
5868
5923
  <xsl:call-template name="setTrackChangesStyles">
5869
5924
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -6844,7 +6899,13 @@
6844
6899
  </xsl:template>
6845
6900
 
6846
6901
  <xsl:template match="text()" mode="contents_item">
6847
- <xsl:call-template name="keep_together_standard_number"/>
6902
+ <xsl:variable name="text">
6903
+ <!-- to split by '_' and other chars -->
6904
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
6905
+ </xsl:variable>
6906
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
6907
+ <xsl:call-template name="keep_together_standard_number"/>
6908
+ </xsl:for-each>
6848
6909
  </xsl:template>
6849
6910
 
6850
6911
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -6855,39 +6916,57 @@
6855
6916
  <!-- =============== -->
6856
6917
  <!-- sourcecode -->
6857
6918
  <!-- =============== -->
6858
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6859
6919
 
6860
- <xsl:variable name="sourcecode_attributes">
6861
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6862
- <xsl:variable name="_font-size">
6920
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
6921
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
6922
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
6863
6923
 
6864
- <!-- 9 -->
6924
+ <xsl:template match="*[local-name() = 'property']" mode="css">
6925
+ <xsl:attribute name="{@name}">
6926
+ <xsl:value-of select="@value"/>
6927
+ </xsl:attribute>
6928
+ </xsl:template>
6865
6929
 
6866
- <!-- <xsl:if test="$namespace = 'ieee'">
6867
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
6868
- </xsl:if> -->
6930
+ <xsl:template name="get_sourcecode_attributes">
6931
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6932
+ <xsl:variable name="_font-size">
6869
6933
 
6870
- <xsl:choose>
6871
- <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
6872
- <xsl:otherwise>9.5</xsl:otherwise>
6873
- </xsl:choose>
6934
+ <!-- inherit -->
6874
6935
 
6875
- </xsl:variable>
6936
+ <!-- <xsl:if test="$namespace = 'ieee'">
6937
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
6938
+ </xsl:if> -->
6876
6939
 
6877
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6878
- <xsl:if test="$font-size != ''">
6879
- <xsl:attribute name="font-size">
6880
- <xsl:choose>
6881
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6882
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6883
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6884
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6885
- </xsl:choose>
6886
- </xsl:attribute>
6887
- </xsl:if>
6888
- </xsl:element>
6940
+ <xsl:choose>
6941
+ <xsl:when test="ancestor::*[local-name() = 'table'][not(@type = 'sourcecode')]">8.5</xsl:when>
6942
+ <xsl:otherwise>9.5</xsl:otherwise>
6943
+ </xsl:choose>
6944
+
6945
+ </xsl:variable>
6946
+
6947
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6948
+ <xsl:if test="$font-size != ''">
6949
+ <xsl:attribute name="font-size">
6950
+ <xsl:choose>
6951
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6952
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6953
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6954
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6955
+ </xsl:choose>
6956
+ </xsl:attribute>
6957
+ </xsl:if>
6958
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
6959
+ </xsl:element>
6960
+ </xsl:template>
6961
+
6962
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6963
+
6964
+ <xsl:variable name="sourcecode_attributes">
6965
+ <xsl:call-template name="get_sourcecode_attributes"/>
6889
6966
  </xsl:variable>
6890
6967
 
6968
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
6969
+
6891
6970
  <xsl:choose>
6892
6971
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
6893
6972
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -6941,9 +7020,10 @@
6941
7020
  </xsl:choose>
6942
7021
  </xsl:template>
6943
7022
 
6944
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
7023
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
6945
7024
  <xsl:choose>
6946
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
7025
+ <!-- disabled -->
7026
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6947
7027
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
6948
7028
  <xsl:choose>
6949
7029
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -6958,8 +7038,75 @@
6958
7038
  <xsl:call-template name="add_spaces_to_sourcecode"/>
6959
7039
  </xsl:otherwise>
6960
7040
  </xsl:choose>
7041
+ </xsl:template>
7042
+
7043
+ <!-- add sourcecode highlighting -->
7044
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
7045
+ <xsl:variable name="class" select="@class"/>
7046
+ <xsl:choose>
7047
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
7048
+ <fo:inline>
7049
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
7050
+ <xsl:apply-templates/>
7051
+ </fo:inline>
7052
+ </xsl:when>
7053
+ <xsl:otherwise>
7054
+ <xsl:apply-templates/>
7055
+ </xsl:otherwise>
7056
+ </xsl:choose>
7057
+ </xsl:template>
7058
+
7059
+ <!-- outer table with line numbers for sourcecode -->
7060
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
7061
+ <fo:block>
7062
+ <fo:table width="100%" table-layout="fixed">
7063
+ <xsl:copy-of select="@id"/>
7064
+ <fo:table-column column-width="8%"/>
7065
+ <fo:table-column column-width="92%"/>
7066
+ <fo:table-body>
7067
+ <xsl:apply-templates/>
7068
+ </fo:table-body>
7069
+ </fo:table>
7070
+ </fo:block>
7071
+ </xsl:template>
7072
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
7073
+ <xsl:apply-templates/>
7074
+ </xsl:template>
7075
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
7076
+ <fo:table-row>
7077
+ <xsl:apply-templates/>
7078
+ </fo:table-row>
7079
+ </xsl:template>
7080
+ <!-- first td with line numbers -->
7081
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
7082
+ <fo:table-cell>
7083
+ <fo:block>
7084
+
7085
+ <!-- set attibutes for line numbers - same as sourcecode -->
7086
+ <xsl:variable name="sourcecode_attributes">
7087
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
7088
+ <xsl:call-template name="get_sourcecode_attributes"/>
7089
+ </xsl:for-each>
7090
+ </xsl:variable>
7091
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
7092
+ <xsl:attribute name="{local-name()}">
7093
+ <xsl:value-of select="."/>
7094
+ </xsl:attribute>
7095
+ </xsl:for-each>
6961
7096
 
7097
+ <xsl:apply-templates/>
7098
+ </fo:block>
7099
+ </fo:table-cell>
6962
7100
  </xsl:template>
7101
+ <!-- second td with sourcecode -->
7102
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
7103
+ <fo:table-cell>
7104
+ <fo:block>
7105
+ <xsl:apply-templates/>
7106
+ </fo:block>
7107
+ </fo:table-cell>
7108
+ </xsl:template>
7109
+ <!-- END outer table with line numbers for sourcecode -->
6963
7110
 
6964
7111
  <xsl:template name="add_spaces_to_sourcecode">
6965
7112
  <xsl:variable name="text_step1">
@@ -8665,17 +8812,17 @@
8665
8812
  <fo:block>
8666
8813
  <fo:inline>
8667
8814
 
8668
- <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
8669
- <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
8670
- <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
8671
- </xsl:if>
8672
-
8815
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8816
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
8817
+ </xsl:apply-templates>
8673
8818
  </fo:inline>
8674
8819
  </fo:block>
8675
8820
  </fo:list-item-label>
8676
8821
  <fo:list-item-body start-indent="body-start()">
8677
8822
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
8678
- <xsl:call-template name="processBibitem"/>
8823
+ <xsl:call-template name="processBibitem">
8824
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
8825
+ </xsl:call-template>
8679
8826
  </fo:block>
8680
8827
  </fo:list-item-body>
8681
8828
  </fo:list-item>
@@ -8684,166 +8831,51 @@
8684
8831
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
8685
8832
 
8686
8833
  <xsl:template name="processBibitem">
8834
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8687
8835
 
8688
- <!-- start OGC bibitem processing -->
8689
- <xsl:if test=".//ogc:fn">
8836
+ <!-- start bibitem processing -->
8837
+ <xsl:if test=".//*[local-name() = 'fn']">
8690
8838
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
8691
8839
  </xsl:if>
8840
+
8841
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8842
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
8843
+ </xsl:apply-templates>
8692
8844
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
8693
- <!-- end OGC bibitem processing-->
8845
+ <!-- end bibitem processing -->
8694
8846
 
8695
8847
  </xsl:template> <!-- processBibitem (bibitem) -->
8696
8848
 
8697
- <xsl:template name="processBibitemDocId">
8698
- <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')]"/>
8699
- <xsl:choose>
8700
- <xsl:when test="normalize-space($_doc_ident) != ''">
8701
- <!-- <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"/>
8702
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
8703
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
8704
- </xsl:if> -->
8705
- <xsl:value-of select="$_doc_ident"/>
8706
- </xsl:when>
8707
- <xsl:otherwise>
8708
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
8709
- <xsl:if test="$type != ''">
8710
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
8711
- </xsl:if> -->
8712
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
8713
- </xsl:otherwise>
8714
- </xsl:choose>
8715
- </xsl:template> <!-- processBibitemDocId -->
8849
+ <xsl:template match="*[local-name() = 'title']" mode="title">
8850
+ <fo:inline><xsl:apply-templates/></fo:inline>
8851
+ </xsl:template>
8852
+
8853
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8854
+
8855
+ <xsl:template match="*[local-name() = 'formattedref']">
8856
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
8857
+ <xsl:text>, </xsl:text>
8858
+ </xsl:if> -->
8859
+ <xsl:apply-templates/>
8860
+ </xsl:template>
8716
8861
 
8717
- <xsl:template name="processPersonalAuthor">
8862
+ <xsl:template match="*[local-name() = 'biblio-tag']">
8863
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8718
8864
  <xsl:choose>
8719
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
8720
- <author>
8721
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
8722
- </author>
8865
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
8866
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8723
8867
  </xsl:when>
8724
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
8725
- <author>
8726
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
8727
- <xsl:text> </xsl:text>
8728
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
8729
- </author>
8730
- </xsl:when>
8731
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
8732
- <author>
8733
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
8734
- <xsl:text> </xsl:text>
8735
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
8736
- </author>
8868
+ <xsl:when test="$biblio_tag_part = 'last'">
8869
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
8737
8870
  </xsl:when>
8738
8871
  <xsl:otherwise>
8739
8872
  <xsl:apply-templates/>
8740
8873
  </xsl:otherwise>
8741
8874
  </xsl:choose>
8742
- </xsl:template> <!-- processPersonalAuthor -->
8743
-
8744
- <xsl:template name="renderDate">
8745
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
8746
- <xsl:value-of select="*[local-name() = 'on']"/>
8747
- </xsl:if>
8748
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
8749
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
8750
- </xsl:if>
8751
- </xsl:template>
8752
-
8753
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
8754
- <xsl:value-of select="translate(.,'. ','')"/>
8755
- </xsl:template>
8756
-
8757
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
8758
- <xsl:value-of select="substring(.,1,1)"/>
8759
- </xsl:template>
8760
-
8761
- <xsl:template match="*[local-name() = 'title']" mode="title">
8762
- <fo:inline><xsl:apply-templates/></fo:inline>
8763
- </xsl:template>
8764
-
8765
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
8766
- <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
8767
- <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
8768
- <xsl:apply-templates/>
8769
- </fo:inline>
8770
- </xsl:template>
8771
-
8772
- <!-- bibitem/note renders as footnote -->
8773
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
8774
-
8775
- <!-- list of footnotes to calculate actual footnotes number -->
8776
- <xsl:variable name="p_fn_">
8777
- <xsl:call-template name="get_fn_list"/>
8778
- </xsl:variable>
8779
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
8780
- <xsl:variable name="gen_id" select="generate-id(.)"/>
8781
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
8782
- <!-- fn sequence number in document -->
8783
- <xsl:variable name="current_fn_number">
8784
- <xsl:choose>
8785
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
8786
- <xsl:otherwise>
8787
- <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
8788
- <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
8789
- </xsl:otherwise>
8790
- </xsl:choose>
8791
- </xsl:variable>
8792
- <fo:footnote>
8793
- <xsl:variable name="number">
8794
-
8795
- <xsl:choose>
8796
- <xsl:when test="ancestor::*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]">
8797
- <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
8798
- </xsl:when>
8799
- <xsl:otherwise>
8800
- <xsl:value-of select="$current_fn_number"/>
8801
- </xsl:otherwise>
8802
- </xsl:choose>
8803
-
8804
- </xsl:variable>
8805
-
8806
- <xsl:variable name="current_fn_number_text">
8807
- <xsl:value-of select="$number"/>
8808
-
8809
- </xsl:variable>
8810
-
8811
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
8812
- <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
8813
- <xsl:value-of select="$current_fn_number_text"/>
8814
- </fo:basic-link>
8815
- </fo:inline>
8816
- <fo:footnote-body>
8817
- <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
8818
- <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
8819
- <xsl:value-of select="$current_fn_number_text"/>
8820
- </fo:inline>
8821
- <xsl:apply-templates/>
8822
- </fo:block>
8823
- </fo:footnote-body>
8824
- </fo:footnote>
8825
- </xsl:template>
8826
-
8827
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
8828
- <xsl:text> edition </xsl:text>
8829
- <xsl:value-of select="."/>
8830
- </xsl:template>
8831
-
8832
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
8833
- <xsl:text> (</xsl:text>
8834
- <fo:inline xsl:use-attribute-sets="link-style">
8835
- <fo:basic-link external-destination="." fox:alt-text=".">
8836
- <xsl:value-of select="."/>
8837
- </fo:basic-link>
8838
- </fo:inline>
8839
- <xsl:text>)</xsl:text>
8840
8875
  </xsl:template>
8841
8876
 
8842
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8843
-
8844
- <xsl:template match="*[local-name() = 'formattedref']">
8845
-
8846
- <xsl:apply-templates/>
8877
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
8878
+ <xsl:text> </xsl:text>
8847
8879
  </xsl:template>
8848
8880
 
8849
8881
  <!-- ======================= -->
@@ -9272,6 +9304,12 @@
9272
9304
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
9273
9305
  <xsl:apply-templates mode="update_xml_step1"/>
9274
9306
  </xsl:template>
9307
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
9308
+ <xsl:copy>
9309
+ <xsl:copy-of select="@*"/>
9310
+ <xsl:apply-templates mode="update_xml_step1"/>
9311
+ </xsl:copy>
9312
+ </xsl:template>
9275
9313
  <!-- =========================================================================== -->
9276
9314
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9277
9315
  <!-- =========================================================================== -->
@@ -9752,6 +9790,10 @@
9752
9790
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
9753
9791
  </xsl:template>
9754
9792
 
9793
+ <xsl:template name="getDocumentId_fromCurrentNode">
9794
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
9795
+ </xsl:template>
9796
+
9755
9797
  <xsl:template name="namespaceCheck">
9756
9798
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
9757
9799
  <xsl:variable name="XSLNS">
@@ -123,11 +123,6 @@ module IsoDoc
123
123
  super
124
124
  end
125
125
 
126
- def section(docxml)
127
- super
128
- references(docxml)
129
- end
130
-
131
126
  def bibdata(docxml)
132
127
  docxml.xpath(ns("//bibdata/contributor[@type = 'author']")).each do |a|
133
128
  a.at(ns("./description"))&.text == "contributor" and
@@ -189,7 +184,7 @@ module IsoDoc
189
184
  def bibrender_relaton(xml, renderings)
190
185
  f = renderings[xml["id"]][:formattedref]
191
186
  f &&= "<formattedref>#{f}</formattedref>"
192
- keep = "./docidentifier | ./uri | ./note | ./status"
187
+ keep = "./docidentifier | ./uri | ./note | ./status | ./biblio-tag"
193
188
  xml.children = "#{f}#{xml.xpath(ns(keep)).to_xml}"
194
189
  end
195
190
 
@@ -208,6 +203,18 @@ module IsoDoc
208
203
  display_order_xpath(docxml, "//indexsect", i)
209
204
  end
210
205
 
206
+ def norm_ref_entry_code(_ordinal, _idents, _ids, _standard, _datefn)
207
+ ""
208
+ end
209
+
210
+ # if ids is just a number, only use that ([1] Non-Standard)
211
+ # else, use both ordinal, as prefix, and ids
212
+ def biblio_ref_entry_code(ordinal, ids, _id, standard, datefn)
213
+ standard and return "[#{ordinal}]<tab/>"
214
+ ret = (ids[:ordinal] || ids[:metanorma] || "[#{ordinal}]")
215
+ prefix_bracketed_ref("#{ret}#{datefn}")
216
+ end
217
+
211
218
  include Init
212
219
  end
213
220
  end