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 Sven <tz...@gmx.de> on 2006/02/13 14:54:54 UTC

white-space-collapse not working in trunk?

Hi there,

again a short question: The FAQ is telling that using 
white-space-collapse="false" in a <fo:block/> is all you need to output 
preformatted text. Well, not for me. Whitespaces will still collapse. I 
am using the latest trunk (revision 377250). Am I doing something worng 
or is this a bug?

Thank you guys for your pretty good work. I would have never imagined to 
use trunk code in such a prolific way (to write my diploma thesis 
especially =)


Here is a brief example:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
        <fo:simple-page-master margin="4.5cm" page-width="21cm"
            page-height="29.7cm" master-name="titlepage">
            <fo:region-body />
        </fo:simple-page-master>
        <fo:simple-page-master margin="2.5cm" page-width="21cm"
            page-height="29.7cm" master-name="default">
            <fo:region-body margin-bottom="1cm" margin-top="1cm" />
            <fo:region-before extent="1cm" />
            <fo:region-after extent="1cm" />
        </fo:simple-page-master>
    </fo:layout-master-set>

    <fo:page-sequence language="de" master-reference="default">
        <fo:static-content flow-name="xsl-region-before">
            <fo:block page-break-after="avoid"
                border-bottom="solid 1px silver" text-align="end" 
font-size="10pt"
                font-family="Helvetica">
                Grundlagen
            </fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after">
            <fo:block font-size="12pt" font-family="Helvetica">
                <fo:page-number />
            </fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-footnote-separator">
            <fo:block>
                <fo:leader leader-length="100px" leader-pattern="rule" />
            </fo:block>
        </fo:static-content>
        <fo:flow flow-name="xsl-region-body">

            <fo:block hyphenation-remain-character-count="4"
                hyphenate="false" space-after="0.5em" text-align="justify"
                font-size="12pt" font-family="Times">
                Die JADE Extension ist eine an der Universität Hamburg
                entwickelte BDI Reasoning-Engine, die in Java
                geschrieben wurde. Ursprünglich als Erweiterung des

                Java Agent Development Framework

                konzipiert, sollte Jadex die Defizite von JADE
                beseitigen. Da sich die Entwickler von JADE auf die
                Konformität mit den FIPA-Spezifikationen und die
                Entwicklung von Werkzeugen zum Testen der Agenten
                konzentriert haben, blieb die Umsetzung eines internen
                Agentenkonzeptes bewusst unberücksichtigt
                <fo:inline>
                    <fo:basic-link
                        internal-destination="reference-PBL03">
                        [PBL03]
                    </fo:basic-link>
                </fo:inline>
                . Jadex war die Lösung dieses Defizits, indem es auf
                Basis der relativ einfach gestrickten JADE-Agenten ein
                Framework aufsetzte, das die Entwicklung von BDI-Agenten
                ermöglichte.
            </fo:block>
            <fo:block page-break-inside="avoid" margin="1em" 
space-after="0.5em" font-size="10pt" font-family="Helvetica" 
id="code-adf_aufbau">
<fo:block border-bottom="solid 1px gray" border-top="solid 1px gray" 
linefeed-treatment="preserve" white-space-collapse="false" 
font-size="10pt" font-family="Courier">
&lt;agent xmlns="http://jadex.sourceforge.net/jadex"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jadex.sourceforge.net/jadex
                        http://jadex.sourceforge.net/jadex-0.94.xsd"
    name="AgentTypeName"
    package="your.package.here"&gt;

    &lt;imports&gt;
        &lt;!-- 1.) java imports --&gt;
    &lt;/imports&gt;

    &lt;capabilities&gt;
        &lt;!-- 2.) by this agent used capabilties --&gt;
    &lt;/capabilities&gt;

    &lt;beliefs&gt;
        &lt;!-- 3.)beliefs of this agent --&gt;
    &lt;/beliefs&gt;

    &lt;goals&gt;
        &lt;!-- 4.) The goals the agent may have --&gt;
    &lt;/goals&gt;

    &lt;plans&gt;
        &lt;!-- 5.) The plan library --&gt;
    &lt;/plans&gt;

    &lt;events&gt;
        &lt;!-- 6.) All known events (messages, goals and internal 
events) --&gt;
    &lt;/events&gt;

    &lt;expressions&gt;
        &lt;!-- 7.) used expressions and conditions --&gt;
    &lt;/expressions&gt;

    &lt;properties&gt;
        &lt;!-- 8.) static values needed by this agent --&gt;
    &lt;/properties&gt;

    &lt;initialstates&gt;
        &lt;!-- 9.) possibility to start agent with different initial 
