List Info

Thread: FO processors and box stacking (Z-axis layering)




FO processors and box stacking (Z-axis layering)
user name
2007-07-27 12:10:28
Hi,

I have noticed that different processors treat box stacking (the layering of objects along the "Z-axis") differently when using positioned blocks.

FOP does not accept the z-index property, which means that you must be careful how you place your blocks, as the order in which you write them will determine how they stack.  For example:

<fo:block-container absolute-position=&quot;fixed&quot;>
&nbsp; <fo:block>UNDER</fo:block>
</fo:block-container>;
<fo:block color=&quot;red">OVER<;/fo:block&gt;

When processed with FOP, the text "UNDER" appears underneath the text "OVER".&nbsp; However, when processed with XEP, the text "OVER" appears underneath the text "UNDER".&nbsp; With XEP, you must use the z-index property to produce the desired output:

<fo:block-container absolute-position=&quot;fixed&quot; z-index=&quot;-1";>
 ; <fo:block>UNDER</fo:block>
</fo:block-container>;
<fo:block color=&quot;red">OVER<;/fo:block&gt;

You can see some more complex examples here: http://www.ecrion.com/Support/Resources/XSL-FOTutorial/AbsolutePositioning.xml.html .  If you were to process the examples there with XEP, you would not get the same output that is pictured unless you added z-index properties.

I am wondering why XEP does not layer boxes based on the order in which they are written, as FOP does (and presumably XF as well, given the examples posted on Ecrion';s site).&nbsp; Of course, with XEP, you can use z-index to fix this, but sometimes that is not ideal as you will then break FOP compatibility.

I guess this isn't so much a question as it is an observation.  But perhaps someone can give some insight, as I would like to write documents that are compatible with more than one FO processor.

Colin
Re: FO processors and box stacking (Z-axis layering)
user name
2007-07-28 15:21:25
Colin Shapiro wrote:

> I am wondering why XEP does not layer boxes based on
the order in which they
> are written, as FOP does (and presumably XF as well,
given the examples
> posted on Ecrion's site).  Of course, with XEP, you can
use z-index to fix
> this, but sometimes that is not ideal as you will then
break FOP
> compatibility.

If you look at the definition of z-index property
(http://www.w3.org/T
R/xsl/#z-index) you will see that specification
doesn't define how to stack objects that have the same stack
level. So
it is application dependent and if you want to control it
you have to
use z-index.

-- 
------------------------------------------------------------
------
  Jirka Kosek      e-mail: jirkakosek.cz      http://xmlguru.cz
------------------------------------------------------------
------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document
processing
------------------------------------------------------------
------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34
member
------------------------------------------------------------
------

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )