<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Sébastien,<br>
problem is, that tag in XSL should be opened and closed within same
parent node.<br>
to fix this you can rewrite XSL in following order:<br>
<rx:outline><br>
<xsl:for-each select="//compte"><br>
<xsl:variable name="type"><br>
<xsl:value-of<br>
select="ResourceBundle:getString($libelles,
concat('docimgchq.pdf.contenu.libelle.cpt',@serco))"/><br>
<xsl:if test="@serco = '05'"><br>
<xsl:value-of select="@serno"/><br>
</xsl:if><br>
</xsl:variable><br>
<rx:bookmark internal-destination="{$type}"><br>
<rx:bookmark-label><br>
<xsl:value-of select="$type"/><br>
</rx:bookmark-label><br>
<xsl:for-each select="cheque[(position() mod 20
= 0) or (position()=1)]"><br>
<xsl:variable name="followingGroupId"><br>
<xsl:if
test="following-sibling::cheque[(count(preceding-sibling::cheque)+1)
mod 20 = 0][1]"><br>
<xsl:value-of<br>
select="generate-id(following-sibling::cheque[(count(preceding-sibling::cheque)+1)
mod 20 = 0][1])"/><br>
</xsl:if><br>
</xsl:variable><br>
<font color="#3333ff"><!-- open group of 20
--></font><br>
<xsl:variable name="cle"
select="concat(@datecomptable, @noref)"/><br>
<rx:bookmark
internal-destination="{$cle}"><br>
<rx:bookmark-label><br>
<xsl:value-of select="@nocheque"/><br>
</rx:bookmark-label><br>
</rx:bookmark><br>
<xsl:for-each
select="following-sibling::cheque[not((preceding-sibling::cheque |
self::cheque)[generate-id() = $followingGroupId])]"><br>
<xsl:variable name="cle1"
select="concat(@datecomptable, @noref)"/><br>
<rx:bookmark
internal-destination="{$cle1}"><br>
<rx:bookmark-label><br>
<xsl:value-of
select="@nocheque"/><br>
</rx:bookmark-label><br>
</rx:bookmark><br>
</xsl:for-each><br>
<font color="#3333ff"><!-- close group of
20 --></font><br>
</xsl:for-each><br>
</rx:bookmark><br>
</xsl:for-each><br>
</rx:outline><br>
<br>
BTW, this source will be more readeble when you rewrite it in
apply-templates/mode style.<br>
--BS<br>
Sébastien CLERMONT wrote:
<blockquote cite="midBAY107-W8500E69340A02613CEC66BC6B0@phx.gbl"
type="cite">
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>I know that your example is not correct because your are
closing a before closing b. I am not new to XML syntax. The problem
is that my XML structure is not static. I am using a loop to generate
it. 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. I have two levels of
bookmarks like this:<br>
<group1><br>
<item1 /><br>
<item2 /><br>
<item3 /><br>
< .... /><br>
<item25 /><br>
</group1><br>
<group2><br>
<item26 /><br>
<item27 /><br>
</group2><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>
<group1><br>
<subgroup1.1><br>
<item1 /><br>
< ... /><br>
<item20 /><br>
</subgroup1.1><br>
<subgroup1.2><br>
<item21 /><br>
<... /><br>
<item25><br>
</subgroup1.2><br>
</group1><br>
<group2><br>
<subgroup2.1><br>
<item26 /><br>
<item27 /><br>
</subgroup2.1><br>
</group2><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". And I try to close the
"subgroup" bookmark tag after I have processed 20 items. I understand
that what I am trying to do is not possible because the XML is
validated before the processing of the XSL. 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: <a class="moz-txt-link-abbreviated" href="mailto:k.degrauw@axis.nl">k.degrauw@axis.nl</a><br>
To: <a class="moz-txt-link-abbreviated" href="mailto:xep-support@renderx.com">xep-support@renderx.com</a><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; ">
<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"></span> </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
<xsl:if> element. </font></span></div>
<div><span class="EC_064114206-10072006"><font face="Arial">That is
basic 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">
<a></font></span></div>
<div><span class="EC_064114206-10072006"> <font face="Arial"><b></font></span></div>
<div><span class="EC_064114206-10072006"><font face="Arial">
</a></font></span></div>
<div><span class="EC_064114206-10072006"><font face="Arial">
</b></font></span></div>
<div><span class="EC_064114206-10072006"></span> </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"></span> </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> <a class="moz-txt-link-abbreviated" href="mailto:owner-xep-support@renderx.com">owner-xep-support@renderx.com</a>
[<a class="moz-txt-link-freetext" href="mailto:owner-xep-support@renderx.com">mailto:owner-xep-support@renderx.com</a>]<b>On Behalf Of </b>Sébastien
CLERMONT<br>
<b>Sent:</b> Friday, 07 July 2006 7:04 PM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:xep-support@renderx.com">xep-support@renderx.com</a><br>
<b>Subject:</b> [xep-support] Grouping bookmarks<br>
<br>
</font></div>
I am trying to form groups of 20 bookmarks in my document. I have a
document that can have from 1 to 1000 bookmarks and I want them to be
grouped by 20. I tried the "<for-each-group>" 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 <xsl:if>
tags and put <xsl:bookmark> 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 "<!-- open group of 20 -->" by "<rx:bookmark
...>" and "<!-- close group of 20 -->" by
"</rx:bookmark>" in my code below, I get the validation errors.
What can I do?<br>
<br>
----------- source code -----------------------<br>
<rx:outline><br>
<xsl:for-each select="//compte"><br>
<xsl:variable name="type"><br>
<xsl:value-of
select="ResourceBundle:getString($libelles,
concat('docimgchq.pdf.contenu.libelle.cpt',@serco))"/><br>
<xsl:if test="@serco = '05'"><br>
<xsl:value-of select="@serno"/><br>
</xsl:if><br>
</xsl:variable><br>
<rx:bookmark internal-destination="{$type}"><br>
<rx:bookmark-label><xsl:value-of
select="$type"/></rx:bookmark-label><br>
<xsl:for-each select="cheque"><br>
<xsl:variable name="cle"
select="concat(@datecomptable, @noref)"/><br>
<xsl:if test="(count(preceding::cheque)+1) mod
20 = 0"><br>
<!-- open group of 20 --><br>
</xsl:if><br>
<rx:bookmark internal-destination="{$cle}"><br>
<rx:bookmark-label><xsl:value-of
select="@nocheque"/></rx:bookmark-label><br>
</rx:bookmark><br>
<xsl:if test="count(preceding::cheque) mod 20 = 19
or last cheque"><br>
<!-- close group of 20 --><br>
</xsl:if><br>
</xsl:for-each><br>
</rx:bookmark><br>
</xsl:for-each><br>
</rx:outline><br>
----------- source code ----------------------- </blockquote>
</blockquote>
</blockquote>
<br>
</body>
</html>
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html