states,
                  like inital goals, plans or beliefs e.g. --&gt;
    &lt;/initialstates&gt;

&lt;/agent&gt;
                    test XXX

                </fo:block>
<fo:block>
                            Code-Auszug 1:
                        Aufbau des ADF von Jadex Agenten</fo:block>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>


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


Re: white-space-collapse not working in trunk?

Posted by Manuel Mall <mm...@arcus.com.au>.
> On Mon, Feb 13, 2006 at 10:52:07PM +0800, Manuel Mall wrote:
>> On Monday 13 February 2006 21:54, Sven wrote:
>> > Hi there,
>> >
>> > again a short question: The FAQ is telling that using
>> > white-space-collapse="false" in a <fo:block/> is all you need to
>> > output preformatted text. Well, not for me. Whitespaces will still
>> > collapse. I am using the latest trunk (revision 377250). Am I doing
>> > something worng or is this a bug?
>> >
>> It's a known bug. Especially leading white space, that is white space at
>> the beginning of each line is incorrectly removed.
>
> Is it a bug? The default values of suppress-at-line-break="auto" and
> white-space-treatment="ignore-if-surrounding-linefeed" specify that
> the space character is removed around a line break, even when
> white-space-collapse="false". I refer here to the draft of XSL 1.1,
> which in our opinion clarifies the confusing corresponding parts of
> XSL 1.0. See our efforts to come to grips with this on the Wiki:
> http://wiki.apache.org/xmlgraphics-fop/LineLayout/WhitespaceHandling.
>
> Note that TeX would show a similar behaviour: It removes white space
> at the start of a line, even when white space is not collapsed.
>
> Maybe you should use a zero-width fo:inline element at the start of
> the line to suppress the suppression.
>

Simon,

you are correct white-space-collapse="false" doesn't preserve white space
around line breaks. The FAQ refers to 0.20.5 but for 0.91 trunk the
shorthand property white-space="pre" should be used or its expanded
equivalents:
   linefeed-treatment="preserve"
   white-space-collapse="false"
   white-space-treatment="preserve"
   wrap-option="no-wrap"

If you do that the bug I was referring to would show because
white-space-treatment="preserve" is not correctly implemented.

> Regards, Simon

Manuel

