Thank you: [xep-support] Grouping bookmarks

From: Sébastien CLERMONT <sclermont@hotmail.com>
Date: Mon Jul 10 2006 - 09:30:57 PDT

Thank you very much! You understood what I wanted. I just had to move 1 line down.--> the closing </rx:bookmark> just before <!-- close group of 20 --> because I really needed one more level of bookmark. I also had to repeat the first bookmark to have it as the fist element of the subgroup.All I need to do now is to give a better name to that new subgroup.Thank you very much!Sebastien ClermontDate: Mon, 10 Jul 2006 16:43:42 +0300From: Volodymyr.Mykhailyk@intelliarts.comTo: xep-support@renderx.comSubject: Re: FW: [xep-support] Grouping bookmarks Hi Sébastien, problem is, that tag in XSL should be opened and closed within same parent node. to fix this you can rewrite XSL in following order: <rx:outline> <xsl:for-each select="//compte"> <xsl:variable name="type"> <xsl:value-of select="ResourceBundle:getString($libelles, concat('docimgchq.pdf.contenu.libelle.cpt',@serco))"/> <xsl:if test="@serco = '05'"> <xsl:value-of select="@serno"/> </xsl:if> </xsl:variable> <rx:bookmark internal-destination="{$type}"> <rx:bookmark-label> <xsl:value-of select="$type"/> </rx:bookmark-label> <xsl:for-each select="cheque[(position() mod 20 = 0) or (position()=1)]"> <xsl:variable name="followingGroupId"> <xsl:if test="following-sibling::cheque[(count(preceding-sibling::cheque)+1) mod 20 = 0][1]"> <xsl:value-of select="generate-id(following-sibling::cheque[(count(preceding-sibling::cheque)+1) mod 20 = 0][1])"/> </xsl:if> </xsl:variable> <!-- open group of 20 --> <xsl:variable name="cle" select="concat(@datecomptable, @noref)"/> <rx:bookmark internal-destination="{$cle}"> <rx:bookmark-label> <xsl:value-of select="@nocheque"/> </rx:bookmark-label> </rx:bookmark> <xsl:for-each select="following-sibling::cheque[not((preceding-sibling::cheque | self::cheque)[generate-id() = $followingGroupId])]"> <xsl:variable name="cle1" select="concat(@datecomptable, @noref)"/> <rx:bookmark internal-destination="{$cle1}"> <rx:bookmark-label> <xsl:value-of select="@nocheque"/> </rx:bookmark-label> </rx:bookmark> </xsl:for-each> <!-- close group of 20 --> </xsl:for-each> </rx:bookmark> </xsl:for-each> </rx:outline> BTW, this source will be more readeble when you rewrite it in apply-templates/mode style. --BS Sébastien CLERMONT wrote: 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. Let me explain my problem a little more. I have two levels of bookmarks like this: <group1> <item1 /> <item2 /> <item3 /> < .... /> <item25 /> </group1> <group2> <item26 /> <item27 /> </group2> What I would like to do is to add a level of bookmark within group 1 and group 2 which would give me that: <group1> <subgroup1.1> <item1 /> < ... /> <item20 /> </subgroup1.1> <subgroup1.2> <item21 /> <... /> <item25> </subgroup1.2> </group1> <group2> <subgroup2.1> <item26 /> <item27 /> </subgroup2.1> </group2> 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. I would like to know of an alternate way to get what I want. Thanks for your help! Sebastien Clermont
-------------------
(*) 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
Received on Mon Jul 10 10:05:28 2006

This archive was generated by hypermail 2.1.8 : Mon Jul 10 2006 - 10:05:29 PDT