[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: looping problem, <xsl: for-each>??

Subject: Re: looping problem, <xsl: for-each>??
From: Mukul Gandhi <mukulgw3@xxxxxxxxx>
Date: Wed, 8 Oct 2003 17:54:54 -0700 (PDT)
not preceding sibling
Hi Wendell,
  I used
count(preceding::item[category=current()/category])+1
as you wrote (not preceding-sibling). But it was
generating 1,2,1,2 ..

  I would try the _2 pass solution_ and _node-set
based solution_ as you have explained. 

Regards,
Mukul

--- Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote:
> At 09:12 PM 10/7/2003, you wrote:
> >Hi Wendell,
> >  The syntax <xsl:value-of
>
>select="count(preceding::item[category=current()/category])+1"/>
> >when placed at <!-- ?? --> in my XSL, produces
> >numbering 1,2,1,2 and not 1,2,3,4 !
> 
> Are you sure you're using the preceding:: axis, not
> preceding-sibling?
> 
> >I am also interested to know how the numbering
> >(1,2,3,4 ..) can be produced using
> >- a 2 pass solution
> >- using node-set extension
> 
> The two-pass solution would simply be:
> 
> pass 1: sort and create output
> pass 2: number
> 
> The node-set-extension-based solution would be the
> same, except that pass 1 
> would be bound to a variable, then that variable's
> value (a 
> result-tree-fragment) changed to a node-set (in a
> second variable 
> declaration); then you'd apply templates to that
> node set to get the numbering.
> 
> I'd go into more detail but I'm kinda swamped at the
> moment.... :->
> 
> Cheers,
> 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
>
======================================================================
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.