RE: RE: [xsl] How to implement an array

Subject: RE: RE: [xsl] How to implement an array
From: Imrran Wahid <devguy2003@xxxxxxxxx>
Date: Wed, 12 Feb 2003 07:52:51 -0800 (PST)
Mike,

Thanks for your solution. Unfortunately I cannot
implement it because I need to output the elements in
the table in a particular order (not sorted as in your
solution). So that makes it a bit trickier. I think I
may have to settle for a lookup table. But I am not
familiar with using lookup tables...so I gotta go
learn or ask for help again here.

You used the following in your solution:

>       <xsl:for-each
> select="table/col[count(.|key('union', @month)[1]) =
> 1]">

Can you elaborate on how this works. I gather it
selects a unique occurence of the month attribute from
all the elements. How do you do this if month was
element instead of attribute? Just by omitting the
'@'?

Also, how does 'generate-id' work? Is it a built-in
xsl function?

I know these may be trivial questions but I am still
on the learning curve with respect to xsl.

Imrran


--- Michael Semcheski <mhs-list@xxxxxxxxx> wrote:
> Alright, I think this could be better if I made
> better use of the key (but
> I've never really used keys).
> 
> There are some conditions that are unhandled, such
> as when a month has more
> than one entry for that table.
> 
> But, I think this accomplishes the stated goal of
> the original post.
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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


Current Thread