Re: [xsl] block length

Subject: Re: [xsl] block length
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 06 May 2009 10:39:58 -0400
At 2009-05-06 15:53 +0200, Konstanty Pilecki wrote:
I would be grateful for a suggestion. Here is my problem:

Let us have a piece of XSL-FO code like this:

<flow>
        ...
        <block id="b1"> ... </block>
        ...
        <block id="b2" margin-left="???"> ... </block>
        
</flow>

How can I force the "b2" block to have a left
margin equal to the length of the
"b1" block?

I think the answer depends on what is between the two blocks.


Certainly in XSL-FO there is no way to measure
the length of the "b1" block, and use that measurement.

It looks to me like you may be able to use tables
with auto layout (though this is uncertain
because each vendor can implement the auto layout
column width determination using their own
algorithms), or possibly better still would be
putting "b1" into a side float and "b2" into
regular flow.  Putting the text of "b1" into a
keep-together.within-line would mean the side
float would end up as wide as the text.

This is a technique I've used for things like definition lists.

But it may not work depending on what you want to flow between the two
blocks.

I hope this gives you some useful ideas.

. . . . . . . . . . Ken

--
XSLT/XSL-FO/XQuery hands-on training - Los Angeles, USA 2009-06-08
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread