metanorma-nist 1.2.13 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,9 @@
5
5
 
6
6
 
7
7
  <xsl:param name="svg_images"/>
8
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
8
9
  <xsl:variable name="images" select="document($svg_images)"/>
10
+ <xsl:param name="basepath"/>
9
11
 
10
12
 
11
13
 
@@ -92,7 +94,9 @@
92
94
 
93
95
  </fo:layout-master-set>
94
96
 
95
- <xsl:call-template name="addPDFUAmeta"/>
97
+ <fo:declarations>
98
+ <xsl:call-template name="addPDFUAmeta"/>
99
+ </fo:declarations>
96
100
 
97
101
  <xsl:call-template name="addBookmarks">
98
102
  <xsl:with-param name="contents" select="$contents"/>
@@ -234,52 +238,28 @@
234
238
  <fo:block margin-top="18pt">
235
239
 
236
240
  <!-- Abstract -->
237
- <xsl:if test="/nist:nist-standard/nist:preface/nist:abstract">
238
- <xsl:variable name="title-abstract">
239
- <xsl:call-template name="getTitle">
240
- <xsl:with-param name="name" select="'title-abstract'"/>
241
- </xsl:call-template>
242
- </xsl:variable>
243
- <fo:block font-family="Arial" text-align="center" font-weight="bold" color="{$color}" margin-bottom="12pt"><xsl:value-of select="$title-abstract"/></fo:block>
244
- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:abstract"/>
245
- </xsl:if>
241
+ <!-- Keywords -->
242
+ <!-- Acknowledgements -->
243
+ <xsl:apply-templates select="/nist:nist-standard/nist:preface/*"/>
244
+
245
+ <!-- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:abstract"/> -->
246
246
 
247
+ <!-- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:acknowledgements"/> -->
248
+
247
249
  <!-- Keywords -->
248
- <xsl:if test="/nist:nist-standard/nist:bibdata/nist:keyword">
250
+ <!-- <xsl:if test="/nist:nist-standard/nist:bibdata/nist:keyword">
249
251
  <fo:block font-family="Arial" text-align="center" font-weight="bold" color="{$color}" margin-bottom="12pt">
250
- <xsl:variable name="title-keywords">
251
- <xsl:call-template name="getTitle">
252
- <xsl:with-param name="name" select="'title-keywords'"/>
253
- </xsl:call-template>
254
- </xsl:variable>
255
- <xsl:value-of select="$title-keywords"/>
252
+ <xsl:call-template name="getLocalizedString">
253
+ <xsl:with-param name="key">keywords</xsl:with-param>
254
+ </xsl:call-template>
256
255
  </fo:block>
257
256
  <fo:block margin-bottom="12pt" text-align="justify">
258
257
  <xsl:call-template name="insertKeywords">
259
- <xsl:with-param name="charAtEnd"/>
258
+ <xsl:with-param name="charAtEnd"></xsl:with-param>
260
259
  <xsl:with-param name="charDelim">; </xsl:with-param>
261
260
  </xsl:call-template>
262
- <!-- <xsl:for-each select="/nist:nist-standard/nist:bibdata//nist:keyword">
263
- <xsl:sort data-type="text" order="ascending"/>
264
- <xsl:apply-templates/>
265
- <xsl:choose>
266
- <xsl:when test="position() != last()">; </xsl:when>
267
- <xsl:otherwise></xsl:otherwise>
268
- </xsl:choose>
269
- </xsl:for-each> -->
270
261
  </fo:block>
271
- </xsl:if>
272
-
273
- <xsl:if test="/nist:nist-standard/nist:preface/nist:acknowledgements">
274
- <xsl:variable name="title-acknowledgements">
275
- <xsl:call-template name="getTitle">
276
- <xsl:with-param name="name" select="'title-acknowledgements'"/>
277
- </xsl:call-template>
278
- </xsl:variable>
279
- <fo:block font-family="Arial" text-align="center" font-weight="bold" color="{$color}" margin-top="18pt" margin-bottom="12pt"><xsl:value-of select="$title-acknowledgements"/></fo:block>
280
- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:acknowledgements"/>
281
- </xsl:if>
282
-
262
+ </xsl:if> -->
283
263
 
284
264
  <!-- Disclaimer -->
285
265
  <!-- Additional Information -->
