[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL-FO: page-breaking with all block-containers ha
At 2004-02-25 16:47 -0500, Kyle Partridge wrote:
(The main portion of) the xml document is laid out like the below segment. Note that each attribute on the region elements represents a numerical measurement in pts that is supposed to represent the fixed, absolute-positioning of the region. Have you tried empty blocks with a break: <block break-before="page"/> I don't like the idea of having to draw each page separately, using always another fo:page-sequence and fo:flow...it would be great if the regions could just cascade from one page to the next, behaving as-if they were all on one continual page (except in the case of a hard page break) because the region-coordinates in the xml (you may have noted!) simply continue to grow and grow, regardless of the document's stated page-size! But choosing "fixed" is basing your locations on the containing area. Have you considered in your XSLT doing the arithmetic of positioning and determining where a page break belongs? That would give you the option of zeroing out your running top indicator at the last specified value for top and reducing the subsequent values by that last specified value until you run out of page size again. Let's say the page size (conveyed in the xml document) is height = 792pts and width=612pts (an 8.5 x 11 page) - so I'm setting this page size on the fo:simple-page-master, like so: Then arithmetic should tell you were to place a hard break and the block at the top of a break becomes the "deduction" for the regions on that page. So in the case of a hard page break, regions prior to the break would have positioning coordinates equal to the existing position coordinates on the region element, but regions AFTER the break would have top and bottom positioning coordinates equal to the page-height minus the top and bottom coordinate??? Yuck. Why "yuck"? Either you let XSL-FO do the yucky pagination or you do the yucky pagination. Have you considered just using blocks and using a space-before= of the difference between blocks? Using start-indent= and end-indent= will handle your sides. I hope this is making some sense, and that someone can give me some advice on a *better way* to do this! I still don't understand why you are mapping an absolutely positioned set of regions to a paginated medium ... I suspect you can get close to what you want by just using blocks and letting the processor do the pagination. Remember to use keep-together.within-column="1" to keep your regions together on a single page (unless you don't mind the hard breaks in the middle of a region). The rendered results are so far excellent, but the coding methods seem to me to leave a lot to be desired! There are alternatives to your use of XSLT as I've noted below. <xsl:template match="ws:region"> <xsl:variable name="top_add" select="//ws:pageModel//ws:margins/@top"/> <xsl:variable name="left_add" select="//ws:pageModel//ws:margins/@left"/> <xsl:element name="fo:block-container"> <!-- *** absolute-position *** --> <xsl:attribute name="absolute-position"> <xsl:text>fixed</xsl:text> </xsl:attribute> <!-- *** top *** --> <xsl:attribute name="top"> <xsl:value-of select="number(@top)+$top_add"/> <xsl:value-of select="$units"/> </xsl:attribute> <!-- *** left *** --> <xsl:attribute name="left"> <xsl:value-of select="number(@left)+$left_add"/> <xsl:value-of select="$units"/> </xsl:attribute> Instead of the above, why not just use literal result elements and attribute value templates: <fo:block-container absolute-position="fixed" top="{number(@top)+$top_add}{$units}" left="{number(@left)+$left_add}{$units}" ... and so on ...> None of the elaborate calculations you've given in your example need to be done in <xsl:attribute> instructions. <!-- *** inner block *** --> <xsl:element name="fo:block"> <xsl:apply-templates/> </xsl:element> Why not: <fo:block><xsl:apply-templates/></fo:block> I hope this helps. ........................ Ken -- US XSL training: Washington,DC March 15; San Francisco,CA March 22 World-wide on-site corporate, government & user group 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 Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|