Search code examples
xsl-foapache-fopaltova

Curved Borders for dynamic free flow tables in altova stylevision or xsl-fo without using the border-radius property


Iam new to Altova Stylevision and xsl-fo . I need to have curved borders for tables which are dynamic and flow across multiple pages. The border-radius property is not working as the property is neither recognized at table level nor row level nor cell level by xsl-fo processor.I could not give the exact exception thrown when using the border-radius property as I have completed using the trail version.

Please find the details below:

<fo:root xmlns:altova="http://www.altova.com" 
         xmlns:fo="http://www.w3.org/1999/XSL/Format"
         xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">

I have used the fop extension from trunk and included the above line at the top of the XML.

Below is piece of my code which i have used to create curved border for cell.

<fo:table-cell visibility="hidden" padding="0" display-align="center"> 
  <fo:block-container overflow="hidden"> 
   <fo:block text-align="center" fox:border-before-radius-start="7mm" 
             fox:border-start-radius-before="7mm"> 
     <fo:inline font-family="RonBscRg" font-size="7pt">ee</fo:inline> 
   </fo:block> 
  </fo:block-container> 
</fo:table-cell> 

Please help.


Solution

  • Important: to get rounded corners, you must use the trunk (development) version of FOP. It does not work with the latest released version (FOP 1.1). See also http://wiki.apache.org/xmlgraphics-fop/RoundedBorders.

    FOP trunk can be obtained by checking out the code from the Subversion repository and compiling as described here.

    There are also nightly snapshots.


    The main problem with the FO code in the question is that the names of the radius properties are wrong. See the specification at http://xmlgraphics.apache.org/fop/trunk/extensions.html#rounded-corners. Also note that under Current Limitations, it says:

    Rounded corners on tables are not directly supported. To set rounded corners at the table level the table must have the border-collapse property set to separate.


    It is not clear exactly what you want the output to look like, but with the following fo:block instead of the one in the question, you should see a noticeable difference:

    <fo:block text-align="center" border-style="solid"
              fox:border-before-start-radius="7mm"
              fox:border-before-end-radius="7mm"> 
      <fo:inline font-family="RonBscRg" font-size="7pt">ee</fo:inline> 
    </fo:block> 
    

    If you want all four corners rounded, simply use the shorthand fox:border-radius.