metanorma-un 0.5.14 → 0.5.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,7 @@
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
5
  <xsl:param name="svg_images"/>
6
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
6
7
  <xsl:variable name="images" select="document($svg_images)"/>
7
8
 
8
9
 
@@ -72,7 +73,9 @@
72
73
  </fo:page-sequence-master>
73
74
  </fo:layout-master-set>
74
75
 
75
- <xsl:call-template name="addPDFUAmeta"/>
76
+ <fo:declarations>
77
+ <xsl:call-template name="addPDFUAmeta"/>
78
+ </fo:declarations>
76
79
 
77
80
  <xsl:call-template name="addBookmarks">
78
81
  <xsl:with-param name="contents" select="$contents"/>
@@ -1448,6 +1451,7 @@
1448
1451
 
1449
1452
 
1450
1453
 
1454
+
1451
1455
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1452
1456
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1453
1457
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2047,7 +2051,15 @@
2047
2051
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2048
2052
  <xsl:value-of select="@target"/>
2049
2053
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2050
- <xsl:variable name="math_text" select="normalize-space(.)"/>
2054
+ <xsl:variable name="mathml">
2055
+ <xsl:for-each select="*">
2056
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2057
+ <xsl:copy-of select="."/>
2058
+ </xsl:if>
2059
+ </xsl:for-each>
2060
+ </xsl:variable>
2061
+
2062
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2051
2063
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2052
2064
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2053
2065
  <xsl:param name="cols-count"/>
@@ -3026,6 +3038,10 @@
3026
3038
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3027
3039
  <xsl:apply-templates/>
3028
3040
  </fo:inline>
3041
+ </xsl:template><xsl:template match="*[local-name()='hi']">
3042
+ <fo:inline background-color="yellow">
3043
+ <xsl:apply-templates/>
3044
+ </fo:inline>
3029
3045
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
3030
3046
  <xsl:variable name="text" select="normalize-space(.)"/>
3031
3047
  <fo:inline font-size="75%">
@@ -3366,6 +3382,7 @@
3366
3382
  <xsl:apply-templates select="." mode="mathml"/>
3367
3383
  </xsl:variable>
3368
3384
  <fo:instream-foreign-object fox:alt-text="Math">
3385
+
3369
3386
  <!-- <xsl:copy-of select="."/> -->
3370
3387
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3371
3388
  </fo:instream-foreign-object>
@@ -3384,7 +3401,7 @@
3384
3401
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3385
3402
  </xsl:copy>
3386
3403
  <mathml:mspace width="0.5ex"/>
3387
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3404
+ </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">
3388
3405
  <xsl:variable name="target">
3389
3406
  <xsl:choose>
3390
3407
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3418,8 +3435,6 @@
3418
3435
  </xsl:otherwise>
3419
3436
  </xsl:choose>
3420
3437
  </fo:inline>
3421
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3422
- <fo:inline id="{@id}"/>
3423
3438
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3424
3439
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3425
3440
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -3639,6 +3654,7 @@
3639
3654
  <fo:block id="{@id}">
3640
3655
  <xsl:apply-templates/>
3641
3656
  </fo:block>
3657
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3642
3658
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3643
3659
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3644
3660
  <xsl:apply-templates/>
@@ -4222,10 +4238,11 @@
4222
4238
  </xsl:choose>
4223
4239
 
4224
4240
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4225
-
4241
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
4226
4242
  <xsl:variable name="element">
4227
4243
  block
4228
4244
 
4245
+
4229
4246
  </xsl:variable>
4230
4247
  <xsl:choose>
4231
4248
  <xsl:when test="normalize-space($element) = 'block'">
@@ -4321,31 +4338,49 @@
4321
4338
  <xsl:text>— </xsl:text>
4322
4339
  <xsl:apply-templates/>
