metanorma-mpfa 0.5.7 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -328,16 +328,16 @@
328
328
  <xsl:otherwise> <!-- for ordered lists -->
329
329
  <xsl:choose>
330
330
  <xsl:when test="../@type = 'arabic'">
331
- <xsl:number format="a)"/>
331
+ <xsl:number format="a)" lang="en"/>
332
332
  </xsl:when>
333
333
  <xsl:when test="../@type = 'roman'">
334
334
  <xsl:number format="1)"/>
335
335
  </xsl:when>
336
336
  <xsl:when test="../@type = 'alphabet'">
337
- <xsl:number format="a)"/>
337
+ <xsl:number format="a)" lang="en"/>
338
338
  </xsl:when>
339
339
  <xsl:otherwise>
340
- <xsl:number format="a)"/>
340
+ <xsl:number format="a)" lang="en"/>
341
341
  </xsl:otherwise>
342
342
  </xsl:choose>
343
343
  </xsl:otherwise>
@@ -1138,6 +1138,7 @@
1138
1138
 
1139
1139
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1140
1140
 
1141
+
1141
1142
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1142
1143
 
1143
1144
 
@@ -1145,6 +1146,7 @@
1145
1146
 
1146
1147
 
1147
1148
 
1149
+
1148
1150
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1149
1151
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
1150
1152
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
@@ -1167,6 +1169,7 @@
1167
1169
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1168
1170
 
1169
1171
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1172
+
1170
1173
 
1171
1174
 
1172
1175
 
@@ -1276,7 +1279,7 @@
1276
1279
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1277
1280
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
1278
1281
  <xsl:call-template name="add-zero-spaces-java"/>
1279
- </xsl:template><xsl:template match="*[local-name()='table']">
1282
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1280
1283
 
1281
1284
  <xsl:variable name="simple-table">
1282
1285
  <xsl:call-template name="getSimpleTable"/>
@@ -1322,10 +1325,12 @@
1322
1325
 
1323
1326
 
1324
1327
  <xsl:variable name="colwidths">
1325
- <xsl:call-template name="calculate-column-widths">
1326
- <xsl:with-param name="cols-count" select="$cols-count"/>
1327
- <xsl:with-param name="table" select="$simple-table"/>
1328
- </xsl:call-template>
1328
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1329
+ <xsl:call-template name="calculate-column-widths">
1330
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1331
+ <xsl:with-param name="table" select="$simple-table"/>
1332
+ </xsl:call-template>
1333
+ </xsl:if>
1329
1334
  </xsl:variable>
1330
1335
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1331
1336
 
@@ -1368,7 +1373,12 @@
1368
1373
 
1369
1374
  <xsl:variable name="table_attributes">
1370
1375
  <attribute name="table-layout">fixed</attribute>
1371
- <attribute name="width">100%</attribute>
1376
+ <attribute name="width">
1377
+ <xsl:choose>
1378
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1379
+ <xsl:otherwise>100%</xsl:otherwise>
1380
+ </xsl:choose>
1381
+ </attribute>
1372
1382
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1373
1383
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1374
1384
 
@@ -1400,16 +1410,25 @@
1400
1410
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1401
1411
  </xsl:if>
1402
1412
 
1403
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1404
- <xsl:choose>
1405
- <xsl:when test=". = 1 or . = 0">
1406
- <fo:table-column column-width="proportional-column-width(2)"/>
1407
- </xsl:when>
1408
- <xsl:otherwise>
1409
- <fo:table-column column-width="proportional-column-width({.})"/>
1410
- </xsl:otherwise>
1411
- </xsl:choose>
1412
- </xsl:for-each>
1413
+ <xsl:choose>
1414
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1415
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1416
+ <fo:table-column column-width="{@width}"/>
1417
+ </xsl:for-each>
1418
+ </xsl:when>
1419
+ <xsl:otherwise>
1420
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1421
+ <xsl:choose>
1422
+ <xsl:when test=". = 1 or . = 0">
1423
+ <fo:table-column column-width="proportional-column-width(2)"/>
1424
+ </xsl:when>
1425
+ <xsl:otherwise>
1426
+ <fo:table-column column-width="proportional-column-width({.})"/>
1427
+ </xsl:otherwise>
1428
+ </xsl:choose>
1429
+ </xsl:for-each>
1430
+ </xsl:otherwise>
1431
+ </xsl:choose>
1413
1432
 
