check position of 'generate-id()'s

Here should go questions about transforming XML with XSLT and FOP.
xacobea
Posts: 5
Joined: Wed Jan 05, 2005 1:07 pm

check position of 'generate-id()'s

Post by xacobea »

hello,
how can i check if two 'generate-id()''s are on the same page? every item of my table of contents has two different pagenumbers (from page - to page), if both are the same only one should be printed.

<xsl:variable name="pagenumber">
<fo:page-number-citation ref-id="{generate-id(notes/note)}" />
</xsl:param>

doesn't work.
any ideas?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Sorry, but I do not understand your problem. Maybe if you describe it in more details and include also a sample we may help.

Best Regards,
George
xacobea
Posts: 5
Joined: Wed Jan 05, 2005 1:07 pm

Post by xacobea »

sorry about my english.

i don't want my pdf look like this:
first recipe .......2-5
second recipe ..6 -6

but:
first recipe .......2-5
second recipe ..6

my .xml:

<recipes>
<menu>
<head />
<recipe>
<notes>
<note />
</notes
</recipe>
</menu
</recipes>

.. and my .xsl:

<xsl:template match="menu">
<fo:block space-after="2cm" font-weight="bold">
<xsl:value-of select="head/title" />
</fo:block>
<fo:block>
<xsl:for-each select="recipe">
<fo:block text-align-last="justify">
<fo:table>
<fo:table-column column-width="350pt" />
<fo:table-column column-width="12pt" />
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spaned="2">
<fo:block text-align-last="justify">
<xsl:value-of select="head/title" />
<fo:leader leader-pattern="dots" keep-with-next.within-line="always" />
<fo:page-number-citation ref-id="{generate-id(notes)}" /> -
<fo:page-number-citation ref-id="{generate-id(notes/note)}" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:for-each>
</fo:block>
<xsl:apply-templates select="recipe" />
</xsl:template>
<xsl:template match="recipe">
<fo:block font-weight="bold" break-before="page">
<xsl:value-of select="head/title" />
</fo:block>
<fo:block id="{generate-id(notes)}" />
<xsl:value-of select="notes/note" />
<fo:block id="{generate-id(notes/note)}" />
</xsl:template>
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

Generally it is difficult to calculate exactly on what page starts and ends an item from table of contents because that depends on the output page size, font used, FO processor. Maybe you can ask about this on specialized mailing lists like http://groups.yahoo.com/group/xsl-fo/ and http://xml.apache.org/mail.html#fop-user.

Best regards,
Sorin
Post Reply