4323
4340
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
4324
- <fo:inline xsl:use-attribute-sets="eref-style">
4325
- <xsl:if test="@type = 'footnote'">
4326
-
4327
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4328
- <xsl:attribute name="font-size">80%</xsl:attribute>
4329
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4330
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4331
-
4332
-
4333
- </xsl:if>
4334
-
4335
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4336
-
4337
- <xsl:if test="@type = 'inline'">
4338
-
4339
-
4340
-
4341
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
4342
-
4343
- </xsl:if>
4344
-
4345
-
4346
- <xsl:apply-templates/>
4347
- </fo:basic-link>
4348
- </fo:inline>
4341
+
4342
+ <xsl:variable name="bibitemid">
4343
+ <xsl:choose>
4344
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
4345
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
4346
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
4347
+ </xsl:choose>
4348
+ </xsl:variable>
4349
+
4350
+ <xsl:choose>
4351
+ <xsl:when test="normalize-space($bibitemid) != ''">
4352
+ <fo:inline xsl:use-attribute-sets="eref-style">
4353
+ <xsl:if test="@type = 'footnote'">
4354
+
4355
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4356
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4357
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4358
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4359
+
4360
+
4361
+ </xsl:if>
4362
+
4363
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4364
+ <xsl:if test="normalize-space(@citeas) = ''">
4365
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4366
+ </xsl:if>
4367
+ <xsl:if test="@type = 'inline'">
4368
+
4369
+
4370
+
4371
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4372
+
4373
+ </xsl:if>
4374
+
4375
+ <xsl:apply-templates/>
4376
+ </fo:basic-link>
4377
+
4378
+ </fo:inline>
4379
+ </xsl:when>
4380
+ <xsl:otherwise>
4381
+ <fo:inline><xsl:apply-templates/></fo:inline>
4382
+ </xsl:otherwise>
4383
+ </xsl:choose>
4349
4384
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
4350
4385
  <!-- zero-space char -->
4351
4386
  <xsl:variable name="depth">
@@ -4533,6 +4568,153 @@
4533
4568
  </fo:block>
4534
4569
  </xsl:otherwise>
4535
4570
  </xsl:choose>
4571
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
4572
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
4573
+ <bookmark><xsl:value-of select="@id"/></bookmark>
4574
+ </xsl:for-each>
4575
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
4576
+ <xsl:copy>
4577
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
4578
+ </xsl:copy>
4579
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
4580
+ <xsl:variable name="id">
4581
+ <xsl:call-template name="generateIndexXrefId"/>
4582
+ </xsl:variable>
4583
+ <xsl:copy> <!-- add id to xref -->
4584
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
4585
+ <xsl:attribute name="id">
4586
+ <xsl:value-of select="$id"/>
4587
+ </xsl:attribute>
4588
+ <xsl:apply-templates mode="index_add_id"/>
4589
+ </xsl:copy>
4590
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
4591
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
4592
+ <xsl:if test="@to">
4593
+ <xsl:value-of select="$dash"/>
4594
+ <xsl:copy>
4595
+ <xsl:copy-of select="@*"/>
4596
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
4597
+ <xsl:attribute name="id">
4598
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
4599
+ </xsl:attribute>
4600
+ <xsl:apply-templates mode="index_add_id"/>
4601
+ </xsl:copy>
4602
+ </xsl:if>
4603
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
4604
+ <xsl:copy>
4605
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
4606
+ </xsl:copy>
4607
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
4608
+ <xsl:copy>
4609
+ <xsl:apply-templates select="@*" mode="index_update"/>
4610
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
4611
+ </xsl:copy>
4612
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
4613
+ <xsl:param name="element"/>
4614
+ <xsl:param name="remove" select="'false'"/>
4615
+ <xsl:param name="target"/>
4616
+ <!-- <node></node> -->
4617
+ <xsl:choose>
4618
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
4619
+ <!-- skip text (i.e. remove it) and process next element -->
4620
+ <!-- [removed_<xsl:value-of select="."/>] -->
4621
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4622
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
4623
+ </xsl:apply-templates>
4624
+ </xsl:when>
4625
+ <xsl:when test="self::text()">
4626
+ <xsl:value-of select="."/>
4627
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4628
+ </xsl:when>
4629
+ <xsl:when test="self::* and local-name(.) = 'xref'">
4630
+ <xsl:variable name="id" select="@id"/>
4631
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
4632
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
4633
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
4634
+
4635
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
4636
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
4637
+
4638
+ <xsl:choose>
4639
+ <!-- 2nd pass -->
4640
+ <!-- if page is equal to page for next and page is not the end of range -->
4641
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
4642
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
4643
+ <!-- [removed_xref] -->
4644
+
4645
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4646
+ <xsl:with-param name="remove">true</xsl:with-param>
4647
+ <xsl:with-param name="target">
4648
+ <xsl:choose>
4649
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
4650
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
4651
+ </xsl:choose>
4652
+ </xsl:with-param>
4653
+ </xsl:apply-templates>
4654
+ </xsl:when>
4655
+
4656
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
4657
+ <!-- remove xref -->
4658
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4659
+ <xsl:with-param name="remove">true</xsl:with-param>
4660
+ </xsl:apply-templates>
4661
+ </xsl:when>
4662
+
4663
+ <xsl:otherwise>
4664
+ <xsl:apply-templates select="." mode="xref_copy">
4665
+ <xsl:with-param name="target" select="$target"/>
4666
+ </xsl:apply-templates>
4667
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4668
+ </xsl:otherwise>
4669
+ </xsl:choose>
4670
+ </xsl:when>
4671
+ <xsl:when test="self::* and local-name(.) = 'ul'">
4672
+ <!-- ul -->
4673
+ <xsl:apply-templates select="." mode="index_update"/>
4674
+ </xsl:when>
4675
+ <xsl:otherwise>
4676
+ <xsl:apply-templates select="." mode="xref_copy">
4677
+ <xsl:with-param name="target" select="$target"/>
4678
+ </xsl:apply-templates>
4679
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4680
+ </xsl:otherwise>
4681
+ </xsl:choose>
4682
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
4683
+ <xsl:param name="target"/>
4684
+ <xsl:copy>
4685
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
4686
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
4687
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
4688
+ </xsl:if>
4689
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
4690
+ </xsl:copy>
4691
+ </xsl:template><xsl:template name="generateIndexXrefId">
4692
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4693
+
4694
+ <xsl:variable name="docid">
4695
+ <xsl:call-template name="getDocumentId"/>
4696
+ </xsl:variable>
4697
+ <xsl:variable name="item_number">
4698
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
4699
+ </xsl:variable>
4700
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
4701
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
4702
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
4703
+ <xsl:apply-templates/>
4704
+ <fo:block>
4705
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
4706
+ <fo:block> </fo:block>
4707
+ </xsl:if>
4708
+ </fo:block>
4709
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
4710
+ <xsl:apply-templates/>
4711
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
4712
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4713
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4714
+ <xsl:apply-templates/>
4715
+ </fo:block>
4716
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
4717
+ <fo:inline id="{@id}"/>
4536
4718
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4537
4719
  <!-- <row>
