Re: [xsl] background in block container

Subject: Re: [xsl] background in block container
From: Eliot Kimber <ekimber@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Feb 2004 13:33:54 -0600
Mark Williams wrote:
Hi Andreas,

Thanks for the response.

I've tried (I think) what you suggested, that is to control the border an
background colour from the page's region-body.

I've tried the following:

<fo:region-body margin-top="2.53968253968254cm"
margin-left="2.87393298059965cm" margin-right="3.02393298059965cm"
margin-bottom="2.53968253968254cm" background-color="rgb(226, 226, 226)"
border-color="rgb(0, 0, 0)" border-style="solid" border-width="1pt" />

This gives me a nice grey background, but it doesn't enclose it in a border.
Have you any idea why?

The XSL spec is very clear that the page regions always have an effective border width of zero. Note that both XEP and XSL Formatter 2.x (and probably 3.x, I haven't tested it) ignore this rule and will put borders on page regions. Don't know about FOP.

Also, I would like to be able to control where the borders start (ie not
merely around the margins of the page) eg if the left margin is 3cms from
the left edge of the page, I might want the border and background to start
1cm from the left edge of the page.  I tried adding some padding, but it
seemed to make no difference.

In general I find it easiest to not use page margins at all. It's important to remember that the page margins cannot have any marks--that is, they essentially define an unprintable area within the physical page.

It's generally easier to do everything with the page regions. For example, to generate registration marks around a 6x9-type page, I define the physical page as 8.5x11 (or A4 or whatever) and then use margins on the page regions to create an effect 6x9 printed page. I can then use one or more of the edge regions to hold the registration marks (which can be created using external graphics or inline SVG or EPS [XSL Formatter supports inline EPS graphics].

The only legal way to get a border on a page region is to use a block or block container. Using a block-container within static should work, but there may be some issues with z-index depending on how the FO implementation stacks things, but generally I would expect the static content to be rendered under the flowed content (but I don't know that this expectation is supported by or required by the FO spec).


W. Eliot Kimber
Professional Services
Innodata Isogen
9030 Research Blvd, #410
Austin, TX 78758
(512) 372-8122


XSL-List info and archive:

Current Thread