|
next
|
 Subject: Index Formatting Question with XSLT and XSL-FO Author: Jerry Janofsky Date: 09 Oct 2006 09:20 AM
|
I am trying to format an index. Everything looks fine if the index entry fits on a single line, however, if the entry scrolls to another line I have trouble with the justification. I’ve tried various combinations of blocks and justifications, however, I can’t seem to get it right.
Here is an example of my rendered index. The view is the width of one colum on the index page. The first entry looks fine because it is both right and left justified and does not need to scroll. The second entry has a problem because text-align-last="justify" is forcing the page numbers to spread out. The third entry would be fine if the scrolled line would indent.
G
Gelman, Martin L., MD..............48, 129
Girolamo, Jr., Allessandro A., MD.....37,
1 1 8
Greenwald, Lawrence L., MD,
FACC...............................15, 96
Below is what I think would be acceptable. How do I do this?
G
Gelman, Martin L., MD..............48, 129
Girolamo, Jr., Allessandro A., MD.....37,
118
Greenwald, Lawrence L., MD,
FACC.............................15, 96
Another way to word what I am trying to do is that I just
want the first line of an entry to justify to the left and right and then have any scrolled lines to indent only. I suppose I would also accept the scrolled line to be right side justified such as this:
Girolamo, Jr., Allessandro A., MD.....37,
45,118
Below is the template that generates the first example. It uses XEP extensions, however, I don't think that is relevant to the problem.
<xsl:template match="dir:name">
<fo:block text-align-last="justify">
<xsl:value-of select="concat(dir:lastname, ', ', dir:firstname, ' ', dir:mi, ', ', dir:title)"/>
<fo:leader leader-pattern="dots"/>
<rx:page-index>
<rx:index-item link-back="true">
<xsl:attribute name="ref-key">
<xsl:value-of select="parent::dir:person/@id"/>
</xsl:attribute>
</rx:index-item>
</rx:page-index>
</fo:block>
</xsl:template>
Jerry J
|
|
|
|