4538
4720
  <date>05-07-2013</date>
@@ -4749,70 +4931,68 @@
4749
4931
  <xsl:variable name="lang">
4750
4932
  <xsl:call-template name="getLang"/>
4751
4933
  </xsl:variable>
4752
- <fo:declarations>
4753
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4754
- <pdf:dictionary type="normal" key="ViewerPreferences">
4755
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4756
- </pdf:dictionary>
4757
- </pdf:catalog>
4758
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
4759
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4760
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4761
- <!-- Dublin Core properties go here -->
4762
- <dc:title>
4763
- <xsl:variable name="title">
4764
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4765
-
4766
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4767
-
4768
-
4769
-
4770
-
4771
-
4772
-
4773
- </xsl:for-each>
4774
- </xsl:variable>
4775
- <xsl:choose>
4776
- <xsl:when test="normalize-space($title) != ''">
4777
- <xsl:value-of select="$title"/>
4778
- </xsl:when>
4779
- <xsl:otherwise>
4780
- <xsl:text> </xsl:text>
4781
- </xsl:otherwise>
4782
- </xsl:choose>
4783
- </dc:title>
4784
- <dc:creator>
4934
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4935
+ <pdf:dictionary type="normal" key="ViewerPreferences">
4936
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4937
+ </pdf:dictionary>
4938
+ </pdf:catalog>
4939
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
4940
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4941
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4942
+ <!-- Dublin Core properties go here -->
4943
+ <dc:title>
4944
+ <xsl:variable name="title">
4785
4945
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4786
4946
 
4787
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4788
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4789
- <xsl:if test="position() != last()">; </xsl:if>
4790
- </xsl:for-each>
4791
-
4947
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4792
4948
 
4793
4949
 
4794
- </xsl:for-each>
4795
- </dc:creator>
4796
- <dc:description>
4797
- <xsl:variable name="abstract">
4798
4950
 
