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.

block.xml 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" standalone="no"?>
  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. <testcase>
  17. <info>
  18. <p>
  19. This test checks that IDs coming from a block properly appear in the IF output.
  20. </p>
  21. </info>
  22. <fo>
  23. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  24. <fo:layout-master-set>
  25. <fo:simple-page-master master-name="page"
  26. page-height="320pt" page-width="420pt" margin="10pt">
  27. <fo:region-body/>
  28. </fo:simple-page-master>
  29. </fo:layout-master-set>
  30. <fo:page-sequence master-reference="page">
  31. <fo:flow flow-name="xsl-region-body" text-align="justify">
  32. <fo:block>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce rutrum leo a diam
  33. bibendum auctor. Vivamus porttitor sollicitudin tortor eu vulputate.</fo:block>
  34. <fo:block id="block" space-before="10pt" color="purple" font-family="serif">In vel libero
  35. libero, a semper est. Vivamus dapibus ante id lorem mattis eget mattis urna sodales.
  36. Vestibulum nec dui urna, in porta mi.</fo:block>
  37. <fo:block space-before="10pt">Proin varius egestas erat. Proin ante eros, consequat eget
  38. semper a, molestie non arcu. Praesent hendrerit dolor vel leo luctus dapibus.</fo:block>
  39. </fo:flow>
  40. </fo:page-sequence>
  41. </fo:root>
  42. </fo>
  43. <if-checks xmlns:if="http://xmlgraphics.apache.org/fop/intermediate">
  44. <eval expected="8" xpath="count(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'])"/>
  45. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][1])"/>
  46. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][2])"/>
  47. <eval expected="id" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][3])"/>
  48. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][4])"/>
  49. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][5])"/>
  50. <eval expected="id" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][6])"/>
  51. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][7])"/>
  52. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][8])"/>
  53. <eval expected="block" xpath="//if:page-sequence/descendant::*[local-name() = 'id'][1]/@name"/>
  54. <eval expected="" xpath="//if:page-sequence/descendant::*[local-name() = 'id'][2]/@name"/>
  55. </if-checks>
  56. </testcase>