>
>> > <fo:block border-bottom="solid 1px gray" border-top="solid 1px gray"
>> > linefeed-treatment="preserve" white-space-collapse="false"
>> > font-size="10pt" font-family="Courier">
>> > &lt;agent xmlns="http://jadex.sourceforge.net/jadex"
>> >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >     xsi:schemaLocation="http://jadex.sourceforge.net/jadex
>> >                         http://jadex.sourceforge.net/jadex-0.94.xsd"
>> >     name="AgentTypeName"
>> >     package="your.package.here"&gt;
>> >
>> >     &lt;imports&gt;
>> >         &lt;!-- 1.) java imports --&gt;
>> >     &lt;/imports&gt;
>> >
>> >     &lt;capabilities&gt;
>> >         &lt;!-- 2.) by this agent used capabilties --&gt;
>> >     &lt;/capabilities&gt;
>> >
>> >     &lt;beliefs&gt;
>> >         &lt;!-- 3.)beliefs of this agent --&gt;
>> >     &lt;/beliefs&gt;
>> >
>> >     &lt;goals&gt;
>> >         &lt;!-- 4.) The goals the agent may have --&gt;
>> >     &lt;/goals&gt;
>> >
>> >     &lt;plans&gt;
>> >         &lt;!-- 5.) The plan library --&gt;
>> >     &lt;/plans&gt;
>> >
>> >     &lt;events&gt;
>> >         &lt;!-- 6.) All known events (messages, goals and internal
>> > events) --&gt;
>> >     &lt;/events&gt;
>> >
>> >     &lt;expressions&gt;
>> >         &lt;!-- 7.) used expressions and conditions --&gt;
>> >     &lt;/expressions&gt;
>> >
>> >     &lt;properties&gt;
>> >         &lt;!-- 8.) static values needed by this agent --&gt;
>> >     &lt;/properties&gt;
>> >
>> >     &lt;initialstates&gt;
>> >         &lt;!-- 9.) possibility to start agent with different initial
>> > states,
>> >                   like inital goals, plans or beliefs e.g. --&gt;
>> >     &lt;/initialstates&gt;
>> >
>> > &lt;/agent&gt;
>> >                     test XXX
>> >
>> >                 </fo:block>
>
> --
> Simon Pepping
> home page: http://www.leverkruid.nl
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



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


Re: white-space-collapse not working in trunk?

Posted by Simon Pepping <sp...@leverkruid.nl>.
On Mon, Feb 13, 2006 at 10:52:07PM +0800, Manuel Mall wrote:
> On Monday 13 February 2006 21:54, Sven wrote:
> > Hi there,
> >
> > again a short question: The FAQ is telling that using
> > white-space-collapse="false" in a <fo:block/> is all you need to
> > output preformatted text. Well, not for me. Whitespaces will still
> > collapse. I am using the latest trunk (revision 377250). Am I doing
> > something worng or is this a bug?
> >
> It's a known bug. Especially leading white space, that is white space at 
> the beginning of each line is incorrectly removed.

Is it a bug? The default values of suppress-at-line-break="auto" and
white-space-treatment="ignore-if-surrounding-linefeed" specify that
the space character is removed around a line break, even when
white-space-collapse="false". I refer here to the draft of XSL 1.1,
which in our opinion clarifies the confusing corresponding parts of
XSL 1.0. See our efforts to come to grips with this on the Wiki:
http://wiki.apache.org/xmlgraphics-fop/LineLayout/WhitespaceHandling.

Note that TeX would show a similar behaviour: It removes white space
at the start of a line, even when white space is not collapsed.

Maybe you should use a zero-width fo:inline element at the start of
the line to suppress the suppression.

Regards, Simon

> > <fo:block border-bottom="solid 1px gray" border-top="solid 1px gray"
> > linefeed-treatment="preserve" white-space-collapse="false"
> > font-size="10pt" font-family="Courier">
> > &lt;agent xmlns="http://jadex.sourceforge.net/jadex"
> >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >     xsi:schemaLocation="http://jadex.sourceforge.net/jadex
> >                         http://jadex.sourceforge.net/jadex-0.94.xsd"
> >     name="AgentTypeName"
> >     package="your.package.here"&gt;
> >
> >     &lt;imports&gt;
> >         &lt;!-- 1.) java imports --&gt;
> >     &lt;/imports&gt;
> >
> >     &lt;capabilities&gt;
> >         &lt;!-- 2.) by this agent used capabilties --&gt;
> >     &lt;/capabilities&gt;
> >
> >     &lt;beliefs&gt;
> >         &lt;!-- 3.)beliefs of this agent --&gt;
> >     &lt;/beliefs&gt;
> >
> >     &lt;goals&gt;
> >         &lt;!-- 4.) The goals the agent may have --&gt;
> >     &lt;/goals&gt;
> >
> >     &lt;plans&gt;
> >         &lt;!-- 5.) The plan library --&gt;
> >     &lt;/plans&gt;
> >
> >     &lt;events&gt;
> >         &lt;!-- 6.) All known events (messages, goals and internal
> > events) --&gt;
> >     &lt;/events&gt;
> >
> >     &lt;expressions&gt;
> >         &lt;!-- 7.) used expressions and conditions --&gt;
> >     &lt;/expressions&gt;
> >
> >     &lt;properties&gt;
> >         &lt;!-- 8.) static values needed by this agent --&gt;
> >     &lt;/properties&gt;
> >
> >     &lt;initialstates&gt;
> >         &lt;!-- 9.) possibility to start agent with different initial
> > states,
> >                   like inital goals, plans or beliefs e.g. --&gt;
> >     &lt;/initialstates&gt;
> >
> > &lt;/agent&gt;
> >                     test XXX
> >
> >                 </fo:block>

