-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpagesetup.xsl
68 lines (67 loc) · 2.54 KB
/
pagesetup.xsl
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
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java"
exclude-result-prefixes="java" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:variable name="uorientation" select="translate($orientation, $smallcase, $uppercase)"/>
<xsl:variable name="upaper" select="translate($paper, $smallcase, $uppercase)"/>
<xsl:variable name="wide">
<xsl:choose>
<xsl:when test="$uorientation='LANDSCAPE'">-wide</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="cols">
<xsl:choose>
<xsl:when test="$uorientation='LANDSCAPE' and $upaper='TABLOID'">4</xsl:when>
<xsl:when test="$upaper='TABLOID'">3</xsl:when>
<xsl:when test="$uorientation='LANDSCAPE'">3</xsl:when>
<xsl:otherwise>2</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="textcols">
<xsl:choose>
<xsl:when test="$uorientation='LANDSCAPE' and $upaper='TABLOID'">3</xsl:when>
<xsl:when test="$uorientation='LANDSCAPE'">2</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="width">
<xsl:choose>
<xsl:when test="$uorientation='LANDSCAPE'">
<xsl:choose>
<xsl:when test="$upaper='A4'">11.7in</xsl:when>
<xsl:when test="$upaper='TABLOID'">17in</xsl:when>
<xsl:otherwise>11in</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$upaper='A4'">8.3in</xsl:when>
<xsl:when test="$upaper='TABLOID'">11in</xsl:when>
<xsl:otherwise>8.5in</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="height">
<xsl:choose>
<xsl:when test="$uorientation='LANDSCAPE'">
<xsl:choose>
<xsl:when test="$upaper='A4'">8.3in</xsl:when>
<xsl:when test="$upaper='TABLOID'">11in</xsl:when>
<xsl:otherwise>8.5in</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$upaper='A4'">11.7in</xsl:when>
<xsl:when test="$upaper='TABLOID'">17in</xsl:when>
<xsl:otherwise>11in</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:stylesheet>