metanorma-itu 1.3.11 → 1.3.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -2888,13 +2888,20 @@
2888
2888
 
2889
2889
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2890
2890
 
2891
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
2891
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
2892
+ <xsl:attribute name="line-height">135%</xsl:attribute>
2893
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
2892
2894
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2893
2895
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2894
2896
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
2895
2897
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
2896
2898
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
2897
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2899
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
2900
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2901
+ <xsl:sort select="@displayorder" data-type="number"/>
2902
+ <xsl:apply-templates select="." mode="contents"/>
2903
+ </xsl:for-each>
2904
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
2898
2905
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
2899
2906
 
2900
2907
  <!-- Normative references -->
@@ -2907,13 +2914,33 @@
2907
2914
  <!-- Bibliography -->
2908
2915
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
2909
2916
 
2910
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2917
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2918
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2919
+ <xsl:sort select="@displayorder" data-type="number"/>
2920
+ <xsl:apply-templates select="." mode="contents"/>
2921
+ </xsl:for-each>
2922
+
2923
+ <xsl:for-each select="/*/*[local-name()='annex']">
2924
+ <xsl:sort select="@displayorder" data-type="number"/>
2925
+ <xsl:apply-templates select="." mode="contents"/>
2926
+ </xsl:for-each>
2927
+
2928
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2929
+ <xsl:sort select="@displayorder" data-type="number"/>
2930
+ <xsl:apply-templates select="." mode="contents"/>
2931
+ </xsl:for-each>
2932
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
2911
2933
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
2912
2934
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
2913
2935
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
2914
2936
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
2915
2937
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
2916
- </xsl:template><xsl:template name="processMainSectionsDefault">
2938
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2939
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2940
+ <xsl:sort select="@displayorder" data-type="number"/>
2941
+ <xsl:apply-templates select="."/>
2942
+ </xsl:for-each>
2943
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
2917
2944
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
2918
2945
 
2919
2946
  <!-- Normative references -->
@@ -2925,6 +2952,22 @@
2925
2952
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
2926
2953
  <!-- Bibliography -->
2927
2954
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
2955
+ </xsl:template><xsl:template name="processMainSectionsDefault">
2956
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2957
+ <xsl:sort select="@displayorder" data-type="number"/>
2958
+ <xsl:apply-templates select="."/>
2959
+
2960
+ </xsl:for-each>
2961
+
2962
+ <xsl:for-each select="/*/*[local-name()='annex']">
2963
+ <xsl:sort select="@displayorder" data-type="number"/>
2964
+ <xsl:apply-templates select="."/>
2965
+ </xsl:for-each>
2966
+
2967
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2968
+ <xsl:sort select="@displayorder" data-type="number"/>
2969
+ <xsl:apply-templates select="."/>
2970
+ </xsl:for-each>
2928
2971
  </xsl:template><xsl:template match="text()">
2929
2972
  <xsl:value-of select="."/>
2930
2973
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -5532,6 +5575,13 @@
5532
5575
  </xsl:attribute>
5533
5576
  <xsl:apply-templates mode="svg_update"/>
5534
5577
  </xsl:copy>
5578
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
5579
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
5580
+ <xsl:for-each select="*[local-name() = 'svg']">
5581
+ <xsl:call-template name="image_svg">
5582
+ <xsl:with-param name="name" select="$name"/>
5583
+ </xsl:call-template>
5584
+ </xsl:for-each>
5535
5585
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5536
5586
  <xsl:variable name="svg_content" select="document(@src)"/>
5537
5587
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5636,7 +5686,7 @@
5636
5686
  </fo:basic-link>
5637
5687
  </fo:block>
5638
5688
  </fo:block-container>
5639
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5689
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5640
5690
  <xsl:apply-templates mode="contents"/>
5641
5691
  <xsl:text> </xsl:text>
5642
5692
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
@@ -6316,8 +6366,8 @@
6316
6366
  </xsl:if>
6317
6367
  </xsl:template><xsl:variable name="localized.source">
6318
6368
  <xsl:call-template name="getLocalizedString">
6319
- <xsl:with-param name="key">source</xsl:with-param>
6320
- </xsl:call-template>
6369
+ <xsl:with-param name="key">source</xsl:with-param>
6370
+ </xsl:call-template>
6321
6371
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6322
6372
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6323
6373
  <xsl:if test="normalize-space(@citeas) = ''">
@@ -6327,6 +6377,7 @@
6327
6377
  <fo:inline xsl:use-attribute-sets="origin-style">
