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
 
@@ -86,7 +88,9 @@
86
88
  </fo:simple-page-master>
87
89
  </fo:layout-master-set>
88
90
 
89
- <xsl:call-template name="addPDFUAmeta"/>
91
+ <fo:declarations>
92
+ <xsl:call-template name="addPDFUAmeta"/>
93
+ </fo:declarations>
90
94
 
91
95
  <xsl:call-template name="addBookmarks">
92
96
  <xsl:with-param name="contents" select="$contents"/>
@@ -1470,7 +1474,7 @@
1470
1474
  </fo:block>
1471
1475
  </xsl:when>
1472
1476
  <xsl:when test="ancestor-or-self::nist:annex and $level &gt;= 2">
1473
- <fo:block font-family="Arial" font-size="12pt" font-weight="bold" text-align="center" margin-top="3pt" margin-bottom="12pt" keep-with-next="always">
1477
+ <fo:block font-family="Arial" font-size="12pt" font-weight="bold" margin-top="3pt" margin-bottom="12pt" keep-with-next="always"> <!-- text-align="center" -->
1474
1478
  <xsl:apply-templates/>
1475
1479
  </fo:block>
1476
1480
  </xsl:when>
@@ -1545,6 +1549,7 @@
1545
1549
  <fo:list-block>
1546
1550
  <xsl:attribute name="space-after">
1547
1551
  <xsl:choose>
1552
+ <xsl:when test="ancestor::nist:figure and not(following-sibling::*)">0pt</xsl:when>
1548
1553
  <xsl:when test="$margin != ''"><xsl:value-of select="$margin"/></xsl:when>
1549
1554
  <xsl:otherwise>12pt</xsl:otherwise>
1550
1555
  </xsl:choose>
@@ -1681,7 +1686,8 @@
1681
1686
  <fo:table-body>
1682
1687
  <fo:table-row>
1683
1688
  <fo:table-cell>
1684
- <fo:block text-align="left" margin-left="7mm">
1689
+ <!-- <fo:block text-align="left" margin-left="7mm"> -->
1690
+ <fo:block text-align="center" margin-left="7mm">
1685
1691
  <xsl:apply-templates/>
1686
1692
  </fo:block>
1687
1693
  </fo:table-cell>
@@ -1794,6 +1800,10 @@
1794
1800
  </fo:block>
1795
1801
  </xsl:template>
1796
1802
 
1803
+ <xsl:template match="nist:figure[@class='pseudocode']//nist:dd//nist:stem[count(ancestor::nist:dd/nist:p) = 1 and normalize-space(ancestor::nist:dd/nist:p/text()) = '']" priority="2">
1804
+ <fo:inline><xsl:apply-templates/></fo:inline>
1805
+ </xsl:template>
1806
+
1797
1807
  <xsl:template match="nist:dd//nist:stem[count(ancestor::nist:dd/nist:p) = 1 and normalize-space(ancestor::nist:dd/nist:p/text()) = '']">
1798
1808
  <fo:block text-align="center">
1799
1809
  <xsl:apply-templates/>
@@ -1806,6 +1816,37 @@
1806
1816
  </fo:block>
1807
1817
  </xsl:template>
1808
1818
 
