FOP 0.20.5 Preserve Whitespace

View: New views
6 Messages — Rating Filter:   Alert me  

FOP 0.20.5 Preserve Whitespace

by bonekrusher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am using FOP 0.20.5 - I am trying to preserve whitespace but it's not working. I tried both examples below with no luck.

<fo:block xsl:use-attribute-sets="text-10" linefeed-treatment="preserve" white-space-collapse="false" wrap-option="wrap" white-space="pre">
        <xsl:apply-templates/>
</fo:block>

<fo:block xsl:use-attribute-sets="text-10" linefeed-treatment="preserve" white-space-collapse="false" wrap-option="wrap" white-space-treatment="preserve">
        <xsl:apply-templates/>
</fo:block>

Thanks

Re: FOP 0.20.5 Preserve Whitespace

by Andreas Delmelle-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 23, 2008, at 19:43, bonekrusher wrote:

> I am using FOP 0.20.5 - I am trying to preserve whitespace but it's  
> not
> working. I tried both examples below with no luck.

Ouch! Is there a chance of upgrading to 0.95? 0.95 is much more  
compliant when it comes to those particular properties...

> <fo:block xsl:use-attribute-sets="text-10" linefeed-
> treatment="preserve"
> white-space-collapse="false" wrap-option="wrap" white-space="pre">
> <xsl:apply-templates/>
> </fo:block>

Note: 'white-space' is a shorthand property retained in XSL-FO for  
compatibility reasons with CSS.
As such, white-space="pre" means the exact same thing as the other  
three specified property-values /plus/ white-space-treatment="preserve".

see: http://www.w3.org/TR/xsl/#white-space

As a matter of best practice, either use the shorthand or use the  
native properties, but specifying both is a (tiny bit) wasteful.

I'm not sure if there's a workaround for you if you're stuck with  
0.20.5... :/


Cheers

Andreas

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


Re: FOP 0.20.5 Preserve Whitespace

by bonekrusher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Andreas,

As always, thank you for your help. I am stuck with 0.20.5 due to the fact that 0.94 or 0.95 do not support either fo:table-continued or fox extension "Continued-label".  

Bones

Andreas Delmelle-2 wrote:
On Jun 23, 2008, at 19:43, bonekrusher wrote:

> I am using FOP 0.20.5 - I am trying to preserve whitespace but it's  
> not
> working. I tried both examples below with no luck.

Ouch! Is there a chance of upgrading to 0.95? 0.95 is much more  
compliant when it comes to those particular properties...

> <fo:block xsl:use-attribute-sets="text-10" linefeed-
> treatment="preserve"
> white-space-collapse="false" wrap-option="wrap" white-space="pre">
> <xsl:apply-templates/>
> </fo:block>

Note: 'white-space' is a shorthand property retained in XSL-FO for  
compatibility reasons with CSS.
As such, white-space="pre" means the exact same thing as the other  
three specified property-values /plus/ white-space-treatment="preserve".

see: http://www.w3.org/TR/xsl/#white-space

As a matter of best practice, either use the shorthand or use the  
native properties, but specifying both is a (tiny bit) wasteful.

I'm not sure if there's a workaround for you if you're stuck with  
0.20.5... :/


Cheers

Andreas

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

Re: FOP 0.20.5 Preserve Whitespace

by Andreas Delmelle-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 23, 2008, at 20:04, bonekrusher wrote:

> As always, thank you for your help. I am stuck with 0.20.5 due to  
> the fact
> that 0.94 or 0.95 do not support either fo:table-continued or fox  
> extension
> "Continued-label".

Right! Sorry, stupid question. :-/
Now I remember... You were thinking about having a crack at  
implementing fo:table-retrieve-marker, no?

As far as I remember, 0.20.5's behavior is non-compliant to such an  
extent that to preserve linefeeds, white-space-collapse should be set  
to false, and white-space-treatment has no effect... Bad news if you  
need white-space preservation around linefeeds, IIRC. :(


Andreas


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


Re: FOP 0.20.5 Preserve Whitespace

by bonekrusher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andreas,

Having a "crack" at it is a good way of saying it. Its still on the the "to do" list. As for my white space... I will keep working on it. :)

Regards,

Andreas Delmelle-2 wrote:
On Jun 23, 2008, at 20:04, bonekrusher wrote:

> As always, thank you for your help. I am stuck with 0.20.5 due to  
> the fact
> that 0.94 or 0.95 do not support either fo:table-continued or fox  
> extension
> "Continued-label".

Right! Sorry, stupid question. :-/
Now I remember... You were thinking about having a crack at  
implementing fo:table-retrieve-marker, no?

As far as I remember, 0.20.5's behavior is non-compliant to such an  
extent that to preserve linefeeds, white-space-collapse should be set  
to false, and white-space-treatment has no effect... Bad news if you  
need white-space preservation around linefeeds, IIRC. :(


Andreas


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

Re: FOP 0.20.5 Preserve Whitespace

by bonekrusher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andreas,

I got it working.

<xsl:when test="@space = 'preserve'">
                <fo:block xsl:use-attribute-sets="text-10" white-space-collapse="false" wrap-option="wrap" white-space-treatment="preserve">
                                        <xsl:value-of select="."/>
                </fo:block>
</xsl:when>

Thanks,

Andreas Delmelle-2 wrote:
On Jun 23, 2008, at 19:43, bonekrusher wrote:

> I am using FOP 0.20.5 - I am trying to preserve whitespace but it's  
> not
> working. I tried both examples below with no luck.

Ouch! Is there a chance of upgrading to 0.95? 0.95 is much more  
compliant when it comes to those particular properties...

> <fo:block xsl:use-attribute-sets="text-10" linefeed-
> treatment="preserve"
> white-space-collapse="false" wrap-option="wrap" white-space="pre">
> <xsl:apply-templates/>
> </fo:block>

Note: 'white-space' is a shorthand property retained in XSL-FO for  
compatibility reasons with CSS.
As such, white-space="pre" means the exact same thing as the other  
three specified property-values /plus/ white-space-treatment="preserve".

see: http://www.w3.org/TR/xsl/#white-space

As a matter of best practice, either use the shorthand or use the  
native properties, but specifying both is a (tiny bit) wasteful.

I'm not sure if there's a workaround for you if you're stuck with  
0.20.5... :/


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
LightInTheBox - Buy quality products at wholesale price