[xsl] fo:inline within fo:basic-link (extra output space)

Subject: [xsl] fo:inline within fo:basic-link (extra output space)
From: Khaled Aly <ka.aly@xxxxxxxxxx>
Date: Tue, 13 Nov 2007 03:34:03 +0200
Hi

I'm re-sending this problem as I didn't re-phrase after having posted it to FO and concluded that it is either FO or FOP related.

The problem is that, as per below fragments, a fo:inline within fo:basic-link in an XSLT template, gets padded with an extra space at left and right in the resulting FO and consequently PDF output file.

- The same FO results from both FOP and XEP.

- The problem is eliminated if the space is removed manually in the FO file before transforming to PDF.

I tried adding <xsl:strip-space fo:inline> but it didn't seem to apply to a fo element.

Keeping the fo:inline within fo:basic-link is needed to provide the normal web link appearance.

Has anyone experienced this problem and/or an XSLT solution?

Many thanks for help
Khaled

-------------------------------------------------------------------------------------------

I've added the element WebLink to xsl:strip-space to overcome, but didn't work.

The source XML is:

employing <WebLink url="http://www.xml.org"; <http://www.xml.org>>XML</WebLink>-based single-sourcing.


The XSLT for element WebLink:


<xsl:template match="WebLink">
<fo:basic-link>
<xsl:attribute name="external-destination"><xsl:value-of select="@url"/></xsl:attribute>
<fo:inline color="blue" text-decoration="underline"><xsl:apply-templates/></fo:inline>
</fo:basic-link>
</xsl:template>



The Saxon generated FO is:


employing <fo:basic-link external-destination="http://www.xml.org"; <http://www.xml.org>> <fo:inline color="blue" text-decoration="underline">XML</fo:inline>
</fo:basic-link>-based single-sourcing



And the FOP 0.93 (and XEP 4) generated PDF is (an extra space around the term "XML"; two spaces to the left and an unintended space before the dash):


employing XML -based single-sourcing.


When the FO is edited to ensure no extra space around the <fo:inline>, the PDF comes fine:


employing XML-based single-sourcing.

-------------------------------------------------------------------------------------------------------

Current Thread