4799
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4800
4951
 
4801
4952
 
4802
- </xsl:variable>
4803
- <xsl:value-of select="normalize-space($abstract)"/>
4804
- </dc:description>
4805
- <pdf:Keywords>
4806
- <xsl:call-template name="insertKeywords"/>
4807
- </pdf:Keywords>
4808
- </rdf:Description>
4809
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4810
- <!-- XMP properties go here -->
4811
- <xmp:CreatorTool/>
4812
- </rdf:Description>
4813
- </rdf:RDF>
4814
- </x:xmpmeta>
4815
- </fo:declarations>
4953
+
4954
+ </xsl:for-each>
4955
+ </xsl:variable>
4956
+ <xsl:choose>
4957
+ <xsl:when test="normalize-space($title) != ''">
4958
+ <xsl:value-of select="$title"/>
4959
+ </xsl:when>
4960
+ <xsl:otherwise>
4961
+ <xsl:text> </xsl:text>
4962
+ </xsl:otherwise>
4963
+ </xsl:choose>
4964
+ </dc:title>
4965
+ <dc:creator>
4966
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4967
+
4968
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4969
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4970
+ <xsl:if test="position() != last()">; </xsl:if>
4971
+ </xsl:for-each>
4972
+
4973
+
4974
+
4975
+ </xsl:for-each>
4976
+ </dc:creator>
4977
+ <dc:description>
4978
+ <xsl:variable name="abstract">
4979
+
4980
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4981
+
4982
+
4983
+ </xsl:variable>
4984
+ <xsl:value-of select="normalize-space($abstract)"/>
4985
+ </dc:description>
4986
+ <pdf:Keywords>
4987
+ <xsl:call-template name="insertKeywords"/>
4988
+ </pdf:Keywords>
4989
+ </rdf:Description>
4990
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4991
+ <!-- XMP properties go here -->
4992
+ <xmp:CreatorTool/>
4993
+ </rdf:Description>
4994
+ </rdf:RDF>
4995
+ </x:xmpmeta>
4816
4996
  </xsl:template><xsl:template name="getId">
4817
4997
  <xsl:choose>
4818
4998
  <xsl:when test="../@id">
@@ -3,6 +3,7 @@
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
5
  <xsl:param name="svg_images"/>
6
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
6
7
  <xsl:variable name="images" select="document($svg_images)"/>
7
8
 
8
9
 
@@ -83,7 +84,9 @@
83
84
 
84
85
  </fo:layout-master-set>
85
86
 
86
- <xsl:call-template name="addPDFUAmeta"/>
87
+ <fo:declarations>
88
+ <xsl:call-template name="addPDFUAmeta"/>
89
+ </fo:declarations>
87
90
 
88
91
  <xsl:call-template name="addBookmarks">
89
92
  <xsl:with-param name="contents" select="$contents"/>
@@ -1307,6 +1310,7 @@
1307
1310
 
1308
1311
 
1309
1312
 
1313
+
1310
1314
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1311
1315
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1312
1316
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1912,7 +1916,15 @@
1912
1916
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1913
1917
  <xsl:value-of select="@target"/>
1914
1918
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1915
- <xsl:variable name="math_text" select="normalize-space(.)"/>
1919
+ <xsl:variable name="mathml">
1920
+ <xsl:for-each select="*">
1921
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
1922
+ <xsl:copy-of select="."/>
1923
+ </xsl:if>
1924
+ </xsl:for-each>
1925
+ </xsl:variable>
1926
+
1927
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
1916
1928
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1917
1929
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1918
1930
  <xsl:param name="cols-count"/>
@@ -2891,6 +2903,10 @@
2891
2903
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2892
2904
  <xsl:apply-templates/>
2893
2905
  </fo:inline>
2906
+ </xsl:template><xsl:template match="*[local-name()='hi']">
2907
+ <fo:inline background-color="yellow">
2908
+ <xsl:apply-templates/>
2909
+ </fo:inline>
2894
2910
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
2895
2911
  <xsl:variable name="text" select="normalize-space(.)"/>
2896
2912
  <fo:inline font-size="75%">
@@ -3231,6 +3247,7 @@
3231
3247
  <xsl:apply-templates select="." mode="mathml"/>
3232
3248
  </xsl:variable>
