Re: [xsl] Even/Odd + Reference orientation

Subject: Re: [xsl] Even/Odd + Reference orientation
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Oct 2006 08:27:15 -0400
At 2006-10-16 00:48 -0400, Sakib R Saikia wrote:
I am quite new to XSL and FO, and am presently
designing a stylesheet to transform and render
certain publications in XML format to PDF. I
have run into a few problems, and was hoping you could help me out.

1. We are using different formats for even and
odd pages. Although I can set the margins etc.
in appropriately for odd and even pages in the
<simple-page-master>, I need some means to check
for odd/even pages during the flow of the document,

One cannot "check" the parity of the page number on the fly during the flow. There is no feedback loop to the transformation from the formatting process.

so that I can stylize the header and footer
differently for odd and even pages. Can this be done?

If your changes result in the same presentation for all even pages and the same presentation for all odd pages within a given page sequence (say a chapter of a book), this is accommodated by defining different static content for use in the odd page simple page master from that used in the even page simple page master. This is accomplished using different region names for the two page masters.

Some presentation changes can be made "on the fly" through the use of
markers.

What do you mean by "stylize the header and footer differently"?

2. Secondly, I am trying to display text
oriented at 90 degrees next to an image (for the
credits). For this i was putting the text inside
a <block> which i put inside a <block-container>
oriented at 90 deg, and after that was the block
containing the image. But this causes the image
to display below the text rather than alongside it.

The following works for me, flowing the credit up the left size of a picture, tested with Antenna House, RenderX and Ibex:

<flow flow-name="frame-body" xmlns="http://www.w3.org/1999/XSL/Format";>

  <block>Here is a photograph I took in Kowloon:</block>
  <block-container reference-orientation="90" width="2.5in">
    <block font-size="8pt">Photo credit by G. Ken Holman</block>
    <block-container reference-orientation="270">
      <block><external-graphic src="url('harbour.jpg')"/></block>
    </block-container>
  </block-container>

<block>end of test</block>

</flow>

I guess there is an implicit 'newline' semantics associated with <block>.

There is, but only in the block progression direction, which in real terms has changed due to the change in reference orientation. That is why in my example the picture is abutted against the credit, because of the size of the line with the credit.

But your wording implies you are not seeing the credit adjacent to the image.

Is there any way i can suppress this, or am i
taking a wrong approach altogether. What would be the best way to achieve
this?

What XSL-FO are you using?  Perhaps your problem
is not with your XSL-FO but with your XSL-FO
processor (you don't say which one you are using).

I hope this helps.

. . . . . . . . . . . . . . Ken

--
UBL/XSLT/XSL-FO training: Allerxd/Verx Denmark 2006-11-13,17,20/24
UBL International 2006  2006-11-13/17 http://www.ublconference.com
World-wide corporate, govt. & user group UBL, XSL, & XML training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread