xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joachim Diepstraten / media access <Joachim.Diepstra...@media-access.net>
Subject RE: Line-breaks?
Date Fri, 05 Jan 2001 08:27:57 GMT
Hi Belinda

>Mm. I hadn't noticed that before. Well, I only get that sometimes. See this
code:

I'll get it all the time. First I thought maybe it's a problem as &#0xD is
CR and LF. So I tried &#0xA which is
the unixcode but the result was the same. Then I had a closer look at the
PDF and the first character of this
line really starts at a different position as the first character of the
line before. (Hmm could this be a bug?
Or is that the suitable behaviour?). After serveral more hours I came up
with this workarround :

<xsl:template match="block">
	<xsl:variable name="test">
		<xsl:value-of select="."/>
	</xsl:variable>
	<xsl:variable name="test2">
		<xsl:value-of select="substring-before($test,'#b#')"/>
	</xsl:variable>
	<xsl:variable name="test3">
		<xsl:value-of select="substring-after($test,'#b#')"/>
	</xsl:variable>						
	<fo:block end-indent="7.2cm" text-align="start"
			     font-size="10pt" 
			     line-height="17.5pt"
	  		     font-family="Helvetica" 
		  	     space-after.optimum="18pt">
	<xsl:if test="not(contains($test,'#b#'))">
		<xsl:value-of select="."/>
	</xsl:if>
	<xsl:if test="contains($test,'#b#')">
		<xsl:value-of select="$test2"/>
		<xsl:call-template name="forceLineBreak"/>		
		<xsl:value-of select="$test3"/>		  	     
	</xsl:if>
	</fo:block>
</xsl:template>

<xsl:template name="forceLineBreak">
	<fo:block end-indent="18.0cm"
font-weight="bold"><xsl:text></xsl:text></fo:block>			
</xsl:template>

Interestingly enough I have to include the code in a template. When I place
the line

	<fo:block end-indent="18.0cm"
font-weight="bold"><xsl:text></xsl:text></fo:block>			

directly inside the second if statement nothing happens? Any reason why?

Your sincerly,
   J.D.

Mime
View raw message