1414
1433
  <xsl:choose>
1415
1434
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -1422,10 +1441,12 @@
1422
1441
 
1423
1442
  </fo:table>
1424
1443
 
1444
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1425
1445
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1426
1446
  <xsl:call-template name="insertTableFooterInSeparateTable">
1427
1447
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
1428
1448
  <xsl:with-param name="colwidths" select="$colwidths"/>
1449
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1429
1450
  </xsl:call-template>
1430
1451
  </xsl:for-each>
1431
1452
 
@@ -1679,12 +1700,22 @@
1679
1700
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1680
1701
  <xsl:param name="table_attributes"/>
1681
1702
  <xsl:param name="colwidths"/>
1703
+ <xsl:param name="colgroup"/>
1682
1704
 
1683
1705
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1684
1706
 
1685
1707
  <xsl:if test="$isNoteOrFnExist = 'true'">
1686
1708
 
1687
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1709
+ <xsl:variable name="cols-count">
1710
+ <xsl:choose>
1711
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1712
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1713
+ </xsl:when>
1714
+ <xsl:otherwise>
1715
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1716
+ </xsl:otherwise>
1717
+ </xsl:choose>
1718
+ </xsl:variable>
1688
1719
 
1689
1720
  <fo:table keep-with-previous="always">
1690
1721
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -1702,16 +1733,25 @@
1702
1733
  </xsl:choose>
1703
1734
  </xsl:for-each>
1704
1735
 
1705
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1706
- <xsl:choose>
1707
- <xsl:when test=". = 1 or . = 0">
1708
- <fo:table-column column-width="proportional-column-width(2)"/>
1709
- </xsl:when>
1710
- <xsl:otherwise>
1711
- <fo:table-column column-width="proportional-column-width({.})"/>
1712
- </xsl:otherwise>
1713
- </xsl:choose>
1714
- </xsl:for-each>
1736
+ <xsl:choose>
1737
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1738
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
1739
+ <fo:table-column column-width="{@width}"/>
1740
+ </xsl:for-each>
1741
+ </xsl:when>
1742
+ <xsl:otherwise>
1743
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1744
+ <xsl:choose>
1745
+ <xsl:when test=". = 1 or . = 0">
1746
+ <fo:table-column column-width="proportional-column-width(2)"/>
1747
+ </xsl:when>
1748
+ <xsl:otherwise>
1749
+ <fo:table-column column-width="proportional-column-width({.})"/>
1750
+ </xsl:otherwise>
1751
+ </xsl:choose>
1752
+ </xsl:for-each>
1753
+ </xsl:otherwise>
1754
+ </xsl:choose>
1715
1755
 
1716
1756
  <fo:table-body>
1717
1757
  <fo:table-row>
@@ -2114,7 +2154,9 @@
2114
2154
  </xsl:template><xsl:template match="*[local-name()='dl']">
2115
2155
  <fo:block-container>
2116
2156
 
2117
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2157
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2158
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2159
+ </xsl:if>
2118
2160
 
2119
2161
 
2120
2162
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2129,6 +2171,7 @@
2129
2171
  <fo:block-container>
2130
2172
 
2131
2173
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2174
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2132
2175
 
2133
2176
 
2134
2177
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2312,12 +2355,32 @@
2312
2355
  </xsl:otherwise>
2313
2356
  </xsl:choose>
2314
2357
  </xsl:template><xsl:template name="getMaxLength_dt">
2315
- <xsl:for-each select="*[local-name()='dt']">
2316
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2317
- <xsl:if test="position() = 1">
2318
- <xsl:value-of select="string-length(normalize-space(.))"/>
2319
- </xsl:if>
2320
- </xsl:for-each>
2358
+ <xsl:variable name="lengths">
2359
+ <xsl:for-each select="*[local-name()='dt']">
2360
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2361
+ <xsl:variable name="attributes">
2362
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2363
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2364
+ </xsl:variable>
2365
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2366
+ </xsl:for-each>
2367
+ </xsl:variable>
2368
+ <xsl:variable name="maxLength">
2369
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2370
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2371
+ <xsl:if test="position() = 1">
2372
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2373
+ </xsl:if>
2374
+ </xsl:for-each> -->
2375
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2376
+ <xsl:sort select="." data-type="number" order="descending"/>
2377
+ <xsl:if test="position() = 1">
2378
+ <xsl:value-of select="."/>
2379
+ </xsl:if>
2380
+ </xsl:for-each>
2381
+ </xsl:variable>
2382
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2383
+ <xsl:value-of select="$maxLength"/>
2321
2384
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2322
2385
  <xsl:param name="key_iso"/>
