OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: DOCBOOK-APPS: Re: Error in column-width property value '33%'

Hi Simon,

the error message occurs because fop doesn't implement tables the way norm's
stylesheets (and the fo spec AFAIK) expect.
A workaround is to transform these %-values with absolute values. I use a
variant of the fo-patch-for-fop.xsl stylesheet that norm provides. I've included
it, but it is probably not the best sample of xsl you'll ever see :-). For
example I have hardcoded the values for the table width and the unit. So you
probably need to adapt it to your needs. Simply transform your source to fo,
then apply this stylesheet to the resulting fo file and  transform that file to
pdf with fop.

I have not yet tried to find a workaround for the other type of error message
[ERROR] Unknown enumerated value for property 'relative-align': baseline
[ERROR] Error in relative-align property value 'baseline':
org.apache.fop.fo.expr.PropertyException: No conversion defined
 Maybe it can be treated the same way. I don't expect that norm fixes this as it
is not a problom of his stylesheet but a insufficient implementation of the fo

Hope this helps

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
 <!-- $Id: table-patch-for-fop.xsl,v 1.2 2002/06/14 19:39:46 Martin Exp $ -->
<xsl:output method="xml" indent="yes"/>

<xsl:template match="*">
  <xsl:element name="{name(.)}">
    <xsl:copy-of select="@*"/>

<xsl:template match="fo:table-column">
  <xsl:variable name="string" select="@column-width"/>
  <xsl:variable name="percent-value">
    <xsl:value-of select="substring-before($string, $percent)"/>
  <xsl:variable name="fraction">
    <xsl:value-of select="$percent-value div 100"/>

  <xsl:element name="{name(.)}">
      <xsl:when test="contains($string,$percent)">
        <xsl:attribute name="column-width">
          <xsl:value-of select="$table-width * $fraction"/>
        <xsl:attribute name="column-width">
          <xsl:value-of select="$string"/>
    <xsl:attribute name="column-number">
      <xsl:value-of select="@column-number"/>

<xsl:param name="percent">%</xsl:param>
<xsl:param name="table-width">15</xsl:param>

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC