Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

page-position_last_bug40798.xml 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <testcase>
  18. <info>
  19. <p>
  20. This test checks for the use of a 'last' conditional-page-master-reference
  21. for a first/only page (see: https://issues.apache.org/bugzilla/show_bug.cgi?id=40798)
  22. </p>
  23. </info>
  24. <fo>
  25. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
  26. font-family="Times" font-size="20pt">
  27. <fo:layout-master-set>
  28. <fo:simple-page-master master-name="only-page-layout"
  29. page-height="297mm" page-width="210mm"
  30. margin-top="15mm" margin-bottom="15mm"
  31. margin-left="15mm" margin-right="15mm">
  32. <fo:region-body region-name="frame-body" margin-top="10mm"/>
  33. <fo:region-before region-name="only-region" extent="10mm"/>
  34. </fo:simple-page-master>
  35. <fo:simple-page-master master-name="first-page-layout"
  36. page-height="297mm" page-width="210mm"
  37. margin-top="15mm" margin-bottom="15mm"
  38. margin-left="15mm" margin-right="15mm">
  39. <fo:region-body region-name="frame-body" margin-top="10mm"/>
  40. <fo:region-before region-name="first-region" extent="10mm"/>
  41. </fo:simple-page-master>
  42. <fo:simple-page-master master-name="last-page-layout"
  43. page-height="297mm" page-width="210mm"
  44. margin-top="15mm" margin-bottom="15mm"
  45. margin-left="15mm" margin-right="15mm">
  46. <fo:region-body region-name="frame-body" margin-top="10mm"/>
  47. <fo:region-before region-name="last-region" extent="10mm"/>
  48. </fo:simple-page-master>
  49. <fo:simple-page-master master-name="rest-page-layout"
  50. page-height="297mm" page-width="210mm"
  51. margin-top="15mm" margin-bottom="15mm"
  52. margin-left="15mm" margin-right="15mm">
  53. <fo:region-body region-name="frame-body" margin-top="10mm"/>
  54. <fo:region-before region-name="rest-region" extent="10mm"/>
  55. </fo:simple-page-master>
  56. <fo:page-sequence-master master-name="whatever">
  57. <fo:repeatable-page-master-alternatives maximum-repeats="1">
  58. <fo:conditional-page-master-reference master-reference="only-page-layout"
  59. page-position="last"/>
  60. <fo:conditional-page-master-reference master-reference="first-page-layout"
  61. page-position="first"/>
  62. </fo:repeatable-page-master-alternatives>
  63. <fo:repeatable-page-master-alternatives maximum-repeats="no-limit">
  64. <fo:conditional-page-master-reference master-reference="last-page-layout"
  65. page-position="last"/>
  66. <fo:conditional-page-master-reference master-reference="rest-page-layout"
  67. page-position="rest"/>
  68. </fo:repeatable-page-master-alternatives>
  69. </fo:page-sequence-master>
  70. </fo:layout-master-set>
  71. <fo:page-sequence master-reference="whatever">
  72. <fo:static-content flow-name="first-region">
  73. <fo:block id="header.first.1" text-align="center">first</fo:block>
  74. </fo:static-content>
  75. <fo:static-content flow-name="only-region">
  76. <fo:block id="header.only.1" text-align="center">only</fo:block>
  77. </fo:static-content>
  78. <fo:flow flow-name="frame-body">
  79. <fo:block>This is the only page</fo:block>
  80. </fo:flow>
  81. </fo:page-sequence>
  82. <fo:page-sequence master-reference="whatever">
  83. <fo:static-content flow-name="only-region">
  84. <fo:block id="header.only.2" text-align="center">only</fo:block>
  85. </fo:static-content>
  86. <fo:static-content flow-name="first-region">
  87. <fo:block id="header.first.2" text-align="center">first</fo:block>
  88. </fo:static-content>
  89. <fo:static-content flow-name="last-region">
  90. <fo:block id="header.last.2" text-align="center">last</fo:block>
  91. </fo:static-content>
  92. <fo:static-content flow-name="rest-region">
  93. <fo:block id="header.rest.2" text-align="center">rest</fo:block>
  94. </fo:static-content>
  95. <fo:flow flow-name="frame-body">
  96. <fo:block>This is the first page</fo:block>
  97. <fo:block break-before="page">This is a middle page</fo:block>
  98. <fo:block break-before="page">This is a middle page</fo:block>
  99. <fo:block break-before="page">This is the last page</fo:block>
  100. </fo:flow>
  101. </fo:page-sequence>
  102. </fo:root>
  103. </fo>
  104. <checks>
  105. <eval expected="header.only.1" xpath="(/areaTree/pageSequence[1]//regionBefore)[1]/block[1]/@prod-id" />
  106. <eval expected="header.first.2" xpath="(/areaTree/pageSequence[2]//regionBefore)[1]/block[1]/@prod-id" />
  107. <eval expected="header.rest.2" xpath="(/areaTree/pageSequence[2]//regionBefore)[2]/block[1]/@prod-id" />
  108. <eval expected="header.rest.2" xpath="(/areaTree/pageSequence[2]//regionBefore)[3]/block[1]/@prod-id" />
  109. <eval expected="header.last.2" xpath="(/areaTree/pageSequence[2]//regionBefore)[4]/block[1]/@prod-id" />
  110. </checks>
  111. </testcase>