Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

block_white-space-treatment_3.xml 5.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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="false" and the presence of inlines.
  22. This test currently fails because white-space-treatment stops at inline
  23. boundaries when it comes to formatter generated line breaks.
  24. </p>
  25. </info>
  26. <fo>
  27. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  28. <fo:layout-master-set>
  29. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  30. <fo:region-body/>
  31. </fo:simple-page-master>
  32. </fo:layout-master-set>
  33. <fo:page-sequence master-reference="normal" white-space-collapse="false">
  34. <fo:flow flow-name="xsl-region-body">
  35. <fo:block white-space-treatment="ignore-if-surrounding-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
  36. <fo:inline background-color="red"> ignore-if-surrounding-linefeed </fo:inline>
  37. <fo:inline background-color="red"> all </fo:inline>
  38. <fo:inline background-color="red"> spaces </fo:inline>
  39. </fo:block>
  40. <fo:block white-space-treatment="ignore" background-color="silver" margin="1pt 0pt 1pt 0pt">
  41. <fo:inline background-color="red"> ignore </fo:inline>
  42. <fo:inline background-color="red"> all </fo:inline>
  43. <fo:inline background-color="red"> spaces </fo:inline>
  44. </fo:block>
  45. <fo:block white-space-treatment="preserve" background-color="silver" margin="1pt 0pt 1pt 0pt">
  46. <fo:inline background-color="red"> preserve </fo:inline>
  47. <fo:inline background-color="red"> all </fo:inline>
  48. <fo:inline background-color="red"> spaces </fo:inline>
  49. </fo:block>
  50. <fo:block white-space-treatment="ignore-if-before-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
  51. <fo:inline background-color="red"> ignore-if-before-linefeed </fo:inline>
  52. <fo:inline background-color="red"> all </fo:inline>
  53. <fo:inline background-color="red"> spaces </fo:inline>
  54. </fo:block>
  55. <fo:block white-space-treatment="ignore-if-after-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
  56. <fo:inline background-color="red"> ignore-if-after-linefeed </fo:inline>
  57. <fo:inline background-color="red"> all </fo:inline>
  58. <fo:inline background-color="red"> spaces </fo:inline>
  59. </fo:block>
  60. </fo:flow>
  61. </fo:page-sequence>
  62. </fo:root>
  63. </fo>
  64. <checks>
  65. <eval expected="2" xpath="count(//flow/block[1]/lineArea)"/>
  66. <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]//word)"/>
  67. <eval expected="50" xpath="count(//flow/block[1]/lineArea[1]//space)"/>
  68. <eval expected="1" xpath="count(//flow/block[1]/lineArea[2]//word)"/>
  69. <eval expected="0" xpath="count(//flow/block[1]/lineArea[2]//space)"/>
  70. <eval expected="1" xpath="count(//flow/block[2]/lineArea)"/>
  71. <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]//word)"/>
  72. <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]//space)"/>
  73. <eval expected="3" xpath="count(//flow/block[3]/lineArea)"/>
  74. <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]//word)"/>
  75. <eval expected="90" xpath="count(//flow/block[3]/lineArea[1]//space)"/>
  76. <eval expected="1" xpath="count(//flow/block[3]/lineArea[2]//word)"/>
  77. <eval expected="96" xpath="count(//flow/block[3]/lineArea[2]//space)"/>
  78. <eval expected="0" xpath="count(//flow/block[3]/lineArea[3]//word)"/>
  79. <eval expected="38" xpath="count(//flow/block[3]/lineArea[3]//space)"/>
  80. <eval expected="2" xpath="count(//flow/block[4]/lineArea)"/>
  81. <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]//word)"/>
  82. <eval expected="58" xpath="count(//flow/block[4]/lineArea[1]//space)"/>
  83. <eval expected="1" xpath="count(//flow/block[4]/lineArea[2]//word)"/>
  84. <eval expected="77" xpath="count(//flow/block[4]/lineArea[2]//space)"/>
  85. <eval expected="2" xpath="count(//flow/block[5]/lineArea)"/>
  86. <eval expected="2" xpath="count(//flow/block[5]/lineArea[1]//word)"/>
  87. <eval expected="56" xpath="count(//flow/block[5]/lineArea[1]//space)"/>
  88. <eval expected="1" xpath="count(//flow/block[5]/lineArea[2]//word)"/>
  89. <eval expected="72" xpath="count(//flow/block[5]/lineArea[2]//space)"/>
  90. </checks>
  91. </testcase>