You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

block_text-align_1.xml 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 text-align and text-align-last.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="simple" page-height="10in" page-width="5in">
  27. <fo:region-body/>
  28. </fo:simple-page-master>
  29. </fo:layout-master-set>
  30. <fo:page-sequence master-reference="simple">
  31. <fo:flow flow-name="xsl-region-body">
  32. <fo:block>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi suscipit, risus ac congue suscipit, tortor nibh cursus mauris, quis feugiat nunc ante sit amet ante.</fo:block>
  33. <fo:block text-align="start" background-color="yellow">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi suscipit, risus ac congue suscipit, tortor nibh cursus mauris, quis feugiat nunc ante sit amet ante.</fo:block>
  34. <fo:block text-align="justify">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi suscipit, risus ac congue suscipit, tortor nibh cursus mauris, quis feugiat nunc ante sit amet ante.</fo:block>
  35. <fo:block text-align="center" background-color="yellow">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi suscipit, risus ac congue suscipit, tortor nibh cursus mauris, quis feugiat nunc ante sit amet ante.</fo:block>
  36. <fo:block text-align="end">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi suscipit, risus ac congue suscipit, tortor nibh cursus mauris, quis feugiat nunc ante sit amet ante.</fo:block>
  37. <fo:block text-align="justify" text-align-last="center" background-color="yellow">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi suscipit, risus ac congue suscipit, tortor nibh cursus mauris, quis feugiat nunc ante sit amet ante.</fo:block>
  38. <fo:block text-align="justify" text-align-last="end">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi suscipit, risus ac congue suscipit, tortor nibh cursus mauris, quis feugiat nunc ante sit amet ante.</fo:block>
  39. </fo:flow>
  40. </fo:page-sequence>
  41. </fo:root>
  42. </fo>
  43. <checks>
  44. <!-- default settings for text-align -->
  45. <true xpath="not(boolean(//flow/block[1]/lineArea[1]/@start-indent))"/>
  46. <true xpath="not(boolean(//flow/block[1]/lineArea[2]/@start-indent))"/>
  47. <true xpath="not(boolean(//flow/block[1]/lineArea[3]/@start-indent))"/>
  48. <true xpath="//flow/block[1]/lineArea[1]/text/@ipd != //flow/block[1]/lineArea[2]/text/@ipd"/>
  49. <true xpath="//flow/block[1]/lineArea[2]/text/@ipd != //flow/block[1]/lineArea[3]/text/@ipd"/>
  50. <!-- text-align="start" -->
  51. <true xpath="not(boolean(//flow/block[2]/lineArea[1]/@start-indent))"/>
  52. <true xpath="not(boolean(//flow/block[2]/lineArea[2]/@start-indent))"/>
  53. <true xpath="not(boolean(//flow/block[2]/lineArea[3]/@start-indent))"/>
  54. <true xpath="//flow/block[2]/lineArea[1]/text/@ipd != //flow/block[2]/lineArea[2]/text/@ipd"/>
  55. <true xpath="//flow/block[2]/lineArea[2]/text/@ipd != //flow/block[2]/lineArea[3]/text/@ipd"/>
  56. <!-- block 1 and 2 must have the same result -->
  57. <true xpath="//flow/block[1]/lineArea[1]/text/@ipd = //flow/block[2]/lineArea[1]/text/@ipd"/>
  58. <true xpath="//flow/block[1]/lineArea[2]/text/@ipd = //flow/block[2]/lineArea[2]/text/@ipd"/>
  59. <true xpath="//flow/block[1]/lineArea[3]/text/@ipd = //flow/block[2]/lineArea[3]/text/@ipd"/>
  60. <!-- text-align="justify" -->
  61. <true xpath="not(boolean(//flow/block[3]/lineArea[1]/@start-indent))"/>
  62. <true xpath="not(boolean(//flow/block[3]/lineArea[2]/@start-indent))"/>
  63. <true xpath="not(boolean(//flow/block[3]/lineArea[3]/@start-indent))"/>
  64. <!-- Some tolerance seems to be necessary here. Why is that exactly? -->
  65. <true xpath="(360000 - //flow/block[3]/lineArea[1]/text/@ipd) &lt; 3000"/>
  66. <true xpath="(360000 - //flow/block[3]/lineArea[1]/text/@ipd) &gt; -3000"/>
  67. <true xpath="(360000 - //flow/block[3]/lineArea[2]/text/@ipd) &lt; 3000"/>
  68. <true xpath="(360000 - //flow/block[3]/lineArea[2]/text/@ipd) &gt; -3000"/>
  69. <true xpath="//flow/block[3]/lineArea[3]/text/@ipd &lt; 350000"/>
  70. <!-- text-align="center" -->
  71. <true xpath="//flow/block[4]/lineArea[1]/@start-indent &gt; 10000"/>
  72. <true xpath="//flow/block[4]/lineArea[2]/@start-indent &gt; 10000"/>
  73. <true xpath="//flow/block[4]/lineArea[3]/@start-indent &gt; 10000"/>
  74. <!-- Some tolerance seems to be necessary here. Why is that exactly? -->
  75. <true xpath="(360000 - //flow/block[4]/lineArea[1]/text/@ipd - (2 * //flow/block[4]/lineArea[1]/@start-indent)) &lt; 4000"/>
  76. <true xpath="(360000 - //flow/block[4]/lineArea[1]/text/@ipd - (2 * //flow/block[4]/lineArea[1]/@start-indent)) &gt; -4000"/>
  77. <true xpath="(360000 - //flow/block[4]/lineArea[2]/text/@ipd - (2 * //flow/block[4]/lineArea[2]/@start-indent)) &lt; 4000"/>
  78. <true xpath="(360000 - //flow/block[4]/lineArea[2]/text/@ipd - (2 * //flow/block[4]/lineArea[2]/@start-indent)) &gt; -4000"/>
  79. <true xpath="(360000 - //flow/block[4]/lineArea[3]/text/@ipd - (2 * //flow/block[4]/lineArea[3]/@start-indent)) &lt; 4000"/>
  80. <true xpath="(360000 - //flow/block[4]/lineArea[3]/text/@ipd - (2 * //flow/block[4]/lineArea[3]/@start-indent)) &gt; -4000"/>
  81. <!-- text-align="end" -->
  82. <true xpath="//flow/block[5]/lineArea[1]/@start-indent &gt; 10000"/>
  83. <true xpath="//flow/block[5]/lineArea[2]/@start-indent &gt; 10000"/>
  84. <true xpath="//flow/block[5]/lineArea[3]/@start-indent &gt; 10000"/>
  85. <!-- Some tolerance seems to be necessary here. Why is that exactly? -->
  86. <true xpath="(360000 - //flow/block[5]/lineArea[1]/text/@ipd - //flow/block[5]/lineArea[1]/@start-indent) &lt; 4000"/>
  87. <true xpath="(360000 - //flow/block[5]/lineArea[1]/text/@ipd - //flow/block[5]/lineArea[1]/@start-indent) &gt; -4000"/>
  88. <true xpath="(360000 - //flow/block[5]/lineArea[2]/text/@ipd - //flow/block[5]/lineArea[2]/@start-indent) &lt; 4000"/>
  89. <true xpath="(360000 - //flow/block[5]/lineArea[2]/text/@ipd - //flow/block[5]/lineArea[2]/@start-indent) &gt; -4000"/>
  90. <true xpath="(360000 - //flow/block[5]/lineArea[3]/text/@ipd - //flow/block[5]/lineArea[3]/@start-indent) &lt; 4000"/>
  91. <true xpath="(360000 - //flow/block[5]/lineArea[3]/text/@ipd - //flow/block[5]/lineArea[3]/@start-indent) &gt; -4000"/>
  92. <!-- text-align="justify" text-align-last="center" -->
  93. <true xpath="not(boolean(//flow/block[6]/lineArea[1]/@start-indent))"/>
  94. <true xpath="not(boolean(//flow/block[6]/lineArea[2]/@start-indent))"/>
  95. <true xpath="//flow/block[6]/lineArea[3]/@start-indent &gt; 10000"/>
  96. <true xpath="(360000 - //flow/block[6]/lineArea[1]/text/@ipd) &lt; 3000"/>
  97. <true xpath="(360000 - //flow/block[6]/lineArea[1]/text/@ipd) &gt; -3000"/>
  98. <true xpath="(360000 - //flow/block[6]/lineArea[2]/text/@ipd) &lt; 3000"/>
  99. <true xpath="(360000 - //flow/block[6]/lineArea[2]/text/@ipd) &gt; -3000"/>
  100. <true xpath="(360000 - //flow/block[6]/lineArea[3]/text/@ipd - (2 * //flow/block[6]/lineArea[3]/@start-indent)) &lt; 4000"/>
  101. <true xpath="(360000 - //flow/block[6]/lineArea[3]/text/@ipd - (2 * //flow/block[6]/lineArea[3]/@start-indent)) &gt; -4000"/>
  102. <!-- text-align="justify" text-align-last="end" -->
  103. <true xpath="not(boolean(//flow/block[7]/lineArea[1]/@start-indent))"/>
  104. <true xpath="not(boolean(//flow/block[7]/lineArea[2]/@start-indent))"/>
  105. <true xpath="//flow/block[7]/lineArea[3]/@start-indent &gt; 10000"/>
  106. <true xpath="(360000 - //flow/block[7]/lineArea[1]/text/@ipd) &lt; 3000"/>
  107. <true xpath="(360000 - //flow/block[7]/lineArea[1]/text/@ipd) &gt; -3000"/>
  108. <true xpath="(360000 - //flow/block[7]/lineArea[2]/text/@ipd) &lt; 3000"/>
  109. <true xpath="(360000 - //flow/block[7]/lineArea[2]/text/@ipd) &gt; -3000"/>
  110. <true xpath="(360000 - //flow/block[7]/lineArea[3]/text/@ipd - //flow/block[7]/lineArea[3]/@start-indent) &lt; 4000"/>
  111. <true xpath="(360000 - //flow/block[7]/lineArea[3]/text/@ipd - //flow/block[7]/lineArea[3]/@start-indent) &gt; -4000"/>
  112. <!-- TODO Check element list -->
  113. </checks>
  114. </testcase>