Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

block_white-space-treatment_3.xml 5.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Copyright 2006 The Apache Software Foundation
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <!-- $Id$ -->
  15. <testcase>
  16. <info>
  17. <p>
  18. This test checks white space handling for white-space-treatment
  19. with white-space-collapse="false" and the presence of inlines.
  20. This test currently fails because white-space-treatment stops at inline
  21. boundaries when it comes to formatter generated line breaks.
  22. </p>
  23. </info>
  24. <fo>
  25. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  26. <fo:layout-master-set>
  27. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  28. <fo:region-body/>
  29. </fo:simple-page-master>
  30. </fo:layout-master-set>
  31. <fo:page-sequence master-reference="normal" white-space-collapse="false">
  32. <fo:flow flow-name="xsl-region-body">
  33. <fo:block white-space-treatment="ignore-if-surrounding-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
  34. <fo:inline background-color="red"> ignore-if-surrounding-linefeed </fo:inline>
  35. <fo:inline background-color="red"> all </fo:inline>
  36. <fo:inline background-color="red"> spaces </fo:inline>
  37. </fo:block>
  38. <fo:block white-space-treatment="ignore" background-color="silver" margin="1pt 0pt 1pt 0pt">
  39. <fo:inline background-color="red"> ignore </fo:inline>
  40. <fo:inline background-color="red"> all </fo:inline>
  41. <fo:inline background-color="red"> spaces </fo:inline>
  42. </fo:block>
  43. <fo:block white-space-treatment="preserve" background-color="silver" margin="1pt 0pt 1pt 0pt">
  44. <fo:inline background-color="red"> preserve </fo:inline>
  45. <fo:inline background-color="red"> all </fo:inline>
  46. <fo:inline background-color="red"> spaces </fo:inline>
  47. </fo:block>
  48. <fo:block white-space-treatment="ignore-if-before-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
  49. <fo:inline background-color="red"> ignore-if-before-linefeed </fo:inline>
  50. <fo:inline background-color="red"> all </fo:inline>
  51. <fo:inline background-color="red"> spaces </fo:inline>
  52. </fo:block>
  53. <fo:block white-space-treatment="ignore-if-after-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
  54. <fo:inline background-color="red"> ignore-if-after-linefeed </fo:inline>
  55. <fo:inline background-color="red"> all </fo:inline>
  56. <fo:inline background-color="red"> spaces </fo:inline>
  57. </fo:block>
  58. </fo:flow>
  59. </fo:page-sequence>
  60. </fo:root>
  61. </fo>
  62. <checks>
  63. <eval expected="2" xpath="count(//flow/block[1]/lineArea)"/>
  64. <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]//word)"/>
  65. <eval expected="50" xpath="count(//flow/block[1]/lineArea[1]//space)"/>
  66. <eval expected="1" xpath="count(//flow/block[1]/lineArea[2]//word)"/>
  67. <eval expected="0" xpath="count(//flow/block[1]/lineArea[2]//space)"/>
  68. <eval expected="1" xpath="count(//flow/block[2]/lineArea)"/>
  69. <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]//word)"/>
  70. <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]//space)"/>
  71. <eval expected="3" xpath="count(//flow/block[3]/lineArea)"/>
  72. <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]//word)"/>
  73. <eval expected="90" xpath="count(//flow/block[3]/lineArea[1]//space)"/>
  74. <eval expected="1" xpath="count(//flow/block[3]/lineArea[2]//word)"/>
  75. <eval expected="96" xpath="count(//flow/block[3]/lineArea[2]//space)"/>
  76. <eval expected="0" xpath="count(//flow/block[3]/lineArea[3]//word)"/>
  77. <eval expected="38" xpath="count(//flow/block[3]/lineArea[3]//space)"/>
  78. <eval expected="2" xpath="count(//flow/block[4]/lineArea)"/>
  79. <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]//word)"/>
  80. <eval expected="58" xpath="count(//flow/block[4]/lineArea[1]//space)"/>
  81. <eval expected="1" xpath="count(//flow/block[4]/lineArea[2]//word)"/>
  82. <eval expected="77" xpath="count(//flow/block[4]/lineArea[2]//space)"/>
  83. <eval expected="2" xpath="count(//flow/block[5]/lineArea)"/>
  84. <eval expected="2" xpath="count(//flow/block[5]/lineArea[1]//word)"/>
  85. <eval expected="56" xpath="count(//flow/block[5]/lineArea[1]//space)"/>
  86. <eval expected="1" xpath="count(//flow/block[5]/lineArea[2]//word)"/>
  87. <eval expected="72" xpath="count(//flow/block[5]/lineArea[2]//space)"/>
  88. </checks>
  89. </testcase>