<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>I know that your example is not correct because your are closing a before closing b.&nbsp; I am not new to XML syntax.&nbsp; The problem is that my XML structure is not static.&nbsp; I am using a loop to generate it.&nbsp; I did javascript before and it would be possible to open a tag and close it after 20 iterations of the loop and then reopen it and close it again until I am done.<br><br>Let me explain my problem a little more.&nbsp; I have two levels of bookmarks like this:<br>&lt;group1&gt;<br>&nbsp;&nbsp;&nbsp; &lt;item1 /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;item2 /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;item3 /&gt;<br>&nbsp;&nbsp;&nbsp; &lt; .... /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;item25 /&gt;<br>&lt;/group1&gt;<br>&lt;group2&gt;<br>&nbsp;&nbsp;&nbsp; &lt;item26 /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;item27 /&gt;<br>&lt;/group2&gt;<br><br>What I would like to do is to add a level of bookmark within group 1 and group 2 which would give me that:<br>&lt;group1&gt;<br>&nbsp;&nbsp;&nbsp; &lt;subgroup1.1&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &lt;item1 /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &lt; ... /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &lt;item20 /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/subgroup1.1&gt;<br>&nbsp;&nbsp;&nbsp; &lt;subgroup1.2&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &lt;item21 /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &lt;... /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &lt;item25&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/subgroup1.2&gt;<br>&lt;/group1&gt;<br>&lt;group2&gt;<br>&nbsp;&nbsp;&nbsp; &lt;subgroup2.1&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;item26 /&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;item27 /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/subgroup2.1&gt;<br>
&lt;/group2&gt;<br><br>If you look at my code, I am trying to open the "subgroup" bookmark tag before opening the bookmark tag for my "items".&nbsp; And I try to close the "subgroup" bookmark tag after I have processed 20 items.&nbsp; I understand that what I am trying to do is not possible because the XML is validated before the processing of the XSL.&nbsp; If only the result would be validated, everything would be fine.<br><br>I would like to know of an alternate way to get what I want.<br><br>Thanks for your help!<br>Sebastien Clermont<br><br><br><blockquote style="border-left: 2px solid rgb(0, 128, 128); padding-left: 5px; margin-left: 5px; margin-right: 0px;"><hr id="EC_stopSpelling">From: k.degrauw@axis.nl<br>To: xep-support@renderx.com<br>Subject: RE: [xep-support] Grouping bookmarks<br>Date: Mon, 10 Jul 2006 08:46:49 +0200<br><br>  <meta http-equiv="Content-Type" content="text/html; charset=unicode"> <meta name="Generator" content="Microsoft SafeHTML">    <style> .ExternalClass EC_P {padding-right:0px;padding-left:0px;padding-bottom:0px;padding-top:0px;} .ExternalClass {font-size:10pt;font-family:Tahoma;} </style>    <div><span class="EC_064114206-10072006"><font face="Arial">Sebastien,</font></span></div> <div><span class="EC_064114206-10072006"><font face="Arial"></font></span>&nbsp;</div> <div><span class="EC_064114206-10072006"><font face="Arial">It is quite obvious what is  wrong is that you cannot jump out of a &lt;xsl:if&gt; element.  </font></span></div> <div><span class="EC_064114206-10072006"><font face="Arial">That is basic&nbsp;XML  syntax.</font></span></div> <div><span class="EC_064114206-10072006"><font face="Arial">The following <span class="EC_064114206-10072006"><font face="Arial">is not correct  XML:</font></span></font></span></div> <div><span class="EC_064114206-10072006"><font face="Arial">&nbsp;  &lt;a&gt;</font></span></div> <div><span class="EC_064114206-10072006">&nbsp;&nbsp;&nbsp; &nbsp; <font face="Arial">&lt;b&gt;</font></span></div> <div><span class="EC_064114206-10072006"><font face="Arial">&nbsp;  &lt;/a&gt;</font></span></div> <div><span class="EC_064114206-10072006"><font face="Arial">&nbsp;  &lt;/b&gt;</font></span></div> <div><span class="EC_064114206-10072006"><font face="Arial"></font></span>&nbsp;</div> <div><span class="EC_064114206-10072006"><font face="Arial">Check the W3C xml pages for  information on wellformed-ness</font></span></div> <div><span class="EC_064114206-10072006"><font face="Arial"></font></span>&nbsp;</div> <div><span class="EC_064114206-10072006"><font face="Arial">Regards,  Kees</font></span></div> <blockquote>   <div class="EC_OutlookMessageHeader" dir="ltr" align="left"><font face="Tahoma">-----Original Message-----<br><b>From:</b>    owner-xep-support@renderx.com [mailto:owner-xep-support@renderx.com]<b>On    Behalf Of </b>Sébastien CLERMONT<br><b>Sent:</b> Friday, 07 July 2006 7:04    PM<br><b>To:</b> xep-support@renderx.com<br><b>Subject:</b> [xep-support]    Grouping bookmarks<br><br></font></div>I am trying to form groups of 20    bookmarks in my document.&nbsp; I have a document that can have from 1 to 1000    bookmarks and I want them to be grouped by 20.&nbsp; I tried the    "&lt;for-each-group&gt;" tag but xep tells me that I can't use that tag in    this part of the xsl.<br><br>My rx:outline works fine but when I am trying to    place &lt;xsl:if&gt; tags and put &lt;xsl:bookmark&gt; within those if tags, I    get an XML validation exception because the bookmark tags are not closed (they    are but in an other if).<br><br>If I replace "&lt;!-- open group of 20 --&gt;"    by "&lt;rx:bookmark ...&gt;" and "&lt;!-- close group of 20 --&gt;" by    "&lt;/rx:bookmark&gt;" in my code below, I get the validation errors.&nbsp;    What can I do?<br><br>&nbsp;----------- source code    -----------------------<br>&lt;rx:outline&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;xsl:for-each    select="//compte"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;xsl:variable    name="type"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;xsl:value-of select="ResourceBundle:getString($libelles,    concat('docimgchq.pdf.contenu.libelle.cpt',@serco))"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;xsl:if test="@serco =    '05'"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;xsl:value-of    select="@serno"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;/xsl:if&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;/xsl:variable&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;rx:bookmark    internal-destination="{$type}"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;rx:bookmark-label&gt;&lt;xsl:value-of    select="$type"/&gt;&lt;/rx:bookmark-label&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;xsl:for-each    select="cheque"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;xsl:variable name="cle" select="concat(@datecomptable,    @noref)"/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsl:if    test="(count(preceding::cheque)+1) mod 20 = 0"&gt;<br>&nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp; &lt;!-- open group of 20 --&gt;<br>&nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;    &lt;/xsl:if&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;rx:bookmark    internal-destination="{$cle}"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;rx:bookmark-label&gt;&lt;xsl:value-of    select="@nocheque"/&gt;&lt;/rx:bookmark-label&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;/rx:bookmark&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;    &nbsp;&nbsp; &nbsp;&nbsp; &lt;xsl:if test="count(preceding::cheque) mod 20 =    19 or last cheque"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- close    group of 20 --&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp;    &lt;/xsl:if&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;/xsl:for-each&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;/rx:bookmark&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;/xsl:for-each&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;/rx:outline&gt;<br>&nbsp;----------- source code -----------------------  </blockquote> </blockquote></body>
</html>