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.

uri-external-graphic.xml 3.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Copyright 2005 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 URI references to external-graphics.
  19. </p>
  20. </info>
  21. <fo>
  22. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  23. <fo:layout-master-set>
  24. <fo:simple-page-master master-name="normal" page-width="210mm" page-height="297mm">
  25. <fo:region-body/>
  26. </fo:simple-page-master>
  27. </fo:layout-master-set>
  28. <fo:page-sequence master-reference="normal" white-space-collapse="true">
  29. <fo:flow flow-name="xsl-region-body">
  30. <fo:block>plain external-graphic (relative URI)</fo:block>
  31. <fo:block>
  32. <fo:external-graphic src="../../resources/images/bgimg300dpi.jpg"/>EOG
  33. </fo:block>
  34. <fo:block>plain external-graphic (relative URI with scheme)</fo:block>
  35. <fo:block>
  36. <fo:external-graphic src="file:../../resources/images/bgimg300dpi.jpg"/>EOG
  37. </fo:block>
  38. <!-- Commented out until portable solution found
  39. <fo:block>plain external-graphic (absolute URI)</fo:block>
  40. <fo:block>
  41. <fo:external-graphic src="/home/mm/fop-trunk/test/resources/images/bgimg300dpi.jpg"/>EOG
  42. </fo:block>
  43. <fo:block>plain external-graphic (absolute URI with scheme)</fo:block>
  44. <fo:block>
  45. <fo:external-graphic src="file:/home/mm/fop-trunk/test/resources/images/bgimg300dpi.jpg"/>EOG
  46. </fo:block>
  47. -->
  48. <fo:block>plain external-graphic (relative URI using url(...) function)</fo:block>
  49. <fo:block>
  50. <fo:external-graphic src="url(../../resources/images/bgimg300dpi.jpg)"/>EOG
  51. </fo:block>
  52. <fo:block>plain external-graphic (absolute HTTP URI)</fo:block>
  53. <fo:block>
  54. <fo:external-graphic src="http://xml.apache.org/fop/images/logo.jpg"/>EOG
  55. </fo:block>
  56. <fo:block>EOF</fo:block>
  57. </fo:flow>
  58. </fo:page-sequence>
  59. </fo:root>
  60. </fo>
  61. <checks>
  62. <eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@ipd"/>
  63. <eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@ipda"/>
  64. <eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@bpd"/>
  65. <eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@bpda"/>
  66. <eval expected="46080" xpath="//flow/block[4]/lineArea/viewport/@ipd"/>
  67. <eval expected="46080" xpath="//flow/block[4]/lineArea/viewport/@ipda"/>
  68. <eval expected="46080" xpath="//flow/block[4]/lineArea/viewport/@bpd"/>
  69. <eval expected="46080" xpath="//flow/block[4]/lineArea/viewport/@bpda"/>
  70. <eval expected="46080" xpath="//flow/block[6]/lineArea/viewport/@ipd"/>
  71. <eval expected="46080" xpath="//flow/block[6]/lineArea/viewport/@ipda"/>
  72. <eval expected="46080" xpath="//flow/block[6]/lineArea/viewport/@bpd"/>
  73. <eval expected="46080" xpath="//flow/block[6]/lineArea/viewport/@bpda"/>
  74. <eval expected="120000" xpath="//flow/block[8]/lineArea/viewport/@ipd"/>
  75. <eval expected="120000" xpath="//flow/block[8]/lineArea/viewport/@ipda"/>
  76. <eval expected="65000" xpath="//flow/block[8]/lineArea/viewport/@bpd"/>
  77. <eval expected="65000" xpath="//flow/block[8]/lineArea/viewport/@bpda"/>
  78. </checks>
  79. </testcase>