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_1.xml 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 white space handling for white-space-treatment
  21. with white-space-collapse="true".
  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="true">
  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. ignore-if-surrounding-linefeed
  35. all
  36. spaces
  37. </fo:block>
  38. <fo:block white-space-treatment="ignore" background-color="silver" margin="1pt 0pt 1pt 0pt">
  39. ignore
  40. all
  41. spaces
  42. </fo:block>
  43. <fo:block white-space-treatment="preserve" background-color="silver" margin="1pt 0pt 1pt 0pt">
  44. preserve
  45. all
  46. spaces
  47. </fo:block>
  48. <fo:block white-space-treatment="ignore-if-before-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
  49. ignore-if-before-linefeed
  50. all
  51. spaces
  52. </fo:block>
  53. <fo:block white-space-treatment="ignore-if-after-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
  54. ignore-if-after-linefeed
  55. all
  56. spaces
  57. </fo:block>
  58. </fo:flow>
  59. </fo:page-sequence>
  60. </fo:root>
  61. </fo>
  62. <checks>
  63. <eval expected="3" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
  64. <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
  65. <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]/text/word)"/>
  66. <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/space)"/>
  67. <eval expected="3" xpath="count(//flow/block[3]/lineArea[1]/text/word)"/>
  68. <eval expected="4" xpath="count(//flow/block[3]/lineArea[1]/text/space)"/>
  69. <eval expected="3" xpath="count(//flow/block[4]/lineArea[1]/text/word)"/>
  70. <eval expected="3" xpath="count(//flow/block[4]/lineArea[1]/text/space)"/>
  71. <eval expected="3" xpath="count(//flow/block[5]/lineArea[1]/text/word)"/>
  72. <eval expected="3" xpath="count(//flow/block[5]/lineArea[1]/text/space)"/>
  73. </checks>
  74. </testcase>