3233
3249
  <fo:instream-foreign-object fox:alt-text="Math">
3250
+
3234
3251
  <!-- <xsl:copy-of select="."/> -->
3235
3252
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3236
3253
  </fo:instream-foreign-object>
@@ -3249,7 +3266,7 @@
3249
3266
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3250
3267
  </xsl:copy>
3251
3268
  <mathml:mspace width="0.5ex"/>
3252
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3269
+ </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">
3253
3270
  <xsl:variable name="target">
3254
3271
  <xsl:choose>
3255
3272
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3283,8 +3300,6 @@
3283
3300
  </xsl:otherwise>
3284
3301
  </xsl:choose>
3285
3302
  </fo:inline>
3286
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3287
- <fo:inline id="{@id}"/>
3288
3303
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3289
3304
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3290
3305
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -3508,6 +3523,7 @@
3508
3523
  <fo:block id="{@id}">
3509
3524
  <xsl:apply-templates/>
3510
3525
  </fo:block>
3526
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3511
3527
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3512
3528
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3513
3529
  <xsl:apply-templates/>
@@ -4096,10 +4112,11 @@
4096
4112
  </xsl:choose>
4097
4113
 
4098
4114
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4099
-
4115
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
4100
4116
  <xsl:variable name="element">
4101
4117
  block
4102
4118
 
4119
+
4103
4120
  </xsl:variable>
4104
4121
  <xsl:choose>
4105
4122
  <xsl:when test="normalize-space($element) = 'block'">
@@ -4195,29 +4212,47 @@
4195
4212
  <xsl:text>— </xsl:text>
4196
4213
  <xsl:apply-templates/>
4197
4214
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
4198
- <fo:inline xsl:use-attribute-sets="eref-style">
4199
- <xsl:if test="@type = 'footnote'">
4200
-
4201
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4202
- <xsl:attribute name="font-size">80%</xsl:attribute>
4203
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4204
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4205
-
4206
-
4207
- </xsl:if>
4208
-
4209
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4210
-
4211
- <xsl:if test="@type = 'inline'">
4212
-
4213
-
4214
-
4215
- </xsl:if>
4216
-
4217
-
4218
- <xsl:apply-templates/>
4219
- </fo:basic-link>
4220
- </fo:inline>
4215
+
4216
+ <xsl:variable name="bibitemid">
4217
+ <xsl:choose>
4218
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
4219
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
4220
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
4221
+ </xsl:choose>
4222
+ </xsl:variable>
4223
+
4224
+ <xsl:choose>
4225
+ <xsl:when test="normalize-space($bibitemid) != ''">
4226
+ <fo:inline xsl:use-attribute-sets="eref-style">
4227
+ <xsl:if test="@type = 'footnote'">
4228
+
4229
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4230
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4231
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4232
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4233
+
4234
+
4235
+ </xsl:if>
4236
+
4237
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4238
+ <xsl:if test="normalize-space(@citeas) = ''">
4239
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4240
+ </xsl:if>
4241
+ <xsl:if test="@type = 'inline'">
4242
+
4243
+
4244
+
4245
+ </xsl:if>
4246
+
4247
+ <xsl:apply-templates/>
4248
+ </fo:basic-link>
4249
+
4250
+ </fo:inline>
4251
+ </xsl:when>
4252
+ <xsl:otherwise>
4253
+ <fo:inline><xsl:apply-templates/></fo:inline>
4254
+ </xsl:otherwise>
4255
+ </xsl:choose>
4221
4256
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
4222
4257
  <!-- zero-space char -->
4223
4258
  <xsl:variable name="depth">
@@ -4407,6 +4442,153 @@
4407
4442
  </fo:block>
4408
4443
  </xsl:otherwise>
4409
4444
  </xsl:choose>
