2009-10-06 2 views
0

페이지 끝 부분에서 'examClin'이라는 레이블을 분리하고 싶지 않습니다. 그래서 레이블이 페이지 끝 부분에 도착하면 examClin의 @label에 첨부 할 하나 이상의 examClin 행이 필요합니다 ... 또는 두 요소 모두 다음 페이지로 이동해야합니다. 충분히 명확합니까?다음 블록의 첫 줄에 머리글을 유지하십시오.

다른 요소는 ... 우리는

<fo:table-row> 
    <fo:table-cell number-columns-spanned="5"> 
     <fo:block space-before="2mm"> 
      <xsl:value-of select="./examClin/@label"/>: </fo:inline> 
     </fo:block> 
    </fo:table-cell> 
    </fo:table-row> 
<fo:table-row> 
    <fo:table-cell number-columns-spanned="5" padding-top="2mm" padding-bottom="2mm" 
            padding-left="1mm" padding-right="1mm"> 
    <fo:block white-space-collapse="false" font-style="italic" > 
      <xsl:value-of select="./examClin/child::text()"/> 
    </fo:block> 
    </fo:table-cell> 
    </fo:table-row> 

답변

0

가 당신이에 두 개의 테이블 행을 병합해야 함을 의미한다 (하나의 블록으로 담아 페이지의 끝에 도착 하나) keep-together을 사용하십시오.

0

아론 감사합니다. 그러나 나는 매우 긴 텍스트가 있다면 모든 것이 모이고 첫 번째 라인 만 유지하는 것이 아닌가 걱정된다. 결과적으로 이전 페이지에서 긴 흰색 블록을 남길 수 있습니다.

나는 다음과 같은 템플릿을 만들었습니다. 첫 번째 줄이 무엇인지 알아내는 것입니다 : 75 번째 첫 번째 글자가 75 번째 글자 앞에 오는 캐리지를 찾으면 첫 번째 캐리지 앞의 문자열을 가져옵니다. .

<xsl:template name="elem3"> 
    <xsl:choose> 
     <xsl:when test="child::text()"> 
      <xsl:variable name="test0" select="substring(child::text(),1,100000)"/> 
      <xsl:variable name="test1" select="substring(child::text(),0,75)"/> 
      <xsl:variable name="test2" select="substring(child::text(),75,100000)"/> 
      <xsl:variable name="test3" select="substring-before($test2,' ')"/> 
      <xsl:variable name="test4" select="concat($test1,$test3)"/> 
      <xsl:variable name="test5" select="substring-after($test2,' ')"/> 
      <xsl:variable name="test6" select="substring-before($test1,'&#10;')"/> 
      <xsl:variable name="test7" select="substring-after($test0,'&#10;')"/> 
      <fo:table-row> 
       <fo:table-cell number-columns-spanned="5"> 
        <fo:block space-before="2mm"> 
         <fo:inline font-weight="bold"><xsl:value-of select="@label"/>: </fo:inline> 
        </fo:block> 
       </fo:table-cell> 
      </fo:table-row> 
      <xsl:choose> 
       <xsl:when test="child::text()"> 
        <fo:table-row keep-with-previous="always"> 
         <fo:table-cell number-columns-spanned="6" padding-top="2mm" padding-left="1mm" padding-right="1mm"> 
          <fo:block white-space-collapse="false" font-style="italic" > 
          <xsl:choose> 
           <xsl:when test="contains($test1,'&#10;')"> <xsl:value-of select="$test6"/></xsl:when> 
           <xsl:otherwise><xsl:value-of select="$test4"/></xsl:otherwise> 
          </xsl:choose> 
          </fo:block> 
         </fo:table-cell> 
        </fo:table-row> 
        <fo:table-row> 
         <fo:table-cell number-columns-spanned="5" padding-left="1mm" padding-right="1mm"> 
          <fo:block white-space-collapse="false" font-style="italic" > 
           <xsl:choose> 
            <xsl:when test="contains($test1,'&#10;')"><xsl:value-of select="$test7"/></xsl:when> 
            <xsl:otherwise> <xsl:value-of select="$test5"/></xsl:otherwise> 
            </xsl:choose> 
          </fo:block> 
         </fo:table-cell> 
        </fo:table-row> 
       </xsl:when> 
      </xsl:choose> 
     </xsl:when> 
    </xsl:choose> 
</xsl:template> 
관련 문제