Re: [xep-support] keep-with-next for fo:wrapper?

From: G. Ken Holman (
Date: Fri Jul 25 2003 - 14:32:25 PDT

  • Next message: Ronald Hayden: "Re: [xep-support] keep-with-next for fo:wrapper?"

    At 2003-07-25 13:30 -0700, Ronald Hayden wrote:
    >For reasons too arcane to get into, in our system for purposes of linking
    >we tend to have to put the id for an element in a fo:wrapper that precedes
    >the element, like so:
    ><fo:wrapper id="my_element_id"/>

    My understanding of XSL-FO is that the above is ineffectual ... I
    understand the wrapper does not generate any areas and is merely an
    artifact for use in the formatting object tree. It's only responsibility
    is to be a repository of inheritable properties and while id= is allowed to
    be specified only because id= can be specified on every object, that is not
    inherited and has no effect in the area tree.

    Therefore, an empty <wrapper> element is, I believe (and teach my
    students), a no-operation.

    In its place given your example, I would use an empty <fo:block
    id="my_element_id"/> for correctness, as this adds an area of no dimension
    to the area tree and gives that area the identifier value. Now something
    has actually been placed in the area tree.

    ><fo:block>The actual element.</fo:block>
    >This approach solves many problems for us...

    Really? That surprises me, but I'll accept your analysis.

    >but it presents a new problem: If the text being rendered in the fo:block
    >in this case causes a page break to occur, the block gets separated from
    >the associated wrapper, which causes links to jump people to the "wrong"
    >page, and for page numbers in cross-references to be off-by-one. This
    >occurs more often than you might think.
    >I'd like to ensure that the wrapper stays with the block...I tried:
    ><fo:wrapper id="my_element_id" keep-with-next.within-page="always" />
    >But it doesn't appear to work.

    Perhaps because there is no area in the area tree created by the empty
    wrapper, but then I don't understand why the id would work for you as you

    >Any suggestions for how I can keep these two elements together?

    Perhaps try using a <block> instead of a <wrapper>.

    I hope this helps.

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

    Upcoming hands-on courses: in-house corporate training available;
    North America public:  XSL-FO Aug 4,2003; XSLT/XPath Aug 12, 2003
    G. Ken Holman      
    Crane Softwrights Ltd.
    Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999 (F:-0995)
    ISBN 0-13-065196-6                      Definitive XSLT and XPath
    ISBN 0-13-140374-5                              Definitive XSL-FO
    ISBN 1-894049-08-X  Practical Transformation Using XSLT and XPath
    ISBN 1-894049-11-X              Practical Formatting Using XSL-FO
    Member of the XML Guild of Practitioners:
    Male Breast Cancer Awareness
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service

    This archive was generated by hypermail 2.1.5 : Fri Jul 25 2003 - 14:33:25 PDT