4445
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
4446
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
4447
+ <bookmark><xsl:value-of select="@id"/></bookmark>
4448
+ </xsl:for-each>
4449
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
4450
+ <xsl:copy>
4451
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
4452
+ </xsl:copy>
4453
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
4454
+ <xsl:variable name="id">
4455
+ <xsl:call-template name="generateIndexXrefId"/>
4456
+ </xsl:variable>
4457
+ <xsl:copy> <!-- add id to xref -->
4458
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
4459
+ <xsl:attribute name="id">
4460
+ <xsl:value-of select="$id"/>
4461
+ </xsl:attribute>
4462
+ <xsl:apply-templates mode="index_add_id"/>
4463
+ </xsl:copy>
4464
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
4465
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
4466
+ <xsl:if test="@to">
4467
+ <xsl:value-of select="$dash"/>
4468
+ <xsl:copy>
4469
+ <xsl:copy-of select="@*"/>
4470
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
4471
+ <xsl:attribute name="id">
4472
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
4473
+ </xsl:attribute>
4474
+ <xsl:apply-templates mode="index_add_id"/>
4475
+ </xsl:copy>
4476
+ </xsl:if>
4477
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
4478
+ <xsl:copy>
4479
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
4480
+ </xsl:copy>
4481
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
4482
+ <xsl:copy>
4483
+ <xsl:apply-templates select="@*" mode="index_update"/>
4484
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
4485
+ </xsl:copy>
4486
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
4487
+ <xsl:param name="element"/>
4488
+ <xsl:param name="remove" select="'false'"/>
4489
+ <xsl:param name="target"/>
4490
+ <!-- <node></node> -->
4491
+ <xsl:choose>
4492
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
4493
+ <!-- skip text (i.e. remove it) and process next element -->
4494
+ <!-- [removed_<xsl:value-of select="."/>] -->
4495
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4496
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
4497
+ </xsl:apply-templates>
4498
+ </xsl:when>
4499
+ <xsl:when test="self::text()">
4500
+ <xsl:value-of select="."/>
4501
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4502
+ </xsl:when>
4503
+ <xsl:when test="self::* and local-name(.) = 'xref'">
4504
+ <xsl:variable name="id" select="@id"/>
4505
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
4506
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
4507
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
4508
+
4509
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
4510
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
4511
+
4512
+ <xsl:choose>
4513
+ <!-- 2nd pass -->
4514
+ <!-- if page is equal to page for next and page is not the end of range -->
4515
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
4516
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
4517
+ <!-- [removed_xref] -->
4518
+
4519
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4520
+ <xsl:with-param name="remove">true</xsl:with-param>
4521
+ <xsl:with-param name="target">
4522
+ <xsl:choose>
4523
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
4524
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
4525
+ </xsl:choose>
4526
+ </xsl:with-param>
4527
+ </xsl:apply-templates>
4528
+ </xsl:when>
4529
+
4530
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
4531
+ <!-- remove xref -->
4532
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4533
+ <xsl:with-param name="remove">true</xsl:with-param>
4534
+ </xsl:apply-templates>
4535
+ </xsl:when>
4536
+
4537
+ <xsl:otherwise>
4538
+ <xsl:apply-templates select="." mode="xref_copy">
4539
+ <xsl:with-param name="target" select="$target"/>
4540
+ </xsl:apply-templates>
4541
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4542
+ </xsl:otherwise>
4543
+ </xsl:choose>
4544
+ </xsl:when>
4545
+ <xsl:when test="self::* and local-name(.) = 'ul'">
4546
+ <!-- ul -->
4547
+ <xsl:apply-templates select="." mode="index_update"/>
4548
+ </xsl:when>
4549
+ <xsl:otherwise>
4550
+ <xsl:apply-templates select="." mode="xref_copy">
4551
+ <xsl:with-param name="target" select="$target"/>
4552
+ </xsl:apply-templates>
4553
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4554
+ </xsl:otherwise>
4555
+ </xsl:choose>
4556
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
4557
+ <xsl:param name="target"/>
4558
+ <xsl:copy>
4559
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
4560
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
4561
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
4562
+ </xsl:if>
4563
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
4564
+ </xsl:copy>
4565
+ </xsl:template><xsl:template name="generateIndexXrefId">
4566
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4567
+
4568
+ <xsl:variable name="docid">
4569
+ <xsl:call-template name="getDocumentId"/>
4570
+ </xsl:variable>
4571
+ <xsl:variable name="item_number">
4572
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
4573
+ </xsl:variable>
4574
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
4575
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
4576
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
4577
+ <xsl:apply-templates/>
4578
+ <fo:block>
4579
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
4580
+ <fo:block> </fo:block>
4581
+ </xsl:if>
4582
+ </fo:block>
4583
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
4584
+ <xsl:apply-templates/>
4585
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
4586
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4587
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4588
+ <xsl:apply-templates/>
4589
+ </fo:block>
4590
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
4591
+ <fo:inline id="{@id}"/>
4410
4592
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4411
4593
  <!-- <row>
