[xep-support] Re: Getting a page number into a basic-link

Kevin Brown kevin at renderx.com
Sat Jan 15 10:16:43 PST 2011


Dave:

It's a hard one to understand but Michael Sulyaev stated it correctly. An
<fo:page-number/> can only be used as a replaceable item in textual content.
In your situation, you are appending it to an attribute
(external-destination) during the XSL stage. Thus, there is no
<fo:page-number/> at this time and of course you cannot add an element as a
child of an attribute. 

Michael's example is good, you could also write a very simple
identity-translate XSL that accomplishes this.

1) As an alternate recommendation, if your documentation is well structured
meaning it has sections/subsections ... why not provide a link at the
subsection level (or any level you choose) instead of the page level. This
you could accomplish. Use something like:

         <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_subsection=</xsl:text>
             <xsl:value-of select="generate-id()"/>
             <xsl:text>)</xsl:text>
           </xsl:attribute>
           Report erratum on section
         </fo:basic-link

You could even drop these into marginalia, which would allow users to
reports issues by some known level in your document.

2) As another alternate recommendation (although you may not want embedded
Javascript in your docs), you could easily do this with Javascript as XEP
supports embedding Javascript into the documents. 

Kevin Brown
RenderX

-----Original Message-----
From: xep-support-bounces at renderx.com
[mailto:xep-support-bounces at renderx.com] On Behalf Of Dave Thomas
Sent: Saturday, January 15, 2011 6:58 AM
To: RenderX Community Support List
Subject: [xep-support] Re: Getting a page number into a basic-link

> Overall, it's a two stage process:
> 1. Transformation: XML + XSL = XSLFO
> 2. Rendering: XSLFO --> PDF
>
> During transformation there is no information about page numbers, because
> page numbers is one of the results of rendering.


I understand this, and I thank you for the XSL solution. I was just
hoping that static-content was treated differently (it seems like it
could be).


Dave

!DSPAM:87,4d31b60263731707231453!


_______________________________________________
(*) To unsubscribe, please visit
http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service
http://w
ww.renderx.com/terms-of-service.html



More information about the Xep-support mailing list