Subject: Re: [xsl] Sorting unique and sub-total problem From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 02 Jun 2004 11:48:49 -0400 |
The <ITEM> nodes can be in any order. What I would like to get at the end is the following out put.
Card: 123456789 Total:350 Card: 987654321 Total: 30
At the moment I can't even sort unique! I have tried to sort the nodes and then compare the current node to the following sibling, using...
<xsl:for-each select=".//ITEM" > <xsl:sort select="CARD/@number" order="ascending" /> <xsl:if test="./CARD/@number[ not (.=following-sibling::ITEM/CARD/@number) ]"> ....print number etc. etc....
But what I have found is that the following sibling is as it would be if the nodes have not been ordered.
I fear that the only way to deal with this is to use XSLT to preorder the nodes and then use a 2nd script using the same approach as described.
Alternatively I could go right back to the process that originally created the XML file and order / sub total from there... something I really want to avoid if at all possible.
Is there another approach I can take ? Am I expecting too much from XSLT with all this... ?
Good luck, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Sorting unique and sub-total proble, roger . wyatt | Thread | Re: [xsl] Sorting unique and sub-to, roger . wyatt |
Re: [xsl] xsl:include not at top le, xptm | Date | RE: [xsl] xsl:include not at top le, Wendell Piez |
Month |