check position of 'generate-id()'s

Here should go questions about transforming XML with XSLT and FOP.
xacobea
Posts: 5

check position of 'generate-id()'s

Wed Jan 05, 2005 1:17 pm

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: 2100

Thu Jan 06, 2005 5:31 pm

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

Fri Jan 07, 2005 11:02 am

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: 4144

Mon Jan 10, 2005 6:49 pm

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

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest