aboutsummaryrefslogtreecommitdiffstats
path: root/fop/test/layoutengine/standard-testcases/page-sequence-force-page-count-odd.xml
blob: 87d47b49abcdbcbfc543582101ddc20108906818 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?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.
-->
<!-- $Id$ -->
<testcase>
  <info>
    <p>
      This checks that when force-page-count that the last simple-
      page-master is used when a single page overflows to a second
      page and the page count is forced to odd.
    </p>
  </info>
  <variables>
    <img>../resources/images/bgimg300dpi.jpg</img>
  </variables>
  <fo>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple-first" page-width="210mm" page-height="297mm" margin-bottom="0mm" margin-right="0mm" margin-top="0mm" margin-left="0mm">
      <fo:region-body  region-name="body"/>
      <fo:region-before region-name="first-before" extent="100mm"/>
      <fo:region-after region-name="first-after" extent="23mm"/>
    </fo:simple-page-master>
    <fo:simple-page-master master-name="simple-first-space" page-width="210mm" page-height="297mm" margin-bottom="0mm" margin-right="0mm" margin-top="0mm" margin-left="0mm">
      <fo:region-body margin-bottom="115mm" margin-right="20mm" margin-top="0mm" margin-left="23mm" region-name="body"/>
      <fo:region-before background-position-horizontal="150mm" background-repeat="no-repeat" background-position-vertical="10mm" region-name="first-before" extent="70mm"/>
      <fo:region-after region-name="first-after-space" extent="110mm"/>
    </fo:simple-page-master>
    <fo:simple-page-master master-name="simple-rest" page-width="210mm" page-height="297mm" margin-bottom="0mm" margin-right="0mm" margin-top="0mm" margin-left="0mm">
      <fo:region-body background-color="green" margin-bottom="25mm" margin-right="20mm" margin-top="70mm" margin-left="23mm" region-name="body"/>
      <fo:region-before background-position-horizontal="150mm" background-repeat="no-repeat" background-position-vertical="10mm" region-name="rest-before" extent="70mm"/>
      <fo:region-after region-name="rest-after" extent="23mm"/>
    </fo:simple-page-master>
    <fo:simple-page-master master-name="simple-last" page-width="210mm" page-height="297mm" margin-bottom="0mm" margin-right="0mm" margin-top="0mm" margin-left="0mm">
      <fo:region-body background-color="blue" margin-top="70mm" margin-bottom="115mm" margin-right="22mm" margin-left="25mm" region-name="body"/>
      <fo:region-before background-position-horizontal="150mm" background-repeat="no-repeat" background-position-vertical="10mm" region-name="last-before" extent="70mm"/>
      <fo:region-after extent="111mm" region-name="last-after"/>
    </fo:simple-page-master>
<fo:page-sequence-master master-name="psm">
      <fo:repeatable-page-master-alternatives>
        <fo:conditional-page-master-reference page-position="only" master-reference="simple-first-space"/>
        <fo:conditional-page-master-reference page-position="first" master-reference="simple-first"/> 
        <fo:conditional-page-master-reference page-position="rest" master-reference="simple-rest"/>
	<fo:conditional-page-master-reference page-position="last" master-reference="simple-last"/>
      </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>
  </fo:layout-master-set>
  <fo:page-sequence format="1" force-page-count="odd" master-reference="psm">
    <fo:static-content flow-name="first-before">
        <fo:block>
        </fo:block>
    </fo:static-content>
    <fo:static-content flow-name="first-after-space">
        <fo:block page-break-before="always" page-break-after="always">
        </fo:block>
    </fo:static-content>
    <fo:static-content flow-name="first-after">
      <fo:block margin-right="20mm" margin-left="23mm">
      </fo:block>
    </fo:static-content>
    <fo:static-content flow-name="rest-before">
        <fo:block>
        </fo:block>
    </fo:static-content>
    <fo:static-content flow-name="last-before">
        <fo:block>
        </fo:block>
    </fo:static-content>
    <fo:static-content flow-name="rest-after">
      <fo:block margin-right="20mm" margin-left="23mm">
      </fo:block>
    </fo:static-content>
    <fo:static-content flow-name="last-after">
        <fo:block>
        </fo:block>
    </fo:static-content>
    <fo:flow flow-name="body">
      <fo:block-container>
        <fo:block margin-top="88mm">
	  <fo:block space-after="120mm">line 1</fo:block>
	  <fo:block space-after="60mm">line 2</fo:block>
        </fo:block>
      </fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>
  </fo>
  <checks>
    <eval expected="simple-first" xpath="//pageViewport[1]/@simple-page-master-name"/>
    <eval expected="simple-rest" xpath="//pageViewport[2]/@simple-page-master-name"/>
    <eval expected="simple-last" xpath="//pageViewport[3]/@simple-page-master-name"/>
    <eval expected="3" xpath="count(//pageViewport)"/>
  </checks>
</testcase>