-- 
Simon Pepping
home page: http://www.leverkruid.nl


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


Logger question

Posted by Melih Ovadya <mo...@jaspersoft.com>.
Hi,

I am having difficulties with the priority settings of the logger FOP is
using. I use org.apache.log4j, I set the priority of my loggers in
log4j.xml, and it works fine everywhere in my code except when using FOP.
Can someone please point me out what I am missing here?

In my log4j.xml file, I declare the priority as following:

<category name=" myPackage.MyFOPRenderer ">
        <priority value="info"/>
</category>


And in myPackage.MyFOPRenderer.java, I set the FOP logger in two places as
following:

import org.apache.avalon.framework.logger.Log4JLogger;
import org.apache.fop.apps.Driver;
import org.apache.fop.messaging.MessageHandler;
import org.apache.log4j.Logger;

public static synchronized void initialize(...){
        ...
        Log4JLogger log4JLogger = new
Log4JLogger(Logger.getLogger(MyFOPRenderer.class));
        MessageHandler.setScreenLogger(log4JLogger);
	        ...    
}


public void render(...) {
                Driver driver = new Driver();
                Log4JLogger log4JLogger = new
Log4JLogger(Logger.getLogger(MyFOPRenderer.class));
                	driver.setLogger(log4JLogger);
                ...
    }


Why has the priority setting got lost in driver all of a sudden?

Thanks in advance.





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


Re: white-space-collapse not working in trunk?

Posted by Manuel Mall <ma...@apache.org>.
On Monday 13 February 2006 21:54, Sven wrote:
> Hi there,
>
> again a short question: The FAQ is telling that using
> white-space-collapse="false" in a <fo:block/> is all you need to
> output preformatted text. Well, not for me. Whitespaces will still
> collapse. I am using the latest trunk (revision 377250). Am I doing
> something worng or is this a bug?
>
It's a known bug. Especially leading white space, that is white space at 
the beginning of each line is incorrectly removed.

It is documented, but not very prominently, in the release notes where 
there is a line saying:

#  There are several small problems around white space handling. 

One could argue that this not a really a 'small' problem :-).

