<?xml version="1.0" encoding="utf-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: block_hyphenation_linefeed_preserve.xml 1039188 2010-11-25 21:27:44Z adelmelle $ -->
<testcase>
  <info>
    <p>
      Check for bug 38264: 
      <ul>
        <li>duplication of content with linefeed-treatment="preserve" and hyphenate="true"</li>
        <li>missing hyphens with white-space-treatment="preserve" and hyphenate="true"</li>
      </ul>
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" language="en" hyphenate="true">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="simple" page-height="5in" page-width="1in">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="simple">
        <fo:flow flow-name="xsl-region-body">
          <fo:block white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve">
line1
line2

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas semper. Proin at.
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>
    <!-- check number of lines and word fragments -->
    <eval expected="13" xpath="count(//flow[1]/block/lineArea)" />
    <eval expected="17" xpath="count(//flow[1]/block/lineArea/text/word)" />
    <!-- check individual word fragments -->
    <eval expected="line1" xpath="(//flow[1]/block/lineArea/text/word)[1]" />
    <eval expected="line2" xpath="(//flow[1]/block/lineArea/text/word)[2]" />
    <eval expected="Lorem" xpath="(//flow[1]/block/lineArea/text/word)[3]" />
    <eval expected="ip-" xpath="(//flow[1]/block/lineArea/text/word)[4]" />
    <eval expected="sum" xpath="(//flow[1]/block/lineArea/text/word)[5]" />
    <eval expected="dolor" xpath="(//flow[1]/block/lineArea/text/word)[6]" />
    <eval expected="sit" xpath="(//flow[1]/block/lineArea/text/word)[7]" />
    <eval expected="amet," xpath="(//flow[1]/block/lineArea/text/word)[8]" />
    <eval expected="con-" xpath="(//flow[1]/block/lineArea/text/word)[9]" />
    <eval expected="sectetuer" xpath="(//flow[1]/block/lineArea/text/word)[10]" />
    <eval expected="adipiscing" xpath="(//flow[1]/block/lineArea/text/word)[11]" />
    <eval expected="elit." xpath="(//flow[1]/block/lineArea/text/word)[12]" />
    <eval expected="Maece-" xpath="(//flow[1]/block/lineArea/text/word)[13]" />
    <eval expected="nas" xpath="(//flow[1]/block/lineArea/text/word)[14]" />
    <eval expected="semper." xpath="(//flow[1]/block/lineArea/text/word)[15]" />
    <eval expected="Proin" xpath="(//flow[1]/block/lineArea/text/word)[16]" />
    <eval expected="at." xpath="(//flow[1]/block/lineArea/text/word)[17]" />
    <!-- check preservation of spaces on the last line -->
    <eval expected="10" xpath="count((//flow[1]/block/lineArea)[13]/text/space)" />
  </checks>
</testcase>