2323
2386
 
@@ -2429,6 +2492,7 @@
2429
2492
  </fo:inline>
2430
2493
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2431
2494
  <fo:inline font-weight="bold">
2495
+
2432
2496
  <xsl:apply-templates/>
2433
2497
  </fo:inline>
2434
2498
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2455,6 +2519,7 @@
2455
2519
 
2456
2520
 
2457
2521
 
2522
+
2458
2523
 
2459
2524
  </xsl:variable>
2460
2525
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -2468,6 +2533,10 @@
2468
2533
  </xsl:if>
2469
2534
  <xsl:apply-templates/>
2470
2535
  </fo:inline>
2536
+ </xsl:template><xsl:template match="*[local-name()='underline']">
2537
+ <fo:inline text-decoration="underline">
2538
+ <xsl:apply-templates/>
2539
+ </fo:inline>
2471
2540
  </xsl:template><xsl:template match="*[local-name()='del']">
2472
2541
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2473
2542
  <xsl:apply-templates/>
@@ -2833,6 +2902,7 @@
2833
2902
  </xsl:choose>
2834
2903
  </xsl:variable>
2835
2904
  <fo:inline xsl:use-attribute-sets="link-style">
2905
+
2836
2906
  <xsl:choose>
2837
2907
  <xsl:when test="$target = ''">
2838
2908
  <xsl:apply-templates/>
@@ -3043,8 +3113,9 @@
3043
3113
  </xsl:if> -->
3044
3114
  </fo:inline>
3045
3115
  </xsl:if>
3046
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
3047
- <fo:block-container id="{@id}">
3116
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3117
+ <fo:block-container id="{@id}">
3118
+
3048
3119
  <fo:block>
3049
3120
  <xsl:apply-templates/>
3050
3121
  </fo:block>
@@ -3095,7 +3166,7 @@
3095
3166
  <xsl:apply-templates mode="bookmarks"/>
3096
3167
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3097
3168
  <xsl:apply-templates select="."/>
3098
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3169
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3099
3170
  <xsl:apply-templates mode="bookmarks"/>
3100
3171
  </xsl:template><xsl:template name="addBookmarks">
3101
3172
  <xsl:param name="contents"/>
@@ -3111,6 +3182,8 @@
3111
3182
  <xsl:variable name="bookmark-title_">
3112
3183
  <xsl:call-template name="getLangVersion">
3113
3184
  <xsl:with-param name="lang" select="@lang"/>
3185
+ <xsl:with-param name="doctype" select="@doctype"/>
3186
+ <xsl:with-param name="title" select="@title-part"/>
3114
3187
  </xsl:call-template>
3115
3188
  </xsl:variable>
3116
3189
  <xsl:choose>
@@ -3128,13 +3201,34 @@
3128
3201
  </xsl:choose>
3129
3202
  </fo:bookmark-title>
3130
3203
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3204
+
3205
+ <xsl:call-template name="insertFigureBookmarks">
3206
+ <xsl:with-param name="contents" select="contents"/>
3207
+ </xsl:call-template>
3208
+
3209
+ <xsl:call-template name="insertTableBookmarks">
3210
+ <xsl:with-param name="contents" select="contents"/>
3211
+ <xsl:with-param name="lang" select="@lang"/>
3212
+ </xsl:call-template>
3213
+
3131
3214
  </fo:bookmark>
3132
3215
 
3133
3216
  </xsl:for-each>
3134
3217
  </xsl:when>
3135
3218
  <xsl:otherwise>
3136
3219
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3220
+
3137
3221
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3222
+
3223
+ <xsl:call-template name="insertFigureBookmarks">
3224
+ <xsl:with-param name="contents" select="contents"/>
3225
+ </xsl:call-template>
3226
+
3227
+ <xsl:call-template name="insertTableBookmarks">
3228
+ <xsl:with-param name="contents" select="contents"/>
3229
+ <xsl:with-param name="lang" select="@lang"/>
3230
+ </xsl:call-template>
3231
+
3138
3232
  </xsl:for-each>