@@ -291,8 +271,9 @@
291
271
  <fo:block font-family="Arial" text-align="center" font-weight="bold" color="{$color}" margin-bottom="12pt">Feedback</fo:block>
292
272
  <xsl:text>Feedback on this publication is welcome, and can be sent to: code-signing@nist.gov.</xsl:text>
293
273
 
294
- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:clause"/>
295
-
274
+ <!-- Keywords -->
275
+ <!-- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:clause"/> -->
276
+
296
277
  <fo:block break-after="page"/>
297
278
 
298
279
  <!-- <xsl:apply-templates select="/nist:nist-standard/nist:preface/nist:foreword"/> -->
@@ -422,7 +403,7 @@
422
403
  <xsl:apply-templates select="/nist:nist-standard/nist:annex"/>
423
404
 
424
405
  <!-- Bibliography -->
425
- <xsl:apply-templates select="/nist:nist-standard/nist:bibliography/nist:references"/>
406
+ <xsl:apply-templates select="/nist:nist-standard/nist:bibliography"/>
426
407
 
427
408
  </fo:block>
428
409
 
@@ -621,13 +602,13 @@
621
602
  <!-- ====== -->
622
603
 
623
604
  <xsl:template match="nist:legal-statement//nist:title">
624
- <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" color="{$color}">
605
+ <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" color="{$color}" keep-with-next="always">
625
606
  <xsl:apply-templates/>
626
607
  </fo:block>
627
608
  </xsl:template>
628
609
 
629
610
  <xsl:template match="nist:executivesummary//nist:title">
630
- <fo:block-container color="white" background-color="black" margin-bottom="12pt">
611
+ <fo:block-container color="white" background-color="black" margin-bottom="12pt" keep-with-next="always">
631
612
  <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="left" margin-left="4mm" padding-top="1mm">
632
613
  <xsl:apply-templates/>
633
614
  </fo:block>
@@ -635,11 +616,19 @@
635
616
  </xsl:template>
636
617
 
637
618
  <xsl:template match="nist:preface//nist:title" priority="3">
638
- <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" space-before="12pt" margin-bottom="12pt" color="{$color}">
619
+ <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" space-before="12pt" margin-bottom="12pt" color="{$color}" keep-with-next="always">
620
+ <xsl:if test="local-name(..) = 'acknowledgements'">
621
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
622
+ </xsl:if>
639
623
  <xsl:apply-templates/>
640
624
  </fo:block>
641
625
  </xsl:template>
642
626
 
627
+ <xsl:template match="/nist:nist-standard/nist:bibliography">
628
+ <fo:block break-after="page"/>
629
+ <xsl:apply-templates/>
630
+ </xsl:template>
631
+
643
632
  <xsl:template match="nist:references">
644
633
  <fo:block id="{@id}">
645
634
  <xsl:apply-templates/>
@@ -1300,6 +1289,7 @@
1300
1289
 
1301
1290
 
1302
1291
 
1292
+
1303
1293
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1304
1294
 
1305
1295
 
@@ -1907,7 +1897,15 @@
1907
1897
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1908
1898
  <xsl:value-of select="@target"/>
1909
1899
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1910
- <xsl:variable name="math_text" select="normalize-space(.)"/>
1900
+ <xsl:variable name="mathml">
1901
+ <xsl:for-each select="*">
1902
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
1903
+ <xsl:copy-of select="."/>
1904
+ </xsl:if>
1905
+ </xsl:for-each>
1906
+ </xsl:variable>
1907
+
1908
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
1911
1909
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1912
1910
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1913
1911
  <xsl:param name="cols-count"/>
@@ -2898,6 +2896,10 @@
2898
2896
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2899
2897
  <xsl:apply-templates/>
2900
2898
  </fo:inline>
2899
+ </xsl:template><xsl:template match="*[local-name()='hi']">
2900
+ <fo:inline background-color="yellow">
2901
+ <xsl:apply-templates/>
2902
+ </fo:inline>
2901
2903
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
2902
2904
  <xsl:variable name="text" select="normalize-space(.)"/>
2903
2905
  <fo:inline font-size="75%">
@@ -3238,6 +3240,7 @@
3238
3240
  <xsl:apply-templates select="." mode="mathml"/>
3239
3241
  </xsl:variable>
3240
3242
  <fo:instream-foreign-object fox:alt-text="Math">
3243
+
3241
3244
  <!-- <xsl:copy-of select="."/> -->
3242
3245
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3243
3246
  </fo:instream-foreign-object>