6328
6378
  <xsl:apply-templates/>
6329
6379
  </fo:inline>
6380
+
6330
6381
  </fo:basic-link>
6331
6382
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
6332
6383
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -6393,6 +6444,9 @@
6393
6444
 
6394
6445
  </xsl:if>
6395
6446
 
6447
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
6448
+ <xsl:variable name="text" select="normalize-space()"/>
6449
+
6396
6450
 
6397
6451
 
6398
6452
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -6405,7 +6459,9 @@
6405
6459
 
6406
6460
 
6407
6461
  </xsl:if>
6408
-
6462
+
6463
+
6464
+
6409
6465
  <xsl:apply-templates/>
6410
6466
  </fo:basic-link>
6411
6467
 
@@ -6921,9 +6977,97 @@
6921
6977
  <fo:block-container border="1pt solid black" width="50%">
6922
6978
  <fo:block> </fo:block>
6923
6979
  </fo:block-container>
6980
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
6981
+ <xsl:param name="colwidths"/>
6982
+ <xsl:variable name="colwidths_">
6983
+ <xsl:choose>
6984
+ <xsl:when test="not($colwidths)">
6985
+ <xsl:variable name="toc_table_simple">
6986
+ <tbody>
6987
+ <xsl:apply-templates mode="toc_table_width"/>
6988
+ </tbody>
6989
+ </xsl:variable>
6990
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
6991
+ <xsl:call-template name="calculate-column-widths">
6992
+ <xsl:with-param name="cols-count" select="$cols-count"/>
6993
+ <xsl:with-param name="table" select="$toc_table_simple"/>
6994
+ </xsl:call-template>
6995
+ </xsl:when>
6996
+ <xsl:otherwise>
6997
+ <xsl:copy-of select="$colwidths"/>
6998
+ </xsl:otherwise>
6999
+ </xsl:choose>
7000
+ </xsl:variable>
7001
+ <fo:block role="TOCI" space-after="16pt">
7002
+ <fo:table width="100%" table-layout="fixed">
7003
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
7004
+ <fo:table-column column-width="proportional-column-width({.})"/>
7005
+ </xsl:for-each>
7006
+ <fo:table-body>
7007
+ <xsl:apply-templates/>
7008
+ </fo:table-body>
7009
+ </fo:table>
7010
+ </fo:block>
7011
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7012
+ <fo:table-row min-height="5mm">
7013
+ <xsl:apply-templates/>
7014
+ </fo:table-row>
7015
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
7016
+ <xsl:apply-templates/>
7017
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
7018
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7019
+ <xsl:variable name="target" select="@target"/>
7020
+ <xsl:for-each select="*[local-name() = 'tab']">
7021
+ <xsl:variable name="current_id" select="generate-id()"/>
7022
+ <fo:table-cell>
7023
+ <fo:block>
7024
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7025
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7026
+ <xsl:choose>
7027
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7028
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
7029
+ </xsl:choose>
7030
+ </xsl:for-each>
7031
+ </fo:basic-link>
7032
+ </fo:block>
7033
+ </fo:table-cell>
7034
+ </xsl:for-each>
7035
+ <!-- last column - for page numbers -->
7036
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
7037
+ <fo:block>
7038
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7039
+ <fo:page-number-citation ref-id="{$target}"/>
7040
+ </fo:basic-link>
7041
+ </fo:block>
7042
+ </fo:table-cell>
7043
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
7044
+ <xsl:apply-templates mode="toc_table_width"/>
7045
+ </xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
7046
+ <tr>
7047
+ <xsl:apply-templates mode="toc_table_width"/>
7048
+ </tr>
7049
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
7050
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7051
+ <xsl:for-each select="*[local-name() = 'tab']">
7052
+ <xsl:variable name="current_id" select="generate-id()"/>
7053
+ <td>
7054
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7055
+ <xsl:copy-of select="."/>
7056
+ </xsl:for-each>
7057
+ </td>
7058
+ </xsl:for-each>
7059
+ <td>333</td> <!-- page number, just for fill -->
6924
7060
  </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6925
7061
  <fo:inline padding-right="5mm"> </fo:inline>
6926
7062
  <fo:inline><xsl:apply-templates/></fo:inline>
7063
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
7064
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
7065
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
7066
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
7067
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
7068
+ </svg>
7069
+ </fo:instream-foreign-object>
7070
+ </fo:inline>
6927
7071
  </xsl:template><xsl:template name="convertDate">
6928
7072
  <xsl:param name="date"/>
6929
7073
  <xsl:param name="format" select="'short'"/>