3139
3233
  </xsl:otherwise>
3140
3234
  </xsl:choose>
@@ -3153,8 +3247,44 @@
3153
3247
 
3154
3248
  </fo:bookmark-tree>
3155
3249
  </xsl:if>
3250
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3251
+ <xsl:param name="contents"/>
3252
+ <xsl:if test="xalan:nodeset($contents)/figure">
3253
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3254
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3255
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3256
+ <fo:bookmark internal-destination="{@id}">
3257
+ <fo:bookmark-title>
3258
+ <xsl:value-of select="normalize-space(title)"/>
3259
+ </fo:bookmark-title>
3260
+ </fo:bookmark>
3261
+ </xsl:for-each>
3262
+ </fo:bookmark>
3263
+ </xsl:if>
3264
+ </xsl:template><xsl:template name="insertTableBookmarks">
3265
+ <xsl:param name="contents"/>
3266
+ <xsl:param name="lang"/>
3267
+ <xsl:if test="xalan:nodeset($contents)/table">
3268
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3269
+ <fo:bookmark-title>
3270
+ <xsl:choose>
3271
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3272
+ <xsl:otherwise>Tables</xsl:otherwise>
3273
+ </xsl:choose>
3274
+ </fo:bookmark-title>
3275
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3276
+ <fo:bookmark internal-destination="{@id}">
3277
+ <fo:bookmark-title>
3278
+ <xsl:value-of select="normalize-space(title)"/>
3279
+ </fo:bookmark-title>
3280
+ </fo:bookmark>
3281
+ </xsl:for-each>
3282
+ </fo:bookmark>
3283
+ </xsl:if>
3156
3284
  </xsl:template><xsl:template name="getLangVersion">
3157
3285
  <xsl:param name="lang"/>
3286
+ <xsl:param name="doctype" select="''"/>
3287
+ <xsl:param name="title" select="''"/>
3158
3288
  <xsl:choose>
3159
3289
  <xsl:when test="$lang = 'en'">
3160
3290
 
@@ -3190,6 +3320,12 @@
3190
3320
  <!-- <xsl:text> </xsl:text> -->
3191
3321
  </xsl:template><xsl:template name="getSection">
3192
3322
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3323
+ <!--
3324
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
3325
+ <xsl:value-of select="."/>
3326
+ </xsl:for-each>
3327
+ -->
3328
+
3193
3329
  </xsl:template><xsl:template name="getName">
3194
3330
  <xsl:choose>
3195
3331
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -3242,6 +3378,10 @@
3242
3378
  <xsl:copy>
3243
3379
  <xsl:apply-templates mode="contents_item"/>
3244
3380
  </xsl:copy>
3381
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
3382
+ <xsl:copy>
3383
+ <xsl:apply-templates mode="contents_item"/>
3384
+ </xsl:copy>
3245
3385
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3246
3386
  <xsl:text> </xsl:text>
3247
3387
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -3267,6 +3407,7 @@
3267
3407
 
3268
3408
 
3269
3409
 
3410
+
3270
3411
 
3271
3412
 
3272
3413
 
@@ -3646,7 +3787,8 @@
3646
3787
  <fo:block-container margin-left="0mm">
3647
3788
 
3648
3789
  <fo:block xsl:use-attribute-sets="quote-style">
3649
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3790
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3791
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3650
3792
  </fo:block>
3651
3793
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3652
3794
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -3795,6 +3937,7 @@
3795
3937
 
3796
3938
 
3797
3939
 
3940
+
3798
3941
 
3799
3942
 
3800
3943
 
@@ -3806,7 +3949,7 @@
3806
3949
 
3807
3950
 
3808
3951
 
3809
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3952
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
3810
3953
  <fo:block break-after="page"/>
3811
3954
  <fo:block>
3812
3955
  <xsl:call-template name="setId"/>
@@ -3814,7 +3957,8 @@
3814
3957
  </fo:block>
3815
3958
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3816
3959
  <fo:block>
