[xep-support] Getting a page number into a basic-link
Dave Thomas
dave at pragprog.com
Fri Jan 14 19:56:54 PST 2011
We have an errata reporting system that lets users click a link on a
page in a book to report a problem on that page. Our old system used
to embed the page's number into the hyperlink, so that the errata
system would prefill it. The link would look like
http://books.pragprog.com/titles/jvrails/errata/add?pdf_page=30
So, in the static-content for the page footer, I have
<fo:basic-link>
<xsl:attribute name="external-destination">
<xsl:text>url(http://pragprog.com/titles/</xsl:text>
<xsl:value-of select="$book-code"/>
<xsl:text>/errata/add?pdf_page=</xsl:text>
<fo:page-number/>
<xsl:text>)</xsl:text>
</xsl:attribute>
Report erratum on page <fo:page-number/>
</fo:basic-link>
That doesn't seem to work—I'm getting nothing for the page number
inside the link (but it is displaying correctly in the static text).
Now, I understand why I can't use <fo:page-number/> in a variable, but
I'm not sure I see why this particular use shouldn't work: isn't the
substitution into the link going to use the same mechanism as the
substitution into the text?
And, if not—is there any way to do what I'd like to do?
Thanks
Dave
!DSPAM:87,4d311b1d63731162810610!
More information about the Xep-support
mailing list