@@ -2888,13 +2888,20 @@
2888
2888
 
2889
2889
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2890
2890
 
2891
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
2891
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
2892
+ <xsl:attribute name="line-height">135%</xsl:attribute>
2893
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
2892
2894
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2893
2895
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2894
2896
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
2895
2897
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
2896
2898
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
2897
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2899
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
2900
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2901
+ <xsl:sort select="@displayorder" data-type="number"/>
2902
+ <xsl:apply-templates select="." mode="contents"/>
2903
+ </xsl:for-each>
2904
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
2898
2905
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
2899
2906
 
2900
2907
  <!-- Normative references -->
@@ -2907,13 +2914,33 @@
2907
2914
  <!-- Bibliography -->
2908
2915
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
2909
2916
 
2910
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2917
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2918
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2919
+ <xsl:sort select="@displayorder" data-type="number"/>
2920
+ <xsl:apply-templates select="." mode="contents"/>
2921
+ </xsl:for-each>
2922
+
2923
+ <xsl:for-each select="/*/*[local-name()='annex']">
2924
+ <xsl:sort select="@displayorder" data-type="number"/>
2925
+ <xsl:apply-templates select="." mode="contents"/>
2926
+ </xsl:for-each>
2927
+
2928
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2929
+ <xsl:sort select="@displayorder" data-type="number"/>
2930
+ <xsl:apply-templates select="." mode="contents"/>
2931
+ </xsl:for-each>
2932
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
2911
2933
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
2912
2934
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
2913
2935
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
2914
2936
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
2915
2937
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
2916
- </xsl:template><xsl:template name="processMainSectionsDefault">
2938
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2939
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2940
+ <xsl:sort select="@displayorder" data-type="number"/>
2941
+ <xsl:apply-templates select="."/>
2942
+ </xsl:for-each>
2943
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
2917
2944
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
2918
2945
 
2919
2946
  <!-- Normative references -->
@@ -2925,6 +2952,22 @@
2925
2952
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
2926
2953
  <!-- Bibliography -->
2927
2954
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
2955
+ </xsl:template><xsl:template name="processMainSectionsDefault">
2956
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2957
+ <xsl:sort select="@displayorder" data-type="number"/>
2958
+ <xsl:apply-templates select="."/>
2959
+
2960
+ </xsl:for-each>
2961
+
2962
+ <xsl:for-each select="/*/*[local-name()='annex']">
2963
+ <xsl:sort select="@displayorder" data-type="number"/>
2964
+ <xsl:apply-templates select="."/>
2965
+ </xsl:for-each>
2966
+
2967
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2968
+ <xsl:sort select="@displayorder" data-type="number"/>
2969
+ <xsl:apply-templates select="."/>
2970
+ </xsl:for-each>
2928
2971
  </xsl:template><xsl:template match="text()">
2929
2972
  <xsl:value-of select="."/>
2930
2973
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -5532,6 +5575,13 @@
5532
5575
  </xsl:attribute>
5533
5576
  <xsl:apply-templates mode="svg_update"/>
5534
5577
  </xsl:copy>
5578
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
5579
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
5580
+ <xsl:for-each select="*[local-name() = 'svg']">
5581
+ <xsl:call-template name="image_svg">
5582
+ <xsl:with-param name="name" select="$name"/>
5583
+ </xsl:call-template>
5584
+ </xsl:for-each>
5535
5585
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5536
5586
  <xsl:variable name="svg_content" select="document(@src)"/>
5537
5587
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5636,7 +5686,7 @@
5636
5686
  </fo:basic-link>
5637
5687
  </fo:block>
5638
5688
  </fo:block-container>
5639
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5689
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5640
5690
  <xsl:apply-templates mode="contents"/>
5641
5691
  <xsl:text> </xsl:text>
5642
5692
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
@@ -6316,8 +6366,8 @@
6316
6366
  </xsl:if>
6317
6367
  </xsl:template><xsl:variable name="localized.source">
6318
6368
  <xsl:call-template name="getLocalizedString">
6319
- <xsl:with-param name="key">source</xsl:with-param>
6320
- </xsl:call-template>
6369
+ <xsl:with-param name="key">source</xsl:with-param>
6370
+ </xsl:call-template>
6321
6371
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6322
6372
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6323
6373
  <xsl:if test="normalize-space(@citeas) = ''">
@@ -6327,6 +6377,7 @@
6327
6377
  <fo:inline xsl:use-attribute-sets="origin-style">
6328
6378
  <xsl:apply-templates/>