@@ -3256,7 +3259,7 @@
3256
3259
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3257
3260
  </xsl:copy>
3258
3261
  <mathml:mspace width="0.5ex"/>
3259
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3262
+ </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3260
3263
  <xsl:variable name="target">
3261
3264
  <xsl:choose>
3262
3265
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3290,8 +3293,6 @@
3290
3293
  </xsl:otherwise>
3291
3294
  </xsl:choose>
3292
3295
  </fo:inline>
3293
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3294
- <fo:inline id="{@id}"/>
3295
3296
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3296
3297
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3297
3298
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -3502,6 +3503,7 @@
3502
3503
  <fo:block id="{@id}">
3503
3504
  <xsl:apply-templates/>
3504
3505
  </fo:block>
3506
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3505
3507
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3506
3508
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3507
3509
  <xsl:apply-templates/>
@@ -3515,6 +3517,9 @@
3515
3517
  <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3516
3518
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3517
3519
  </xsl:when>
3520
+ <xsl:when test="not(starts-with(@src, 'data:'))">
3521
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
3522
+ </xsl:when>
3518
3523
  <xsl:otherwise>
3519
3524
  <xsl:value-of select="@src"/>
3520
3525
  </xsl:otherwise>
@@ -4089,10 +4094,11 @@
4089
4094
  </xsl:choose>
4090
4095
 
4091
4096
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4092
-
4097
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
4093
4098
  <xsl:variable name="element">
4094
4099
  block
4095
4100
 
4101
+
4096
4102
  </xsl:variable>
4097
4103
  <xsl:choose>
4098
4104
  <xsl:when test="normalize-space($element) = 'block'">
@@ -4188,31 +4194,49 @@
4188
4194
  <xsl:text>— </xsl:text>
4189
4195
  <xsl:apply-templates/>
4190
4196
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
4191
- <fo:inline xsl:use-attribute-sets="eref-style">
4192
- <xsl:if test="@type = 'footnote'">
4193
-
4194
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4195
- <xsl:attribute name="font-size">80%</xsl:attribute>
4196
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4197
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4198
-
4199
-
4200
- </xsl:if>
4201
-
4202
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4203
-
4204
- <xsl:if test="@type = 'inline'">
4205
-
4206
-
4207
-
4208
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
4209
-
4210
- </xsl:if>
4211
-
4212
-
4213
- <xsl:apply-templates/>
4214
- </fo:basic-link>
4215
- </fo:inline>
4197
+
4198
+ <xsl:variable name="bibitemid">
4199
+ <xsl:choose>
4200
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
4201
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
4202
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
4203
+ </xsl:choose>
4204
+ </xsl:variable>
4205
+
4206
+ <xsl:choose>
4207
+ <xsl:when test="normalize-space($bibitemid) != ''">
4208
+ <fo:inline xsl:use-attribute-sets="eref-style">
4209
+ <xsl:if test="@type = 'footnote'">
4210
+
4211
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4212
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4213
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4214
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4215
+
4216
+
4217
+ </xsl:if>
4218
+
4219
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4220
+ <xsl:if test="normalize-space(@citeas) = ''">
4221
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4222
+ </xsl:if>
4223
+ <xsl:if test="@type = 'inline'">
4224
+
4225
+
4226
+
4227
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4228
+
4229
+ </xsl:if>
4230
+
4231
+ <xsl:apply-templates/>
4232
+ </fo:basic-link>
4233
+
4234
+ </fo:inline>
4235
+ </xsl:when>
4236
+ <xsl:otherwise>
4237
+ <fo:inline><xsl:apply-templates/></fo:inline>
4238
+ </xsl:otherwise>
4239
+ </xsl:choose>
4216
4240
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
4217
4241
  <!-- zero-space char -->
4218
4242
  <xsl:variable name="depth">
@@ -4396,6 +4420,153 @@
4396
4420
  </fo:block>
4397
4421
  </xsl:otherwise>
4398
4422
  </xsl:choose>
