~todd-deshane/openstack-manuals/working

« back to all changes in this revision

Viewing changes to doc/buildpdf/rc-maven-cloud-docs/target/classes/cloud/fo/fop1.xsl

  • Committer: Anne Gentle
  • Date: 2011-04-04 17:54:52 UTC
  • Revision ID: anne@openstack.org-20110404175452-gtth3hfrniqhpp5o
Switching from Ant builds to Maven, still working out kinks but should be functional

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version='1.0'?>
2
 
<xsl:stylesheet exclude-result-prefixes="d"
3
 
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
 
                 xmlns:d="http://docbook.org/ns/docbook"
5
 
                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
6
 
                 version='1.0'>
7
 
 
8
 
<!-- Metadata support ("Document Properties" in Adobe Reader) -->
9
 
<xsl:template name="fop1-document-information">
10
 
  <xsl:variable name="authors" select="(//d:author|//d:editor|//d:corpauthor|//d:authorgroup)[1]"/>
11
 
 
12
 
  <xsl:variable name="title">
13
 
    <xsl:apply-templates select="/*[1]" mode="label.markup"/>
14
 
    <xsl:apply-templates select="/*[1]" mode="title.markup"/>
15
 
    <xsl:variable name="subtitle">
16
 
      <xsl:apply-templates select="/*[1]" mode="subtitle.markup"/>
17
 
    </xsl:variable>
18
 
    <xsl:if test="$subtitle !=''">
19
 
      <xsl:text> - </xsl:text>
20
 
      <xsl:value-of select="$subtitle"/>
21
 
    </xsl:if>
22
 
  </xsl:variable>
23
 
  <xsl:variable name="ccid">
24
 
      <xsl:value-of select="substring-after(string(/*/d:info/d:legalnotice/@role),'cc-')"/>
25
 
  </xsl:variable>
26
 
  <xsl:variable name="ccidURL">
27
 
      <xsl:text>http://creativecommons.org/licenses/</xsl:text>
28
 
      <xsl:value-of select="$ccid"/>
29
 
      <xsl:text>/3.0/legalcode</xsl:text>
30
 
  </xsl:variable>
31
 
  <fo:declarations>
32
 
    <x:xmpmeta xmlns:x="adobe:ns:meta/">
33
 
      <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
34
 
        <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/"
35
 
                         xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/'
36
 
                         >
37
 
            <xapRights:Marked>True</xapRights:Marked>
38
 
        </rdf:Description>
39
 
        <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
40
 
          <!-- Dublin Core properties go here -->
41
 
          <dc:rights>
42
 
              <rdf:Alt>
43
 
                  <rdf:li xml:lang="x-default">
44
 
                      <xsl:apply-templates mode="titlepage.mode" select="//d:copyright"/>
45
 
                      <xsl:if test="starts-with(string(/*/d:info/d:legalnotice/@role),'cc-')">
46
 
                          <xsl:text> Licensed to the public under Creative Commons Attribution </xsl:text>
47
 
                          <xsl:choose>
48
 
                              <xsl:when test="$ccid = 'by'" />
49
 
                              <xsl:when test="$ccid = 'by-sa'">
50
 
                                  <xsl:text>ShareAlike</xsl:text>
51
 
                              </xsl:when>
52
 
                              <xsl:when test="$ccid = 'by-nd'">
53
 
                                  <xsl:text>NoDerivatives</xsl:text>
54
 
                              </xsl:when>
55
 
                              <xsl:when test="$ccid = 'by-nc'">
56
 
                                  <xsl:text>NonCommercial</xsl:text>
57
 
                              </xsl:when>
58
 
                              <xsl:when test="$ccid = 'by-nc-sa'">
59
 
                                  <xsl:text>NonCommercial ShareAlike</xsl:text>
60
 
                              </xsl:when>
61
 
                              <xsl:when test="$ccid = 'by-nc-nd'">
62
 
                                  <xsl:text>NonCommercial NoDerivatives</xsl:text>
63
 
                              </xsl:when>