6329
6379
  </fo:inline>
6380
+
6330
6381
  </fo:basic-link>
6331
6382
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
6332
6383
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -6393,6 +6444,9 @@
6393
6444
 
6394
6445
  </xsl:if>
6395
6446
 
6447
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
6448
+ <xsl:variable name="text" select="normalize-space()"/>
6449
+
6396
6450
 
6397
6451
 
6398
6452
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -6405,7 +6459,9 @@
6405
6459
 
6406
6460
 
6407
6461
  </xsl:if>
6408
-
6462
+
6463
+
6464
+
6409
6465
  <xsl:apply-templates/>
6410
6466
  </fo:basic-link>
6411
6467
 
@@ -6921,9 +6977,97 @@
6921
6977
  <fo:block-container border="1pt solid black" width="50%">
6922
6978
  <fo:block> </fo:block>
6923
6979
  </fo:block-container>
6980
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
6981
+ <xsl:param name="colwidths"/>
6982
+ <xsl:variable name="colwidths_">
6983
+ <xsl:choose>
6984
+ <xsl:when test="not($colwidths)">
6985
+ <xsl:variable name="toc_table_simple">
6986
+ <tbody>
6987
+ <xsl:apply-templates mode="toc_table_width"/>
6988
+ </tbody>
6989
+ </xsl:variable>
6990
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
6991
+ <xsl:call-template name="calculate-column-widths">
6992
+ <xsl:with-param name="cols-count" select="$cols-count"/>
6993
+ <xsl:with-param name="table" select="$toc_table_simple"/>
6994
+ </xsl:call-template>
6995
+ </xsl:when>
6996
+ <xsl:otherwise>
6997
+ <xsl:copy-of select="$colwidths"/>
6998
+ </xsl:otherwise>
6999
+ </xsl:choose>
7000
+ </xsl:variable>
7001
+ <fo:block role="TOCI" space-after="16pt">
7002
+ <fo:table width="100%" table-layout="fixed">
7003
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
7004
+ <fo:table-column column-width="proportional-column-width({.})"/>
7005
+ </xsl:for-each>
7006
+ <fo:table-body>
7007
+ <xsl:apply-templates/>
7008
+ </fo:table-body>
7009
+ </fo:table>
7010
+ </fo:block>
7011
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7012
+ <fo:table-row min-height="5mm">
7013
+ <xsl:apply-templates/>
7014
+ </fo:table-row>
7015
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
7016
+ <xsl:apply-templates/>
7017
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
7018
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7019
+ <xsl:variable name="target" select="@target"/>
7020
+ <xsl:for-each select="*[local-name() = 'tab']">
7021
+ <xsl:variable name="current_id" select="generate-id()"/>
7022
+ <fo:table-cell>
7023
+ <fo:block>
7024
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7025
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7026
+ <xsl:choose>
7027
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7028
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
7029
+ </xsl:choose>
7030
+ </xsl:for-each>
7031
+ </fo:basic-link>
7032
+ </fo:block>
7033
+ </fo:table-cell>
7034
+ </xsl:for-each>
7035
+ <!-- last column - for page numbers -->
7036
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
7037
+ <fo:block>
7038
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7039
+ <fo:page-number-citation ref-id="{$target}"/>
7040
+ </fo:basic-link>
7041
+ </fo:block>
7042
+ </fo:table-cell>
7043
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
7044
+ <xsl:apply-templates mode="toc_table_width"/>
7045
+ </xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
7046
+ <tr>
7047
+ <xsl:apply-templates mode="toc_table_width"/>
7048
+ </tr>
7049
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
7050
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7051
+ <xsl:for-each select="*[local-name() = 'tab']">
7052
+ <xsl:variable name="current_id" select="generate-id()"/>
7053
+ <td>
7054
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7055
+ <xsl:copy-of select="."/>
7056
+ </xsl:for-each>
7057
+ </td>
7058
+ </xsl:for-each>
7059
+ <td>333</td> <!-- page number, just for fill -->
6924
7060
  </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6925
7061
  <fo:inline padding-right="5mm"> </fo:inline>
6926
7062
  <fo:inline><xsl:apply-templates/></fo:inline>
7063
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
7064
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
7065
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
7066
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
7067
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
7068
+ </svg>
7069
+ </fo:instream-foreign-object>
7070
+ </fo:inline>
6927
7071
  </xsl:template><xsl:template name="convertDate">
6928
7072
  <xsl:param name="date"/>
6929
7073
  <xsl:param name="format" select="'short'"/>