Page 1 of 1

check position of 'generate-id()'s

Posted: Wed Jan 05, 2005 1:17 pm
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?

Posted: Thu Jan 06, 2005 5:31 pm
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

Posted: Fri Jan 07, 2005 11:02 am
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>

Posted: Mon Jan 10, 2005 6:49 pm
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