Re: [xsl] Displaying Icon in Page Margin

Subject: Re: [xsl] Displaying Icon in Page Margin
From: Brian Popp <bpopp@xxxxxxxxx>
Date: Thu, 15 Sep 2011 09:14:42 -0500
Thanks for the suggestions. I'm a little happy to hear that I didn't
waste a day on a trivial problem, but I'd gladly take a hit to my
pride in order to find a good solution. I actually started with the
negative margin technique, and it somewhat worked, but it was fragile.
For example, in order to get the icon to the left of the table, I had
to do something like:

<xsl:template
        match="entry[position()=1 and
(descendant-or-self::limit/@origin='fdx' or
following-sibling::entry/descendant-or-self::limit/@origin='fdx')]">

Basically, I'm putting a rule on the first cell of each row that looks
for the attribute being set in itself or any of its siblings and then
I push an icon out to the left of it. That works in almost every case.
The problem (aside from it being ugly) is that sometimes that first
cell spans multiple rows. If the third row within the span happens to
have the marker, the icon doesn't display next to the correct row and
instead draws next to the start of the span. D*mn creative writers and
their fancy straddles. :)


On Wed, Sep 14, 2011 at 8:15 PM, G. Ken Holman
<gkholman@xxxxxxxxxxxxxxxxxxxx> wrote:
> At 2011-09-14 17:07 -0500, Brian Popp wrote:
>>
>> I've been banging my head against a problem for most of the day
>
> You are touching on the need for synchronization and XSL-FO 1.x does not
> support synchronization between separate areas, such as between the body
> region and a perimeter region.  Actually, I lie, as the change bars are
> synchronized along the lines of what you need, but off the top of my head I
> cannot think of any other semantics.
>
>> The other method which seems more promising is to use floats like so:
>
> I would have looked at floats myself.
>
>> This seems to work as designed, but unfortunately it is drawing the
>> graphic inside the table cell (to the left of the marked entry) and
>> not in the margin. Any help or pointers is greatly appreciated.
>
> Two steps would be needed to accommodate this, both of:
>
> (1) - try negative margins to push the content outside of the float and
into
> the margin
>
> (2) - collect all of the row's cell's requirements when processing the
first
> cell (since it is adjacent to your margin), and then ignore the presence of
> the graphic when encountered in the actual cell (since it isn't adjacent to
> your margin) ... that way the negative margin trick (if it works) will
> always be putting the content into the margin.
>
> I hope these suggestions point you in an acceptable direction.  There is no
> "right" direction when there are no synchronization semantics available to
> you in the specification.
>
> . . . . . . . . . Ken
>
>
> --
> Contact us for world-wide XML consulting and instructor-led training
> Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
> G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
> Google+ profile: https://plus.google.com/116832879756988317389/about
> Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

Current Thread