4423
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
4424
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
4425
+ <bookmark><xsl:value-of select="@id"/></bookmark>
4426
+ </xsl:for-each>
4427
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
4428
+ <xsl:copy>
4429
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
4430
+ </xsl:copy>
4431
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
4432
+ <xsl:variable name="id">
4433
+ <xsl:call-template name="generateIndexXrefId"/>
4434
+ </xsl:variable>
4435
+ <xsl:copy> <!-- add id to xref -->
4436
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
4437
+ <xsl:attribute name="id">
4438
+ <xsl:value-of select="$id"/>
4439
+ </xsl:attribute>
4440
+ <xsl:apply-templates mode="index_add_id"/>
4441
+ </xsl:copy>
4442
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
4443
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
4444
+ <xsl:if test="@to">
4445
+ <xsl:value-of select="$dash"/>
4446
+ <xsl:copy>
4447
+ <xsl:copy-of select="@*"/>
4448
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
4449
+ <xsl:attribute name="id">
4450
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
4451
+ </xsl:attribute>
4452
+ <xsl:apply-templates mode="index_add_id"/>
4453
+ </xsl:copy>
4454
+ </xsl:if>
4455
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
4456
+ <xsl:copy>
4457
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
4458
+ </xsl:copy>
4459
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
4460
+ <xsl:copy>
4461
+ <xsl:apply-templates select="@*" mode="index_update"/>
4462
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
4463
+ </xsl:copy>
4464
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
4465
+ <xsl:param name="element"/>
4466
+ <xsl:param name="remove" select="'false'"/>
4467
+ <xsl:param name="target"/>
4468
+ <!-- <node></node> -->
4469
+ <xsl:choose>
4470
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
4471
+ <!-- skip text (i.e. remove it) and process next element -->
4472
+ <!-- [removed_<xsl:value-of select="."/>] -->
4473
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4474
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
4475
+ </xsl:apply-templates>
4476
+ </xsl:when>
4477
+ <xsl:when test="self::text()">
4478
+ <xsl:value-of select="."/>
4479
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4480
+ </xsl:when>
4481
+ <xsl:when test="self::* and local-name(.) = 'xref'">
4482
+ <xsl:variable name="id" select="@id"/>
4483
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
4484
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
4485
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
4486
+
4487
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
4488
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
4489
+
4490
+ <xsl:choose>
4491
+ <!-- 2nd pass -->
4492
+ <!-- if page is equal to page for next and page is not the end of range -->
4493
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
4494
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
4495
+ <!-- [removed_xref] -->
4496
+
4497
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4498
+ <xsl:with-param name="remove">true</xsl:with-param>
4499
+ <xsl:with-param name="target">
4500
+ <xsl:choose>
4501
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
4502
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
4503
+ </xsl:choose>
4504
+ </xsl:with-param>
4505
+ </xsl:apply-templates>
4506
+ </xsl:when>
4507
+
4508
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
4509
+ <!-- remove xref -->
4510
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4511
+ <xsl:with-param name="remove">true</xsl:with-param>
4512
+ </xsl:apply-templates>
4513
+ </xsl:when>
4514
+
4515
+ <xsl:otherwise>
4516
+ <xsl:apply-templates select="." mode="xref_copy">
4517
+ <xsl:with-param name="target" select="$target"/>
4518
+ </xsl:apply-templates>
4519
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4520
+ </xsl:otherwise>
4521
+ </xsl:choose>
4522
+ </xsl:when>
4523
+ <xsl:when test="self::* and local-name(.) = 'ul'">
4524
+ <!-- ul -->
4525
+ <xsl:apply-templates select="." mode="index_update"/>
4526
+ </xsl:when>
4527
+ <xsl:otherwise>
4528
+ <xsl:apply-templates select="." mode="xref_copy">
4529
+ <xsl:with-param name="target" select="$target"/>
4530
+ </xsl:apply-templates>
4531
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4532
+ </xsl:otherwise>
4533
+ </xsl:choose>
4534
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
4535
+ <xsl:param name="target"/>
4536
+ <xsl:copy>
4537
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
4538
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
4539
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
4540
+ </xsl:if>
4541
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
4542
+ </xsl:copy>
4543
+ </xsl:template><xsl:template name="generateIndexXrefId">
4544
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4545
+
4546
+ <xsl:variable name="docid">
4547
+ <xsl:call-template name="getDocumentId"/>
4548
+ </xsl:variable>
4549
+ <xsl:variable name="item_number">
4550
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
4551
+ </xsl:variable>
4552
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
4553
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
4554
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
4555
+ <xsl:apply-templates/>
4556
+ <fo:block>
4557
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
4558
+ <fo:block> </fo:block>
4559
+ </xsl:if>
4560
+ </fo:block>
4561
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
4562
+ <xsl:apply-templates/>
4563
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
4564
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4565
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4566
+ <xsl:apply-templates/>
4567
+ </fo:block>
4568
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
4569
+ <fo:inline id="{@id}" font-size="1pt"/>
4399
4570
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4400
4571
  <!-- <row>
