|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: sorted table elements
Hello Saverio,
you are on the right way, but it's a dead-end street ;-) The problem: While you sort the elements and bring them into a new order, following-sibling still uses document order, not the order after the sorting. You must store the sorting in a variable: <xsl:variable name="sortedElements">
<xsl:for-each select="*">
<xsl:sort data-type="text" select="name()"/>
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:variable>But now you have a Result Tree Fragment (RTF) in your variable, no longer a node set, on which you can operate. You have to use an extension function zo convert it back to a node set. For this you can use EXSLT or vendor specific extension functions: http://www.exslt.org/exsl/functions/node-set/index.html. <xsl:variable name="sortedElementsNodeSet" select="exslt:node-set($sortedElements)/*"/> Now preceding-sibling or following-sibling works correctly: <xsl:for-each select="$sortedElementsNodeSet[position() mod 4 = 1">
<tr>
<xsl:for-each select=".|following-sibling::node()[position() < 4]">
<td>...</td>
</xsl:for-each>
</tr>
</xsl:for-each>Hope this works, it's untested ;-) Regards, Joerg Saverio Perugini wrote: Hello, -- System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 joerg.heinicke@xxxxxxxxx www.virbus.de VIRBUS hat jetzt als erster deutscher Softwarehersteller die Zertifizierung für den 3D Secure-Authentifizierungsstandard "Verified by Visa" erhalten. Details unter http://www.virbus.de/de/press/pressemitteilung/20020828_verified_by_VISA. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








