<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Sebastien,<br>
it is better to use "generate-id()" function in XSLT and process
document twice. This function will generate uniq id for all elements
end they will be dynamic. We always using this function for such and
other purposes. Try to change your XSL with example below.<br>
<pre wrap="">- - - - - - - - - -
      &lt;rx:outline&gt;
         &lt;xsl:for-each select="//type_compte"&gt;
            &lt;rx:bookmark internal-destination="<font color="#ff0000">{generate-id()}</font>"&gt;
            &lt;rx:bookmark-label&gt;&lt;xsl:value-of select="@type"/&gt;&lt;/rx:bookmark-label&gt;
            &lt;xsl:for-each select="cheque"&gt;
               &lt;rx:bookmark internal-destination="<font
 color="#ff0000">{generate-id()}</font>"&gt;
               &lt;rx:bookmark-label&gt;&lt;xsl:value-of select="@cle"/&gt;&lt;/rx:bookmark-label&gt;
               &lt;/rx:bookmark&gt;
            &lt;/xsl:for-each&gt;
            &lt;/rx:bookmark&gt;
         &lt;/xsl:for-each&gt;
      &lt;/rx:outline&gt;
- - - - - - - - - -

Here are the &lt;fo:block&gt; parts of the XSL:
- - - - - - - - - -
&lt;xsl:template match="type_compte"&gt;
   &lt;fo:block id="<font color="#ff0000">{generate-id()}</font>" text-align="left" font-weight="bold" font-size="11pt" space-before.minimum="12pt"&gt;
      &lt;xsl:value-of select="@type"/&gt;
   &lt;/fo:block&gt;
   &lt;fo:block&gt;
      &lt;xsl:apply-templates /&gt;
   &lt;/fo:block&gt;
&lt;/xsl:template&gt;
- - - - - - - - - -
&lt;xsl:template match="cheque"&gt;
   &lt;!-- Images recto et verso --&gt;
   &lt;fo:block id="<font color="#ff0000">{generate-id()}</font>" text-align="left" space-after.minimum="3pt"&gt;
      &lt;xsl:choose&gt;
         &lt;xsl:when test="@type = 'dcn'"&gt;
...
&lt;/xsl:template&gt;
- - - - - - - - - -</pre>
BTW. Question to RenderX support team. Can I answer to question from
other users. Or it is better not to do this?<br>
--<br>
Volodymyr.Mykhailyk<br>
IntelliArts<br>
S&eacute;bastien CLERMONT wrote:
<blockquote cite="midBAY107-W7A84E766F32010C3AE04FBCB50@phx.gbl"
 type="cite">
  <pre wrap="">Hi everyone.  My XSL file is almost done.  All that remain is bookmarks.  I have an XML file and need to produce a PDF with Images and bookmarks to these images.  The problem is that the content of the XML file is dynamic.  It can containt a reference from 1 to a 1000 images.  So I can't have &lt;fo:block&gt; with static ids and use these ids as internal-destination.

In my XSL file, I have my rx:outline section in which I loop.  The bookmarks appear in the PDF file but they all point to the same destination which is the last destination I defined for each level of bookmark.

Here is a part of the XML data:
- - - - - - - - - -
   &lt;type_compte type="EOP"&gt;

      &lt;cheque type="dcn" recto="Images/recto1.jpg" cle="a"
              verso="Images/verso1.jpg"
              date="12 MAI 2005"
              nocheque="122"
              montant="1500.00"
              noref="12345678910" /&gt;

      &lt;cheque type="rto" date="15 MAI 2005" cle="b"
...
   &lt;/type_compte&gt;
- - - - - - - - - -

Here is the &lt;rx:outline&gt; part of the XSL:
- - - - - - - - - -
      &lt;rx:outline&gt;
         &lt;xsl:for-each select="//type_compte"&gt;
            &lt;rx:bookmark internal-destination="@type"&gt;
            &lt;rx:bookmark-label&gt;&lt;xsl:value-of select="@type"/&gt;&lt;/rx:bookmark-label&gt;
            &lt;xsl:for-each select="cheque"&gt;
               &lt;rx:bookmark internal-destination="@cle"&gt;
               &lt;rx:bookmark-label&gt;&lt;xsl:value-of select="@cle"/&gt;&lt;/rx:bookmark-label&gt;
               &lt;/rx:bookmark&gt;
            &lt;/xsl:for-each&gt;
            &lt;/rx:bookmark&gt;
         &lt;/xsl:for-each&gt;
      &lt;/rx:outline&gt;
- - - - - - - - - -

Here are the &lt;fo:block&gt; parts of the XSL:
- - - - - - - - - -
&lt;xsl:template match="type_compte"&gt;
   &lt;fo:block id="@type" text-align="left" font-weight="bold" font-size="11pt" space-before.minimum="12pt"&gt;
      &lt;xsl:value-of select="@type"/&gt;
   &lt;/fo:block&gt;
   &lt;fo:block&gt;
      &lt;xsl:apply-templates /&gt;
   &lt;/fo:block&gt;
&lt;/xsl:template&gt;
- - - - - - - - - -
&lt;xsl:template match="cheque"&gt;
   &lt;!-- Images recto et verso --&gt;
   &lt;fo:block id="@cle" text-align="left" space-after.minimum="3pt"&gt;
      &lt;xsl:choose&gt;
         &lt;xsl:when test="@type = 'dcn'"&gt;
...
&lt;/xsl:template&gt;
- - - - - - - - - -

In attachment, you can see a screenshot of the result.  If I click on "EOP" or "MC1", it brings me to "MC1".  If I click on [a, b, c, d, e, f, g, h, i], it brings me to i.

What do I do wrong?  Is that possible to have dynamic ids in fo:blocks and use them in the rx:bookmark tag?

Your help would really be appreciated.  Thank you.</pre>
  <br>
  <hr size="4" width="90%"><br>
  <center><img src="cid:part1.09000901.04060405@intelliarts.com"></center>
</blockquote>
<br>
</body>
</html>