3817
- <xsl:call-template name="setId"/>
3960
+ <xsl:call-template name="setId"/>
3961
+
3818
3962
 
3819
3963
  <xsl:apply-templates/>
3820
3964
  </fo:block>
@@ -3822,7 +3966,7 @@
3822
3966
  <fo:block id="{@id}">
3823
3967
  <xsl:apply-templates/>
3824
3968
  </fo:block>
3825
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3969
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3826
3970
 
3827
3971
  <fo:block id="{@id}">
3828
3972
  <xsl:apply-templates/>
@@ -3879,7 +4023,8 @@
3879
4023
  <fo:table-column column-width="107mm"/>
3880
4024
  <fo:table-column column-width="15mm"/>
3881
4025
  <fo:table-body>
3882
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4026
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4027
+
3883
4028
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3884
4029
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3885
4030
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -3897,6 +4042,10 @@
3897
4042
  <fo:block><xsl:apply-templates/></fo:block>
3898
4043
  </fo:table-cell>
3899
4044
  </xsl:template><xsl:template name="processBibitem">
4045
+
4046
+
4047
+ <!-- end BIPM bibitem processing-->
4048
+
3900
4049
 
3901
4050
 
3902
4051
 
@@ -3955,6 +4104,8 @@
3955
4104
  <xsl:value-of select="translate(.,'. ','')"/>
3956
4105
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3957
4106
  <xsl:value-of select="substring(.,1,1)"/>
4107
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4108
+ <fo:inline><xsl:apply-templates/></fo:inline>
3958
4109
  </xsl:template><xsl:template name="convertDate">
3959
4110
  <xsl:param name="date"/>
3960
4111
  <xsl:param name="format" select="'short'"/>
@@ -3979,6 +4130,57 @@
3979
4130
  </xsl:variable>
3980
4131
  <xsl:variable name="result">
3981
4132
  <xsl:choose>
4133
+ <xsl:when test="$format = 'ddMMyyyy'">
4134
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4135
+ <xsl:text> </xsl:text>
4136
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4137
+ </xsl:when>
4138
+ <xsl:when test="$format = 'ddMM'">
4139
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4140
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4141
+ </xsl:when>
4142
+ <xsl:when test="$format = 'short' or $day = ''">
4143
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4144
+ </xsl:when>
4145
+ <xsl:otherwise>
4146
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4147
+ </xsl:otherwise>
4148
+ </xsl:choose>
4149
+ </xsl:variable>
4150
+ <xsl:value-of select="$result"/>
4151
+ </xsl:template><xsl:template name="convertDateLocalized">
4152
+ <xsl:param name="date"/>
4153
+ <xsl:param name="format" select="'short'"/>
4154
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
4155
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
4156
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
4157
+ <xsl:variable name="monthStr">
4158
+ <xsl:choose>
4159
+ <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
4160
+ <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
4161
+ <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
4162
+ <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
4163
+ <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
4164
+ <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
4165
+ <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
4166
+ <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
4167
+ <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
4168
+ <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
4169
+ <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
4170
+ <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
4171
+ </xsl:choose>
4172
+ </xsl:variable>
4173
+ <xsl:variable name="result">
4174
+ <xsl:choose>
4175
+ <xsl:when test="$format = 'ddMMyyyy'">
4176
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4177
+ <xsl:text> </xsl:text>
4178
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4179
+ </xsl:when>
4180
+ <xsl:when test="$format = 'ddMM'">
4181
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4182
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4183
+ </xsl:when>
3982
4184
  <xsl:when test="$format = 'short' or $day = ''">
3983
4185
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
3984
4186
  </xsl:when>
@@ -4171,6 +4373,7 @@
4171
4373
  <xsl:value-of select="document('')//*/namespace::mpfd"/>
4172
4374
 
4173
4375
 
4376
+
4174
4377
  </xsl:variable>
4175
4378
  <xsl:if test="$documentNS != $XSLNS">
4176
4379
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4230,6 +4433,11 @@
4230
4433
  <xsl:call-template name="getLang"/>
4231
4434
  </xsl:variable>
4232
4435
 
4233
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4436
+ <xsl:choose>
4437
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4438
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4439
+ </xsl:when>
4440
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4441
+ </xsl:choose>
4234
4442
 
4235
4443
  </xsl:template></xsl:stylesheet>