4401
4572
  <date>05-07-2013</date>
@@ -4614,70 +4785,68 @@
4614
4785
  <xsl:variable name="lang">
4615
4786
  <xsl:call-template name="getLang"/>
4616
4787
  </xsl:variable>
4617
- <fo:declarations>
4618
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4619
- <pdf:dictionary type="normal" key="ViewerPreferences">
4620
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4621
- </pdf:dictionary>
4622
- </pdf:catalog>
4623
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
4624
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4625
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4626
- <!-- Dublin Core properties go here -->
4627
- <dc:title>
4628
- <xsl:variable name="title">
4629
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4630
-
4631
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4632
-
4633
-
4634
-
4635
-
4636
-
4637
-
4638
- </xsl:for-each>
4639
- </xsl:variable>
4640
- <xsl:choose>
4641
- <xsl:when test="normalize-space($title) != ''">
4642
- <xsl:value-of select="$title"/>
4643
- </xsl:when>
4644
- <xsl:otherwise>
4645
- <xsl:text> </xsl:text>
4646
- </xsl:otherwise>
4647
- </xsl:choose>
4648
- </dc:title>
4649
- <dc:creator>
4788
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4789
+ <pdf:dictionary type="normal" key="ViewerPreferences">
4790
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4791
+ </pdf:dictionary>
4792
+ </pdf:catalog>
4793
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
4794
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4795
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4796
+ <!-- Dublin Core properties go here -->
4797
+ <dc:title>
4798
+ <xsl:variable name="title">
4650
4799
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4651
4800
 
4801
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4652
4802
 
4653
4803
 
4654
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4655
- <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
4656
- <xsl:if test="position() != last()">; </xsl:if>
4657
- </xsl:for-each>
4658
-
4659
- </xsl:for-each>
4660
- </dc:creator>
4661
- <dc:description>
4662
- <xsl:variable name="abstract">
4663
4804
 
4664
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4665
4805
 
4666
4806
 
4667
- </xsl:variable>
4668
- <xsl:value-of select="normalize-space($abstract)"/>
4669
- </dc:description>
4670
- <pdf:Keywords>
4671
- <xsl:call-template name="insertKeywords"/>
4672
- </pdf:Keywords>
4673
- </rdf:Description>
4674
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4675
- <!-- XMP properties go here -->
4676
- <xmp:CreatorTool/>
4677
- </rdf:Description>
4678
- </rdf:RDF>
4679
- </x:xmpmeta>
4680
- </fo:declarations>
4807
+
4808
+ </xsl:for-each>
4809
+ </xsl:variable>
4810
+ <xsl:choose>
4811
+ <xsl:when test="normalize-space($title) != ''">
4812
+ <xsl:value-of select="$title"/>
4813
+ </xsl:when>
4814
+ <xsl:otherwise>
4815
+ <xsl:text> </xsl:text>
4816
+ </xsl:otherwise>
4817
+ </xsl:choose>
4818
+ </dc:title>
4819
+ <dc:creator>
4820
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4821
+
4822
+
4823
+
4824
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4825
+ <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
4826
+ <xsl:if test="position() != last()">; </xsl:if>
4827
+ </xsl:for-each>
4828
+
4829
+ </xsl:for-each>
4830
+ </dc:creator>
4831
+ <dc:description>
4832
+ <xsl:variable name="abstract">
4833
+
4834
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4835
+
4836
+
4837
+ </xsl:variable>
4838
+ <xsl:value-of select="normalize-space($abstract)"/>
4839
+ </dc:description>
4840
+ <pdf:Keywords>
4841
+ <xsl:call-template name="insertKeywords"/>
4842
+ </pdf:Keywords>
4843
+ </rdf:Description>
4844
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4845
+ <!-- XMP properties go here -->
4846
+ <xmp:CreatorTool/>
4847
+ </rdf:Description>
4848
+ </rdf:RDF>
4849
+ </x:xmpmeta>
4681
4850
  </xsl:template><xsl:template name="getId">
4682
4851
  <xsl:choose>
4683
4852
  <xsl:when test="../@id">