Imported Upstream version 1.79.0
[platform/upstream/docbook-xsl-stylesheets.git] / fo / axf.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4                 xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
5                 version='1.0'>
6
7 <!-- ********************************************************************
8      $Id: axf.xsl 8983 2011-03-27 07:41:25Z mzjn $
9      ******************************************************************** -->
10
11 <xsl:template name="axf-document-information">
12
13     <xsl:variable name="authors" select="(//author|//editor|
14                                           //corpauthor|//authorgroup)[1]"/>
15     <xsl:if test="$authors">
16       <xsl:variable name="author">
17         <xsl:choose>
18           <xsl:when test="$authors[self::authorgroup]">
19             <xsl:call-template name="person.name.list">
20               <xsl:with-param name="person.list" 
21                  select="$authors/*[self::author|self::corpauthor|
22                                self::othercredit|self::editor]"/>
23             </xsl:call-template>
24           </xsl:when>
25           <xsl:when test="$authors[self::corpauthor]">
26             <xsl:value-of select="$authors"/>
27           </xsl:when>
28            <xsl:when test="$authors[orgname]">
29             <xsl:value-of select="$authors/orgname"/>
30           </xsl:when>
31           <xsl:otherwise>
32             <xsl:call-template name="person.name">
33               <xsl:with-param name="node" select="$authors"/>
34             </xsl:call-template>
35           </xsl:otherwise>
36         </xsl:choose>
37       </xsl:variable>
38
39       <xsl:element name="axf:document-info">
40         <xsl:attribute name="name">author</xsl:attribute>
41         <xsl:attribute name="value">
42           <xsl:value-of select="normalize-space($author)"/>
43         </xsl:attribute>
44       </xsl:element>
45     </xsl:if>
46
47     <xsl:variable name="title">
48       <xsl:apply-templates select="/*[1]" mode="label.markup"/>
49       <xsl:apply-templates select="/*[1]" mode="title.markup"/>
50     </xsl:variable>
51
52     <!-- * see bug report #1465301 - mzjn -->
53     <axf:document-info name="title">
54       <xsl:attribute name="value">
55         <xsl:value-of select="normalize-space($title)"/>
56       </xsl:attribute>
57     </axf:document-info>
58
59     <xsl:if test="//keyword">
60       <xsl:element name="axf:document-info">
61         <xsl:attribute name="name">keywords</xsl:attribute>
62         <xsl:attribute name="value">
63           <xsl:for-each select="//keyword">
64             <xsl:value-of select="normalize-space(.)"/>
65             <xsl:if test="position() != last()">
66               <xsl:text>, </xsl:text>
67             </xsl:if>
68           </xsl:for-each>
69         </xsl:attribute>
70       </xsl:element>
71     </xsl:if>
72
73     <xsl:if test="//subjectterm">
74       <xsl:element name="axf:document-info">
75         <xsl:attribute name="name">subject</xsl:attribute>
76         <xsl:attribute name="value">
77           <xsl:for-each select="//subjectterm">
78             <xsl:value-of select="normalize-space(.)"/>
79             <xsl:if test="position() != last()">
80               <xsl:text>, </xsl:text>
81             </xsl:if>
82           </xsl:for-each>
83         </xsl:attribute>
84       </xsl:element>
85     </xsl:if>
86
87 </xsl:template>
88
89 <!-- These properties are added to fo:simple-page-master -->
90 <xsl:template name="axf-page-master-properties">
91   <xsl:param name="page.master" select="''"/>
92
93   <xsl:if test="$crop.marks != 0">
94     <xsl:attribute name="axf:printer-marks">crop</xsl:attribute>
95     <xsl:attribute name="axf:bleed"><xsl:value-of
96                           select="$crop.mark.bleed"/></xsl:attribute>
97     <xsl:attribute name="axf:printer-marks-line-width"><xsl:value-of
98                           select="$crop.mark.width"/></xsl:attribute>
99     <xsl:attribute name="axf:crop-offset"><xsl:value-of
100                           select="$crop.mark.offset"/></xsl:attribute>
101   </xsl:if>
102
103   <xsl:call-template name="user-axf-page-master-properties">
104     <xsl:with-param name="page.master" select="$page.master"/>
105   </xsl:call-template>
106
107 </xsl:template>
108
109 <xsl:template name="user-axf-page-master-properties">
110   <xsl:param name="page.master" select="''"/>
111 </xsl:template>
112
113 </xsl:stylesheet>