FOPRunXSLTExt - Example 3 - Rotate wide block

See
http://www.w3.org/community/ppl/wiki/FOPRunXSLTExt#Example_3_-_Rotate_wide_block

------------------------------------------

Rotates a fixed-size box if it is too wide for the page.

The <box> element in 'example3.xml' specifies its formatted height and width:

  <box id="box001" width="8in" height="5in">

With those dimensions, if you transform 'example3.xml' with
'formatting.xsl' and format the result, the box is wider than the width of
the page and some of the text is lost.

If you transform 'example3.xml' with 'example3_saxon9_fop10.xsl', which
uses the extension function to make an area tree during the transform and
makes decisions based on formatted areas, the box is rotated when it is
too wide for the page.

Run the example using one of the command lines then then run an XSL
formatter on 'out/example3_saxon9_fop10.fo' to see the result.

You can change the box/@width value in 'example3.xml' and run it again to
see whether or not the box is rotated.

--------------------------------------------------------

Finally, an example that changes the output based on the area tree that
was generated mid-transform.  Having got this far, I'm afraid my reactions
are (a) it shouldn't be this hard, and (b) we should have had this sort of
facility years ago (and (c) we really should use more convenient names for
files in the examples).

The example itself is highly contrived, since the lengths that are found
in the area tree are already hard-coded in the source XML, but it does
demonstrate decision making based on an area tree.

I guess the next one to try would be Betty's #9, list item label sizing,
requirement.  Despite what I said above, doing more should get easier as
we develop patterns of how to get info from the area tree and act on it.

Discovered along the way that although FOP does put IDs in the area tree,
it doesn't output 'role' property values to the area tree.

Regards,


Tony.

Received on Saturday, 27 April 2013 22:34:06 UTC