[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Internal Linking


Subject: [xsl] Internal Linking
From: Horace Burke <xmlmarkup@xxxxxxxxx>
Date: Mon, 23 Apr 2007 15:35:46 -0700 (PDT)

Hi All,

I am doing something that I would consider fairly simple. However, it is
not working for me. I am trying to link from a cover page to chapters
inside of some PDF documents; this is using XSL-FO. The problem that I am
having is that links on the cover page are not jumping to their
destinations. Can anyone see what I am doing wrong? I have included
snippets below.

Thanks in advance for your help!

Regards,
Horace Burke

===XML SNIPPET===

<Global  langID="EN">
   ...
   <CvrSheet>
   ...
     <description>
       <title>Description</title>
       <descpara xref="prod001">Chapter 1 Solution</descpara>
       <descpara xref="prod002">Chapter 2 Solution</descpara>
       <descpara xref="prod003">Chapter 3 Solution</descpara>
     </description>

     ...
   <CvrSheet>

   <chapter langID="EN">
      <CoProdId>
         <title>Section 1 Company and Product Identification</title>
         <ProdName id="prod001">
            <title change="yes">Product Name</title>
            <para>Chapter 1 Solution</para>
         </ProdName>
         ....
      </CoProdId>
      ....
   </chapter>
   ....
</Global>

===XSL-FO SNIPPET===
<xsl:template match="CoProdId">
  <fo:table-and-caption>
    <fo:table border="1pt solid black">
      <fo:table-header>
        ...
      </fo:table-header>
      <fo:table-body>
        <fo:table-row>
          ...
          <fo:table-cell border-width="1pt" border-left="none"
border-right="none" padding-top="2mm"
          text-align="left" number-columns-spanned="2">
             <fo:block border-style="solid" border-bottom="1pt" 
border-top="none"  border-left="none" padding-top="2mm" 
             padding-bottom="1.5mm" border-right="none"
id="{generate-id(.)}">
                <fo:inline font-weight="bold">
	           <xsl:apply-templates select="ProdName/para"/>
                </fo:inline>  
            </fo:block><!--Product Name-->
            ....
        </fo:table-row>
        ...
    </fo:table>
  </fo:table-and-caption>
</xsl:template>
 
 
<xsl:template match="descpara">
   <fo:block color="#8A2BE2" font-size="11pt">
      <xsl:variable name="xref" select="@xref"/>
      <xsl:for-each select="//CoProdId/ProdName">
         <xsl:if test="@id = $xref">
	    <fo:basic-link internal-destination="{generate-id(.)}">
	        <xsl:apply-templates select="para"/>
	    </fo:basic-link>
	 </xsl:if>
      </xsl:for-each>    
   </fo:block>
</xsl:template>
 
 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Current Thread