Re: [xsl] XSL-FO alignment

Subject: Re: [xsl] XSL-FO alignment
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 04 May 2006 07:56:01 -0400
At 2006-05-04 12:31 +1000, Kamal Bhatt wrote:
G. Ken Holman wrote:
At 2006-05-04 00:09 +1000, Kamal Bhatt wrote:
      <fo:block font-family="Courier" font-size="10pt" space-before="6pt"
space-after="6pt" text-align="left"
                border-style="solid" border-width="0.25pt"
                padding-left="4pt" padding-right="4pt" padding-top="6pt"
padding-bottom="6pt" line-height="15pt">

According to XSL-FO 1.0 Section 5.3.2, your specification above will draw the border *outside* of the parent boundary limits ... unlike CSS. This guarantees that the text of the border block lines up with the text of an adjacent unbordered block. If you wanted the border to line up with the text, use margin-left="0pt" in addition to your other properties.
No, I want it outside of the text. I am basing this fo on a windows doc and that is what we do.

Then what you have should work. Because you do not have margin="0pt" the formatter is supposed to keep the text in alignment with adjacent unbordered text and draw the border outside the parent area limits.

On a related note, (and maybe someone here doesn't know this) am I correct in saying that the way word defines points, and even cm different to FO and everyone else?

No comment ... I do not know the answer.

Firstly, I would am still confused about the difference between
space-before and padding-before and padding-top. If someone could explain
that to me, that would be great.

The space-before= property defines the space between the adjacent block area and the area's border rectangle (which is the outside edge of the border).

The padding-before= and padding-top= both specify the distance between the area's padding rectangle (which is the inside edge of the border) and the area's content rectangle. The only difference between padding-before= and padding-top= is that the use of writing-direction-dependent values of before/after/start/end are portable across different languages while the CSS heritage top/bottom/left/right are biased to left-to-right/top-down writing directions.

So for english it does n't matter what I use, but I should probably use before/after/start/end?

Correct ... but I counsel my students to use before/after/start/end to be portable.

What about space-* vs padding-*?

I'm not sure what is confusing about my answer above: they are different concepts. There are different rectangles in play in XSL-FO and I told you above that space-* is outside of the outside edge of the border and padding-* is inside the inside edge of the border.

I don't know how else to describe it to you.

Then add margin-left="0pt" to ensure that the border does not "push out" such that its context text aligns with the text of neighbouring blocks.
That sounds like what I want to do.

Then don't use margin-left="0pt" and a conforming XSL-FO engine will push the border out leaving the text in alignment with adjacent unbordered blocks.

I hope this helps.

. . . . . . . . . Ken

Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
Also for XSLT/XSL-FO training:    Minneapolis, MN 2006-07-31/08-04
Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25
Also for XSLT/XSL-FO training:    Copenhagen,Denmark 2006-05-08/11
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05
Legal business disclaimers:

Current Thread