64
 
                              <xsl:otherwise>
65
 
                                  <xsl:message terminate="yes">I don't understand licence <xsl:value-of select="$ccid"/></xsl:message>
66
 
                              </xsl:otherwise>
67
 
                          </xsl:choose>
68
 
                          <xsl:text> 3.0 License</xsl:text>
69
 
                      </xsl:if>
70
 
                  </rdf:li>
71
 
              </rdf:Alt>
72
 
          </dc:rights>
73
 
          <!-- Title -->
74
 
          <dc:title><xsl:value-of select="normalize-space($title)"/></dc:title>
75
 
 
76
 
          <!-- Author -->
77
 
          <xsl:if test="$authors">
78
 
            <xsl:variable name="author">
79
 
              <xsl:choose>
80
 
                <xsl:when test="$authors[self::d:authorgroup]">
81
 
                  <xsl:call-template name="person.name.list">
82
 
                    <xsl:with-param name="person.list" 
83
 
                       select="$authors/*[self::d:author|self::d:corpauthor|
84
 
                                     self::d:othercredit|self::d:editor]"/>
85
 
                  </xsl:call-template>
86
 
                </xsl:when>
87
 
                <xsl:when test="$authors[self::d:corpauthor]">
88
 
                  <xsl:value-of select="$authors"/>
89
 
                </xsl:when>
90
 
                <xsl:otherwise>
91
 
                  <xsl:call-template name="person.name">
92
 
                    <xsl:with-param name="node" select="$authors"/>
93
 
                  </xsl:call-template>
94
 
                </xsl:otherwise>
95
 
              </xsl:choose>
96
 
            </xsl:variable>
97
 
 
98
 
            <dc:creator><xsl:value-of select="normalize-space($author)"/></dc:creator>
99
 
          </xsl:if>
100
 
 
101
 
          <!-- Subject -->
102
 
          <xsl:if test="//d:subjectterm">
103
 
            <dc:description>
104
 
              <xsl:for-each select="//d:subjectterm">
105
 
                <xsl:value-of select="normalize-space(.)"/>
106
 
                <xsl:if test="position() != last()">
107
 
                  <xsl:text>, </xsl:text>
108
 
                </xsl:if>
109
 
              </xsl:for-each>
110
 
            </dc:description>
111
 
          </xsl:if>
112
 
        </rdf:Description>
113
 
        <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
114
 
          <!-- PDF properties go here -->
115
 
 
116
 
          <!-- Keywords -->
117
 
          <xsl:if test="//d:keyword">
118
 
            <pdf:Keywords>
119
 
              <xsl:for-each select="//d:keyword">
120
 
                <xsl:value-of select="normalize-space(.)"/>
121
 
                <xsl:if test="position() != last()">
122
 
                  <xsl:text>, </xsl:text>
123
 
                </xsl:if>
124
 
              </xsl:for-each>
125
 
            </pdf:Keywords>
126
 
          </xsl:if>
127
 
        </rdf:Description>
128
 
 
129
 
        <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
130
 
          <!-- XMP properties go here -->
131
 
 
132
 
          <!-- Creator Tool -->
133
 
          <xmp:CreatorTool>Cloud API Docs Plugin</xmp:CreatorTool>
134
 
        </rdf:Description>
135
 
        <xsl:if test="starts-with(string(/*/d:info/d:legalnotice/@role),'cc-')">
136
 
            <rdf:Description rdf:about=''
137
 
                             xmlns:cc='http://creativecommons.org/ns#'>
138
 
                <xsl:element name="cc:license">
139
 
                    <xsl:attribute name="rdf:resource">
140
 
                        <xsl:value-of select="$ccidURL"/>
141
 
                    </xsl:attribute>
142
 
                </xsl:element>
143
 
            </rdf:Description>
144
 
        </xsl:if>
145
 
      </rdf:RDF>
146
 
    </x:xmpmeta>
147
 
  </fo:declarations>
148
 
</xsl:template>
149
 
 
150
 
</xsl:stylesheet>