> Thank you guys for your pretty good work. I would have never imagined
> to use trunk code in such a prolific way (to write my diploma thesis
> especially =)
>
>
> Here is a brief example:
>
> <?xml version="1.0" encoding="utf-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>     <fo:layout-master-set>
>         <fo:simple-page-master margin="4.5cm" page-width="21cm"
>             page-height="29.7cm" master-name="titlepage">
>             <fo:region-body />
>         </fo:simple-page-master>
>         <fo:simple-page-master margin="2.5cm" page-width="21cm"
>             page-height="29.7cm" master-name="default">
>             <fo:region-body margin-bottom="1cm" margin-top="1cm" />
>             <fo:region-before extent="1cm" />
>             <fo:region-after extent="1cm" />
>         </fo:simple-page-master>
>     </fo:layout-master-set>
>
>     <fo:page-sequence language="de" master-reference="default">
>         <fo:static-content flow-name="xsl-region-before">
>             <fo:block page-break-after="avoid"
>                 border-bottom="solid 1px silver" text-align="end"
> font-size="10pt"
>                 font-family="Helvetica">
>                 Grundlagen
>             </fo:block>
>         </fo:static-content>
>         <fo:static-content flow-name="xsl-region-after">
>             <fo:block font-size="12pt" font-family="Helvetica">
>                 <fo:page-number />
>             </fo:block>
>         </fo:static-content>
>         <fo:static-content flow-name="xsl-footnote-separator">
>             <fo:block>
>                 <fo:leader leader-length="100px"
> leader-pattern="rule" /> </fo:block>
>         </fo:static-content>
>         <fo:flow flow-name="xsl-region-body">
>
>             <fo:block hyphenation-remain-character-count="4"
>                 hyphenate="false" space-after="0.5em"
> text-align="justify" font-size="12pt" font-family="Times">
>                 Die JADE Extension ist eine an der Universität
> Hamburg entwickelte BDI Reasoning-Engine, die in Java geschrieben
> wurde. Ursprünglich als Erweiterung des
>
>                 Java Agent Development Framework
>
>                 konzipiert, sollte Jadex die Defizite von JADE
>                 beseitigen. Da sich die Entwickler von JADE auf die
>                 Konformität mit den FIPA-Spezifikationen und die
>                 Entwicklung von Werkzeugen zum Testen der Agenten
>                 konzentriert haben, blieb die Umsetzung eines
> internen Agentenkonzeptes bewusst unberücksichtigt
>                 <fo:inline>
>                     <fo:basic-link
>                         internal-destination="reference-PBL03">
>                         [PBL03]
>                     </fo:basic-link>
>                 </fo:inline>
>                 . Jadex war die Lösung dieses Defizits, indem es auf
>                 Basis der relativ einfach gestrickten JADE-Agenten
> ein Framework aufsetzte, das die Entwicklung von BDI-Agenten
> ermöglichte.
>             </fo:block>
>             <fo:block page-break-inside="avoid" margin="1em"
> space-after="0.5em" font-size="10pt" font-family="Helvetica"
> id="code-adf_aufbau">
> <fo:block border-bottom="solid 1px gray" border-top="solid 1px gray"
> linefeed-treatment="preserve" white-space-collapse="false"
> font-size="10pt" font-family="Courier">
> &lt;agent xmlns="http://jadex.sourceforge.net/jadex"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://jadex.sourceforge.net/jadex
>                         http://jadex.sourceforge.net/jadex-0.94.xsd"
>     name="AgentTypeName"
>     package="your.package.here"&gt;
>
>     &lt;imports&gt;
>         &lt;!-- 1.) java imports --&gt;
>     &lt;/imports&gt;
>
>     &lt;capabilities&gt;
>         &lt;!-- 2.) by this agent used capabilties --&gt;
>     &lt;/capabilities&gt;
>
>     &lt;beliefs&gt;
>         &lt;!-- 3.)beliefs of this agent --&gt;
>     &lt;/beliefs&gt;
>
>     &lt;goals&gt;
>         &lt;!-- 4.) The goals the agent may have --&gt;
>     &lt;/goals&gt;
>
>     &lt;plans&gt;
>         &lt;!-- 5.) The plan library --&gt;
>     &lt;/plans&gt;
>
>     &lt;events&gt;
>         &lt;!-- 6.) All known events (messages, goals and internal
> events) --&gt;
>     &lt;/events&gt;
>
>     &lt;expressions&gt;
>         &lt;!-- 7.) used expressions and conditions --&gt;
>     &lt;/expressions&gt;
>
>     &lt;properties&gt;
>         &lt;!-- 8.) static values needed by this agent --&gt;
>     &lt;/properties&gt;
>
>     &lt;initialstates&gt;
>         &lt;!-- 9.) possibility to start agent with different initial
> states,
>                   like inital goals, plans or beliefs e.g. --&gt;
>     &lt;/initialstates&gt;
>
> &lt;/agent&gt;
>                     test XXX
>
>                 </fo:block>
> <fo:block>
>                             Code-Auszug 1:
>                         Aufbau des ADF von Jadex Agenten</fo:block>
> </fo:block>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
>

Manuel

>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org

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