Help with XSL/XSL:FO for producing revision indicator bar in document.

  • Thread starter =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
  • Start date
?

=?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

Hello,

I'm having trouble figuring something out. I have to reproduce a PDF
output and in the original document, "revision indicators" are used to
show which parts of the document have changed since last version.

This revision indicator simply looks like a border to the left of the
page, but is always located at the same distance from the edge of the
page. Ouputing a border on the containing block doesn't work because
the blocks are indented within sections (everything in FO is
represented as lists within lists to facilitate indentation of sections
and subsections). Does anyone have an idea how I can accomplish this?

Any help would be greatly appreciated.

Regards
Jeff
 
J

Joseph Kesselman

Websearch suggests that some folks (eg "Antenna House") have been
extending xsl:fo to deal with revision bars. XSL 1.1 proposed adding
something more officially; I'm not sure offhand whether that's been
incorporated into the 2.0 draft or not.
 
?

=?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

Joseph said:
Websearch suggests that some folks (eg "Antenna House") have been
extending xsl:fo to deal with revision bars. XSL 1.1 proposed adding
something more officially; I'm not sure offhand whether that's been
incorporated into the 2.0 draft or not.

Thank you much for your answer.

Do you know if something similar has has been implemented in FOP
0.20.5?

Regards
Jeff
 
J

John R. Software

Jean-François Michaud said:
This revision indicator simply looks like a border to the left of the
page, but is always located at the same distance from the edge of the
page. Ouputing a border on the containing block doesn't work because
the blocks are indented within sections (everything in FO is
represented as lists within lists to facilitate indentation of sections
and subsections). Does anyone have an idea how I can accomplish this?

They seem to imply in the FOP FAQ that there is no problem using
fo:border to do sidebars.

http://xmlgraphics.apache.org/fop/fo.html#fo-lines

But.... they do not give an example of that actually being done.

It has been a couple of years since I was really into FOP and XSL-FO.
So I might have it wrong - but that seems doable.
 
?

=?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

John said:
They seem to imply in the FOP FAQ that there is no problem using
fo:border to do sidebars.

I'm sorry, I should have been clearer when I meant it doesn't work.
Creating a left border to indicate a revision change works but what I
meant is that its not an option in the context of using
"fo:list-block"s to indent all my content because the requirement is
that the revision indicator should always be located at the same
distance from the left edge of the page independently from the current
hanging list item indent. I use fo:list-block everywhere.

I could forget about using fo:list-block altogether to generate the
required sections/subsections/subsubsections indent and potentially
wrap everything that can be revised with an fo:block in which case all
those fo:block wrappers would all be aligned to the left of the page
body. The real fun starts thought when you think about trying to align
the content of those blocks in corelation with the content of other
such "fo:block wrapper" blocks so that the indents of the underlying
entities remains coherent. For example, when say trying to reproduce
list indent behavior across the content of many of those revision
fo:block wrappers. It seems somewhat clumsy to me. Thats the only
potential solution I've seen so far. In the current context this
solution implies recoding most of the stylesheet.
 
J

Joe Kesselman

Hmmm. Conceptually, what you need to do is reserve an additional thin
column, adjacent to (or contained within?) the margin, where the
revision bar would appear.

I haven't done anywhere near enough XSL:FO hacking to know how
unreasonable it would be to try to implement that way. I agree that it's
the sort of thing which I'd prefer to have the page layout language
assist me with.

There's always the solution of using a stylesheet to render into some
other page markup language, such as LaTeX, which has better support for
this particular function... but personally I'd rather see a solution
that doesn't require leaving the XML world.
 
?

=?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

Joe said:
Hmmm. Conceptually, what you need to do is reserve an additional thin
column, adjacent to (or contained within?) the margin, where the
revision bar would appear.

Basically yes. If I could potentially create such a construct per page
say within a table. two columns; one for the actual margin and a thin
slice of the of the margin for the revision bar. This approach seems to
naturally offer proper alignment of the revision bar. The potential
problem is trying to somehow make the structure of the document match
the structure of what is contained within the column in question so
that my revision indicators can be aligned with the correct parts of
the document by "following" the content. To a certain extent, it seems
like it would be just about as much work as the other solution but down
a different path.
I haven't done anywhere near enough XSL:FO hacking to know how
unreasonable it would be to try to implement that way. I agree that it's
the sort of thing which I'd prefer to have the page layout language
assist me with.

I'm relatively new to XSL:FO also. I'd also prefer to see this
happening at the language level. The roads to solving the problem seem
a bit rocky :).
There's always the solution of using a stylesheet to render into some
other page markup language, such as LaTeX, which has better support for
this particular function... but personally I'd rather see a solution
that doesn't require leaving the XML world.

Thats unfortunately not an option for me either. I have to stay in the
XML world.

Regards
Jean-Francois Michaud
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,853
Latest member
GeorgiaSta

Latest Threads

Top