您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

block-container.xml 3.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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-container 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-container id="block-container" space-before="10pt" color="purple"
  35. font-family="serif"><fo:block>In vel libero libero, a semper est. Vivamus dapibus ante id
  36. lorem mattis eget mattis urna sodales. Vestibulum nec dui urna, in porta
  37. mi.</fo:block></fo:block-container>
  38. <fo:block space-before="10pt">Proin varius egestas erat. Proin ante eros, consequat eget
  39. semper a, molestie non arcu. Praesent hendrerit dolor vel leo luctus dapibus.</fo:block>
  40. </fo:flow>
  41. </fo:page-sequence>
  42. </fo:root>
  43. </fo>
  44. <if-checks xmlns:if="http://xmlgraphics.apache.org/fop/intermediate">
  45. <eval expected="8" xpath="count(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'])"/>
  46. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][1])"/>
  47. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][2])"/>
  48. <eval expected="id" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][3])"/>
  49. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][4])"/>
  50. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][5])"/>
  51. <eval expected="id" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][6])"/>
  52. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][7])"/>
  53. <eval expected="text" xpath="local-name(//if:page-sequence/descendant::*[local-name() = 'text' or local-name() = 'id'][8])"/>
  54. <eval expected="block-container" xpath="//if:page-sequence/descendant::*[local-name() = 'id'][1]/@name"/>
  55. <eval expected="" xpath="//if:page-sequence/descendant::*[local-name() = 'id'][2]/@name"/>
  56. </if-checks>
  57. </testcase>