選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ps-extension_1.xml 5.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 the PostScript extension for custom setup code. The extension attachments need to show
  21. up in the area tree XML so the AreaTreeParser can fully restore the area tree.
  22. </p>
  23. </info>
  24. <fo>
  25. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ps="http://xmlgraphics.apache.org/fop/postscript">
  26. <fo:layout-master-set>
  27. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  28. <fo:region-body/>
  29. <ps:ps-page-setup-code name="media-dict">%FOPTestPSPageSetupCode: MediaDict!</ps:ps-page-setup-code>
  30. <ps:ps-page-setup-code name="bla">%FOPTestPSPageSetupCode: Blah blah!</ps:ps-page-setup-code>
  31. </fo:simple-page-master>
  32. </fo:layout-master-set>
  33. <fo:declarations>
  34. <ps:ps-setup-code>%FOPTestPSSetupCode: General setup code here!</ps:ps-setup-code>
  35. <ps:ps-setup-code name="multi-line">
  36. %FOPTestPSSetupCode: Line 1
  37. %FOPTestPSSetupCode: Line 2
  38. </ps:ps-setup-code>
  39. </fo:declarations>
  40. <fo:page-sequence master-reference="normal">
  41. <fo:flow flow-name="xsl-region-body">
  42. <fo:block>Text on page <fo:page-number/>.</fo:block>
  43. <fo:block break-before="page">Text on page <fo:page-number/>.</fo:block>
  44. </fo:flow>
  45. </fo:page-sequence>
  46. </fo:root>
  47. </fo>
  48. <checks>
  49. <eval expected="2" xpath="count(/areaTree/extension-attachments/child::*)"/>
  50. <eval expected="%FOPTestPSSetupCode: General setup code here!" xpath="/areaTree/extension-attachments/child::*[1]"/>
  51. <true xpath="contains(/areaTree/extension-attachments/child::*[2], '%FOPTestPSSetupCode: Line 1')"/>
  52. <eval expected="multi-line" xpath="/areaTree/extension-attachments/child::*[2]/@name"/>
  53. <eval expected="2" xpath="count(/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*)"/>
  54. <eval expected="media-dict" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[1]/@name"/>
  55. <eval expected="%FOPTestPSPageSetupCode: MediaDict!" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[1]"/>
  56. <eval expected="bla" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[2]/@name"/>
  57. <eval expected="%FOPTestPSPageSetupCode: Blah blah!" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[2]"/>
  58. <eval expected="2" xpath="count(/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*)"/>
  59. <eval expected="media-dict" xpath="/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*[1]/@name"/>
  60. <eval expected="%FOPTestPSPageSetupCode: MediaDict!" xpath="/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*[1]"/>
  61. <eval expected="bla" xpath="/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*[2]/@name"/>
  62. <eval expected="%FOPTestPSPageSetupCode: Blah blah!" xpath="/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*[2]"/>
  63. </checks>
  64. <if-checks xmlns:if="http://xmlgraphics.apache.org/fop/intermediate">
  65. <eval expected="3" xpath="count(/if:document/if:header/child::*)"/>
  66. <eval expected="%FOPTestPSSetupCode: General setup code here!" xpath="/if:document/if:header/child::*[1]"/>
  67. <true xpath="contains(/if:document/if:header/child::*[2], '%FOPTestPSSetupCode: Line 1')"/>
  68. <eval expected="multi-line" xpath="/if:document/if:header/child::*[2]/@name"/>
  69. <eval expected="2" xpath="count(//if:page[@index=0]/if:page-header/child::*)"/>
  70. <eval expected="media-dict" xpath="//if:page[@index=0]/if:page-header/child::*[1]/@name"/>
  71. <eval expected="%FOPTestPSPageSetupCode: MediaDict!" xpath="//if:page[@index=0]/if:page-header/child::*[1]"/>
  72. <eval expected="bla" xpath="//if:page[@index=0]/if:page-header/child::*[2]/@name"/>
  73. <eval expected="%FOPTestPSPageSetupCode: Blah blah!" xpath="//if:page[@index=0]/if:page-header/child::*[2]"/>
  74. <eval expected="2" xpath="count(//if:page[@index=1]/if:page-header/child::*)"/>
  75. <eval expected="media-dict" xpath="//if:page[@index=1]/if:page-header/child::*[1]/@name"/>
  76. <eval expected="%FOPTestPSPageSetupCode: MediaDict!" xpath="//if:page[@index=1]/if:page-header/child::*[1]"/>
  77. <eval expected="bla" xpath="//if:page[@index=1]/if:page-header/child::*[2]/@name"/>
  78. <eval expected="%FOPTestPSPageSetupCode: Blah blah!" xpath="//if:page[@index=1]/if:page-header/child::*[2]"/>
  79. </if-checks>
  80. </testcase>