You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Steven Berkowitz <st...@psilent.com> on 2003/02/21 16:25:05 UTC

fo:basic-link from

I'm trying to have url's included inline in a paragraph.  The relevant code is:

---
<xsl:template match="summary">
  <fo:block font-size="11pt">
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

<xsl:template match="link">
      <fo:basic-link>
        <xsl:attribute name="external-destination"><xsl:value-of
select="url"/></xsl:attribute>
        <xsl:attribute name="color">blue</xsl:attribute>
        <xsl:value-of select="text"/>
      </fo:basic-link>
</xsl:template>
---

Where the summary element in the XML is mixed content containing a link element.

When I try to convert the XML document to PDF, I get the following error:
"org.apache.fops.apps.FOPException:  inline formatting objects cannot be
directly under flow"

Okay, if I surround the <fo:basic-link>...</fo:basic-link> block with
<fo:block></fo:block> tags, the PDF is generated but the link is placed on its
own line, which is obviously not a desired result.

Any suggestions, work arounds, etc., would be most appreciated.

TIA,

Steven Berkowitz

PS - if this is an XSL:FO issue and not a FOP issue, feel free to tell me RTFM,
I've got a thick skin.  Googling around, though didn't get me anywhere, so here
we are.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: fo:basic-link from

Posted by Steven Berkowitz <st...@psilent.com>.
Not the best way to enter a list, replying to your own first post, but I found
a solution so I thought I'd post it.

Instead of explicity using <fo:basic-link>, I used  <xsl:element
name="fo:basic-link"> so this:


>       <fo:basic-link>
>         <xsl:attribute name="external-destination"><xsl:value-of  select="url"/></xsl:attribute>
>         <xsl:attribute name="color">blue</xsl:attribute>
>         <xsl:value-of select="text"/>
>       </fo:basic-link>

becomes this:

       <xsl:element name="fo:basic-link">
         <xsl:attribute name="external-destination"><xsl:value-of 
select="url"/></xsl:attribute>
         <xsl:attribute name="color">blue</xsl:attribute>
         <xsl:value-of select="text"/>
       </xsl:element>

and it works as expected.  Curious behavior and if someone wanted to explain
the difference, that would be nifty but, obviously, not vital.

Thanks again and sorry for this.

Steven Berkowitz

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org