1819
+ <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']" priority="2">
1820
+ <fo:block-container id="{@id}" border="1pt solid black" background-color="rgb(230, 230, 230)" padding="1.5mm" space-before="6pt" space-after="6pt">
1821
+ <xsl:apply-templates/>
1822
+ </fo:block-container>
1823
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1824
+ </xsl:template>
1825
+
1826
+ <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name()='dl']" priority="2">
1827
+ <fo:block-container id="{@id}">
1828
+ <xsl:apply-templates/>
1829
+ </fo:block-container>
1830
+ </xsl:template>
1831
+
1832
+ <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name()='dt']" priority="2">
1833
+ <fo:block>
1834
+ <xsl:if test="following-sibling::*[local-name()='dt'] or ancestor::*[local-name()='dd']/following-sibling::*[local-name()='dt']">
1835
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
1836
+ </xsl:if>
1837
+ <xsl:if test="preceding-sibling::*[local-name()='dt'] or ancestor::*[local-name()='dd']/preceding-sibling::*[local-name()='dt']">
1838
+ <xsl:attribute name="margin-top">2pt</xsl:attribute>
1839
+ </xsl:if>
1840
+ <xsl:apply-templates/>
1841
+ <fo:inline>: </fo:inline>
1842
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
1843
+ </fo:block>
1844
+ </xsl:template>
1845
+
1846
+ <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name()='dd']/*[local-name()='p']" priority="2">
1847
+ <fo:inline><xsl:apply-templates/></fo:inline>
1848
+ </xsl:template>
1849
+
1809
1850
  <!-- <xsl:template match="nist:dl[@type = 'glossary']" priority="2">
1810
1851
  <xsl:apply-templates />
1811
1852
  </xsl:template>
@@ -2347,6 +2388,7 @@
2347
2388
 
2348
2389
 
2349
2390
 
2391
+
2350
2392
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
2351
2393
 
2352
2394
 
@@ -2945,7 +2987,15 @@
2945
2987
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2946
2988
  <xsl:value-of select="@target"/>
2947
2989
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2948
- <xsl:variable name="math_text" select="normalize-space(.)"/>
2990
+ <xsl:variable name="mathml">
2991
+ <xsl:for-each select="*">
2992
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2993
+ <xsl:copy-of select="."/>
2994
+ </xsl:if>
2995
+ </xsl:for-each>
2996
+ </xsl:variable>
2997
+
2998
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2949
2999
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2950
3000
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2951
3001
  <xsl:param name="cols-count"/>
@@ -3936,6 +3986,10 @@
3936
3986
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3937
3987
  <xsl:apply-templates/>
3938
3988
  </fo:inline>
3989
+ </xsl:template><xsl:template match="*[local-name()='hi']">
3990
+ <fo:inline background-color="yellow">
3991
+ <xsl:apply-templates/>
3992
+ </fo:inline>
3939
3993
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
3940
3994
  <xsl:variable name="text" select="normalize-space(.)"/>
3941
3995
  <fo:inline font-size="75%">
@@ -4276,6 +4330,7 @@
4276
4330
  <xsl:apply-templates select="." mode="mathml"/>
4277
4331
  </xsl:variable>
4278
4332
  <fo:instream-foreign-object fox:alt-text="Math">
4333
+
4279
4334
  <!-- <xsl:copy-of select="."/> -->
4280
4335
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4281
4336
  </fo:instream-foreign-object>
@@ -4294,7 +4349,7 @@
4294
4349
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
4295
4350
  </xsl:copy>
4296
4351
  <mathml:mspace width="0.5ex"/>
4297
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4352
+ </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">
4298
4353
  <xsl:variable name="target">
4299
4354
  <xsl:choose>
4300
4355
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -4328,8 +4383,6 @@
4328
4383
  </xsl:otherwise>
4329
4384
  </xsl:choose>
4330
4385
  </fo:inline>
4331
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
4332
- <fo:inline id="{@id}"/>
4333
4386
  </xsl:template><xsl:template match="*[local-name()='appendix']">
4334
4387
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
4335
4388
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -4540,6 +4593,7 @@
4540
4593
  <fo:block id="{@id}">
4541
4594
  <xsl:apply-templates/>
4542
4595
  </fo:block>
4596
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4543
4597
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
4544
4598
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
4545
4599
  <xsl:apply-templates/>
@@ -4553,6 +4607,9 @@
4553
4607
  <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
4554
4608
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
4555
4609
  </xsl:when>
4610
+ <xsl:when test="not(starts-with(@src, 'data:'))">
4611
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
4612
+ </xsl:when>
4556
4613
  <xsl:otherwise>
4557
4614
  <xsl:value-of select="@src"/>
4558
4615
  </xsl:otherwise>
@@ -5156,10 +5213,11 @@
5156
5213
  </xsl:choose>
5157
5214
 
5158
5215
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
5159
-
5216
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
5160
5217
  <xsl:variable name="element">
5161
5218
  block
5162
5219
 
5220
+
5163
5221
  </xsl:variable>
5164
5222
  <xsl:choose>
5165
5223
  <xsl:when test="normalize-space($element) = 'block'">
@@ -5250,31 +5308,49 @@
5250
5308
  <xsl:text>— </xsl:text>
5251
5309
  <xsl:apply-templates/>
5252
5310
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
5253
- <fo:inline xsl:use-attribute-sets="eref-style">
5254
- <xsl:if test="@type = 'footnote'">
5255
-
5256
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5257
- <xsl:attribute name="font-size">80%</xsl:attribute>
5258
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5259
- <xsl:attribute name="vertical-align">super</xsl:attribute>
5260
-
5261
-
5262
- </xsl:if>
5263
-
5264
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5265
-
5266
- <xsl:if test="@type = 'inline'">
5267
-
5268
-
5269
-
5270
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
5271
-
5272
- </xsl:if>
5273
-
5274
-
5275
- <xsl:apply-templates/>
5276
- </fo:basic-link>
5277
- </fo:inline>
5311
+
5312
+ <xsl:variable name="bibitemid">
5313
+ <xsl:choose>
5314
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
5315
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
5316
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
5317
+ </xsl:choose>
5318
+ </xsl:variable>
5319
+
5320
+ <xsl:choose>
5321
+ <xsl:when test="normalize-space($bibitemid) != ''">
5322
+ <fo:inline xsl:use-attribute-sets="eref-style">
5323
+ <xsl:if test="@type = 'footnote'">
5324
+
5325
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5326
+ <xsl:attribute name="font-size">80%</xsl:attribute>
5327
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5328
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5329
+
5330
+
5331
+ </xsl:if>
5332
+
5333
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5334
+ <xsl:if test="normalize-space(@citeas) = ''">
5335
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
5336
+ </xsl:if>
5337
+ <xsl:if test="@type = 'inline'">
5338
+
5339
+
5340
+
5341
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
5342
+
5343
+ </xsl:if>
5344
+
5345
+ <xsl:apply-templates/>
5346
+ </fo:basic-link>
5347
+
5348
+ </fo:inline>
5349
+ </xsl:when>
5350
+ <xsl:otherwise>
5351
+ <fo:inline><xsl:apply-templates/></fo:inline>
5352
+ </xsl:otherwise>
5353
+ </xsl:choose>
5278
5354
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
5279
5355
  <!-- zero-space char -->
5280
5356
  <xsl:variable name="depth">
@@ -5459,6 +5535,153 @@
5459
5535
  </fo:block>
5460
5536
  </xsl:otherwise>
5461
5537
  </xsl:choose>
5538
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
5539
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
5540
+ <bookmark><xsl:value-of select="@id"/></bookmark>
5541
+ </xsl:for-each>
5542
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
5543
+ <xsl:copy>
5544
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
5545
+ </xsl:copy>
5546
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
5547
+ <xsl:variable name="id">
5548
+ <xsl:call-template name="generateIndexXrefId"/>
5549
+ </xsl:variable>
5550
+ <xsl:copy> <!-- add id to xref -->
5551
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
5552
+ <xsl:attribute name="id">
5553
+ <xsl:value-of select="$id"/>
5554
+ </xsl:attribute>
5555
+ <xsl:apply-templates mode="index_add_id"/>
5556
+ </xsl:copy>
5557
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
5558
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
5559
+ <xsl:if test="@to">
5560
+ <xsl:value-of select="$dash"/>
5561
+ <xsl:copy>
5562
+ <xsl:copy-of select="@*"/>
5563
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
5564
+ <xsl:attribute name="id">
5565
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
5566
+ </xsl:attribute>
5567
+ <xsl:apply-templates mode="index_add_id"/>
5568
+ </xsl:copy>
5569
+ </xsl:if>
5570
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
5571
+ <xsl:copy>
5572
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
5573
+ </xsl:copy>
5574
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
5575
+ <xsl:copy>
5576
+ <xsl:apply-templates select="@*" mode="index_update"/>
5577
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
5578
+ </xsl:copy>
5579
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
5580
+ <xsl:param name="element"/>
5581
+ <xsl:param name="remove" select="'false'"/>
5582
+ <xsl:param name="target"/>
5583
+ <!-- <node></node> -->
5584
+ <xsl:choose>
5585
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
5586
+ <!-- skip text (i.e. remove it) and process next element -->
5587
+ <!-- [removed_<xsl:value-of select="."/>] -->
5588
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5589
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
5590
+ </xsl:apply-templates>
5591
+ </xsl:when>
5592
+ <xsl:when test="self::text()">
5593
+ <xsl:value-of select="."/>
5594
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5595
+ </xsl:when>
5596
+ <xsl:when test="self::* and local-name(.) = 'xref'">
5597
+ <xsl:variable name="id" select="@id"/>
5598
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
5599
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
5600
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
5601
+
5602
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
5603
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
5604
+
5605
+ <xsl:choose>
5606
+ <!-- 2nd pass -->
5607
+ <!-- if page is equal to page for next and page is not the end of range -->
5608
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
5609
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
5610
+ <!-- [removed_xref] -->
5611
+
5612
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5613
+ <xsl:with-param name="remove">true</xsl:with-param>
5614
+ <xsl:with-param name="target">
5615
+ <xsl:choose>
5616
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
5617
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
5618
+ </xsl:choose>
5619
+ </xsl:with-param>
5620
+ </xsl:apply-templates>
5621
+ </xsl:when>
5622
+
5623
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
5624
+ <!-- remove xref -->
5625
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5626
+ <xsl:with-param name="remove">true</xsl:with-param>
5627
+ </xsl:apply-templates>
5628
+ </xsl:when>
5629
+
5630
+ <xsl:otherwise>
5631
+ <xsl:apply-templates select="." mode="xref_copy">
5632
+ <xsl:with-param name="target" select="$target"/>
5633
+ </xsl:apply-templates>
5634
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5635
+ </xsl:otherwise>
5636
+ </xsl:choose>
5637
+ </xsl:when>
5638
+ <xsl:when test="self::* and local-name(.) = 'ul'">
5639
+ <!-- ul -->
5640
+ <xsl:apply-templates select="." mode="index_update"/>
5641
+ </xsl:when>
5642
+ <xsl:otherwise>
5643
+ <xsl:apply-templates select="." mode="xref_copy">
5644
+ <xsl:with-param name="target" select="$target"/>
5645
+ </xsl:apply-templates>
5646
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5647
+ </xsl:otherwise>
5648
+ </xsl:choose>
5649
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
5650
+ <xsl:param name="target"/>
5651
+ <xsl:copy>
5652
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
5653
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
5654
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
5655
+ </xsl:if>
5656
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
5657
+ </xsl:copy>
5658
+ </xsl:template><xsl:template name="generateIndexXrefId">
5659
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5660
+
5661
+ <xsl:variable name="docid">
5662
+ <xsl:call-template name="getDocumentId"/>
5663
+ </xsl:variable>
5664
+ <xsl:variable name="item_number">
5665
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
5666
+ </xsl:variable>
5667
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
5668
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
5669
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
5670
+ <xsl:apply-templates/>
5671
+ <fo:block>
5672
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
5673
+ <fo:block> </fo:block>
5674
+ </xsl:if>
5675
+ </fo:block>
5676
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
5677
+ <xsl:apply-templates/>
5678
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5679
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5680
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5681
+ <xsl:apply-templates/>
5682
+ </fo:block>
5683
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
5684
+ <fo:inline id="{@id}" font-size="1pt"/>
5462
5685
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
5463
5686
  <!-- <row>
5464
5687
  <date>05-07-2013</date>
@@ -5677,70 +5900,68 @@
5677
5900
  <xsl:variable name="lang">
5678
5901
  <xsl:call-template name="getLang"/>
5679
5902
  </xsl:variable>
5680
- <fo:declarations>
5681
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5682
- <pdf:dictionary type="normal" key="ViewerPreferences">
5683
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5684
- </pdf:dictionary>
5685
- </pdf:catalog>
5686
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
5687
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5688
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5689
- <!-- Dublin Core properties go here -->
5690
- <dc:title>
5691
- <xsl:variable name="title">
5692
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5693
-
5694
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
5695
-
5696
-
5697
-
5698
-
5699
-
5700
-
5701
- </xsl:for-each>
5702
- </xsl:variable>
5703
- <xsl:choose>
5704
- <xsl:when test="normalize-space($title) != ''">
5705
- <xsl:value-of select="$title"/>
5706
- </xsl:when>
5707
- <xsl:otherwise>
5708
- <xsl:text> </xsl:text>
5709
- </xsl:otherwise>
5710
- </xsl:choose>
5711
- </dc:title>
5712
- <dc:creator>
5903
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5904
+ <pdf:dictionary type="normal" key="ViewerPreferences">
5905
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5906
+ </pdf:dictionary>
5907
+ </pdf:catalog>
5908
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
5909
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5910
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5911
+ <!-- Dublin Core properties go here -->
5912
+ <dc:title>
5913
+ <xsl:variable name="title">
5713
5914
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5714
5915
 
5916
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
5715
5917
 
5716
5918
 
5717
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5718
- <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
5719
- <xsl:if test="position() != last()">; </xsl:if>
5720
- </xsl:for-each>
5721
-
5722
- </xsl:for-each>
5723
- </dc:creator>
5724
- <dc:description>
5725
- <xsl:variable name="abstract">
5726
5919
 
5727
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5728
5920
 
5729
5921
 
5730
- </xsl:variable>
5731
- <xsl:value-of select="normalize-space($abstract)"/>
5732
- </dc:description>
5733
- <pdf:Keywords>
5734
- <xsl:call-template name="insertKeywords"/>
5735
- </pdf:Keywords>
5736
- </rdf:Description>
5737
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5738
- <!-- XMP properties go here -->
5739
- <xmp:CreatorTool/>
5740
- </rdf:Description>
5741
- </rdf:RDF>
5742
- </x:xmpmeta>
5743
- </fo:declarations>
5922
+
5923
+ </xsl:for-each>
5924
+ </xsl:variable>
5925
+ <xsl:choose>
5926
+ <xsl:when test="normalize-space($title) != ''">
5927
+ <xsl:value-of select="$title"/>
5928
+ </xsl:when>
5929
+ <xsl:otherwise>
5930
+ <xsl:text> </xsl:text>
5931
+ </xsl:otherwise>
5932
+ </xsl:choose>
5933
+ </dc:title>
5934
+ <dc:creator>
5935
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5936
+
5937
+
5938
+
5939
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5940
+ <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
5941
+ <xsl:if test="position() != last()">; </xsl:if>
5942
+ </xsl:for-each>
5943
+
5944
+ </xsl:for-each>
5945
+ </dc:creator>
5946
+ <dc:description>
5947
+ <xsl:variable name="abstract">
5948
+
5949
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5950
+
5951
+
5952
+ </xsl:variable>
5953
+ <xsl:value-of select="normalize-space($abstract)"/>
5954
+ </dc:description>
5955
+ <pdf:Keywords>
5956
+ <xsl:call-template name="insertKeywords"/>
5957
+ </pdf:Keywords>
5958
+ </rdf:Description>
5959
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5960
+ <!-- XMP properties go here -->
5961
+ <xmp:CreatorTool/>
5962
+ </rdf:Description>
5963
+ </rdf:RDF>
5964
+ </x:xmpmeta>
5744
5965
  </xsl:template><xsl:template name="getId">
5745
5966
  <xsl:choose>
5746
5967
  <xsl:when test="../@id">