aboutsummaryrefslogtreecommitdiffstats
path: root/src/documentation/skins/common/xslt/fo/footerinfo.xsl
blob: d0c116520d8f8f485ba78af15af39d4e3adaad4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version="1.0" encoding="UTF-8"?>
<!--
   ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   ====================================================================
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version="1.0">

<!--
Named template to generate a short message in the PDF footer, from text in
skinconf.xml.  By default, the message is a copyright statement.  If a credit
with @role='pdf' is present, that is used instead.  Eg:

<credit role="pdf">
  <name>Generated by Apache FOP 1.0-dev</name>
  <url>http://xml.apache.org/forrest/fop/dev/</url>
</credit>
-->

  <xsl:param name="config-file" select="'../../../../skinconf.xml'"/>
  <xsl:variable name="config" select="document($config-file)/skinconfig"/>

  <xsl:template name="info">
    <xsl:variable name="pdfcredit" select="$config/credits/credit[@role = 'pdf']"/>
    <xsl:variable name="text">
      <xsl:if test="$pdfcredit">
        <xsl:value-of select="$pdfcredit/name"/>
      </xsl:if>
      <xsl:if test="not($pdfcredit)">
        <xsl:text>Copyright &#169; </xsl:text><xsl:value-of select="$config/year"/>&#160;<xsl:value-of
          select="$config/vendor"/><xsl:text> All rights reserved.</xsl:text>
      </xsl:if>
    </xsl:variable>
    <xsl:variable name="url" select="$pdfcredit/url"/>

    <fo:block-container font-style="italic" absolute-position="absolute"
      left="0pt" top="0pt" right="6.25in" bottom="150pt"
      font-size="10pt">
      <xsl:if test="not($url)">
        <fo:block text-align="center" color="lightgrey">
          <xsl:value-of select="$text"/>
        </fo:block>
      </xsl:if>
      <xsl:if test="$url">
        <fo:block text-align="center">
          <fo:basic-link color="lightgrey"
            external-destination="{$url}">
            <xsl:value-of select="$text"/>
          </fo:basic-link>
        </fo:block>
        <fo:block text-align="center">
          <fo:basic-link color="lightgrey"
            external-destination="{$url}">
            <xsl:value-of select="$url"/>
          </fo:basic-link>
        </fo:block>
      </xsl:if>
    </fo:block-container>
  </xsl:template>

</xsl:stylesheet>