4412
4594
  <date>05-07-2013</date>
@@ -4623,70 +4805,68 @@
4623
4805
  <xsl:variable name="lang">
4624
4806
  <xsl:call-template name="getLang"/>
4625
4807
  </xsl:variable>
4626
- <fo:declarations>
4627
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4628
- <pdf:dictionary type="normal" key="ViewerPreferences">
4629
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4630
- </pdf:dictionary>
4631
- </pdf:catalog>
4632
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
4633
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4634
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4635
- <!-- Dublin Core properties go here -->
4636
- <dc:title>
4637
- <xsl:variable name="title">
4638
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4639
-
4640
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4641
-
4642
-
4643
-
4644
-
4645
-
4646
-
4647
- </xsl:for-each>
4648
- </xsl:variable>
4649
- <xsl:choose>
4650
- <xsl:when test="normalize-space($title) != ''">
4651
- <xsl:value-of select="$title"/>
4652
- </xsl:when>
4653
- <xsl:otherwise>
4654
- <xsl:text> </xsl:text>
4655
- </xsl:otherwise>
4656
- </xsl:choose>
4657
- </dc:title>
4658
- <dc:creator>
4808
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4809
+ <pdf:dictionary type="normal" key="ViewerPreferences">
4810
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4811
+ </pdf:dictionary>
4812
+ </pdf:catalog>
4813
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
4814
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4815
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4816
+ <!-- Dublin Core properties go here -->
4817
+ <dc:title>
4818
+ <xsl:variable name="title">
4659
4819
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4660
4820
 
4661
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4662
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4663
- <xsl:if test="position() != last()">; </xsl:if>
4664
- </xsl:for-each>
4665
-
4821
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
4666
4822
 
4667
4823
 
4668
- </xsl:for-each>
4669
- </dc:creator>
4670
- <dc:description>
4671
- <xsl:variable name="abstract">
4672
4824
 
4673
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4674
4825
 
4675
4826
 
4676
- </xsl:variable>
4677
- <xsl:value-of select="normalize-space($abstract)"/>
4678
- </dc:description>
4679
- <pdf:Keywords>
4680
- <xsl:call-template name="insertKeywords"/>
4681
- </pdf:Keywords>
4682
- </rdf:Description>
4683
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4684
- <!-- XMP properties go here -->
4685
- <xmp:CreatorTool/>
4686
- </rdf:Description>
4687
- </rdf:RDF>
4688
- </x:xmpmeta>
4689
- </fo:declarations>
4827
+
4828
+ </xsl:for-each>
4829
+ </xsl:variable>
4830
+ <xsl:choose>
4831
+ <xsl:when test="normalize-space($title) != ''">
4832
+ <xsl:value-of select="$title"/>
4833
+ </xsl:when>
4834
+ <xsl:otherwise>
4835
+ <xsl:text> </xsl:text>
4836
+ </xsl:otherwise>
4837
+ </xsl:choose>
4838
+ </dc:title>
4839
+ <dc:creator>
4840
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4841
+
4842
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4843
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4844
+ <xsl:if test="position() != last()">; </xsl:if>
4845
+ </xsl:for-each>
4846
+
4847
+
4848
+
4849
+ </xsl:for-each>
4850
+ </dc:creator>
4851
+ <dc:description>
4852
+ <xsl:variable name="abstract">
4853
+
4854
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4855
+
4856
+
4857
+ </xsl:variable>
4858
+ <xsl:value-of select="normalize-space($abstract)"/>
4859
+ </dc:description>
4860
+ <pdf:Keywords>
4861
+ <xsl:call-template name="insertKeywords"/>
4862
+ </pdf:Keywords>
4863
+ </rdf:Description>
4864
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4865
+ <!-- XMP properties go here -->
4866
+ <xmp:CreatorTool/>
4867
+ </rdf:Description>
4868
+ </rdf:RDF>
4869
+ </x:xmpmeta>
4690
4870
  </xsl:template><xsl:template name="getId">
4691
4871
  <xsl:choose>
4692
4872
  <xsl:when test="../@id">