xsl-list
[Top] [All Lists]

Re: [xsl] xtvd grouping problem (I think)

2006-09-09 11:46:09
That's cool. Thanks for trying, and have a fine weekend. I'm looking
at for-each-group and I might be ... on the road to somewhere...

Bob

On 9/8/06, Steve <subsume(_at_)gmail(_dot_)com> wrote:
Hah. Wouldn't it be easy if we could just push things into keepers
lists? Unfortunately, not in XSL since variables created in a loop
can't exist outside of that loop.

This was a barrier for me. But then I learned about the key() function.

Unfortunately, I'm not the best person on the list to teach such a
thing. I tried to put together something but there are better docs
online.

-S


On 9/8/06, Bob Portnell <simply(_dot_)bobp(_at_)gmail(_dot_)com> wrote:
> Let me clarify a little. I already have my set of programs in a
> variable... call it $hitSet. So that's cool. And the bit from the sort
> on down I'd already worked out. Good and good.
>
> I need to get away from any looping based on program IDs. That's my
> problem: program IDs are more fine-grained than my search item terms.
> So I need to expand up, collecting up all the <schedule>s which have
> the program IDs from $hitSet (and so representing each search item
> discovery individually)
>
> In pseudocode, my vision is something like
> for each member of schedule ( a long list)
>     if this member's @program is found among the @ids in (hitSet list)
>         push (this member into Keepers list)
>
> But I have no idea if that's possible in XSLT. I have a hunch it is,
> and I'm just overlooking a very simple XPath function for the
> assignment...
>
> Bob P
> simply(_dot_)bobp(_at_)gmail(_dot_)com
>
>
>
> On 9/8/06, Steve <subsume(_at_)gmail(_dot_)com> wrote:
> > On 9/8/06, Bob Portnell <simply(_dot_)bobp(_at_)gmail(_dot_)com> wrote:
> > >     for each search item
> > >         find the set of programs which have that item
> > >         convert this to the set of schedule items which have those 
programs
> > >         for each in the schedule set
> > >             sort by time
> > >             report the show information.
> >
> > <xsl:for-each $progSet/items[(_at_)item=@search]/@prog>
> >      <xsl:variable name="prog" select="@prog" />
> >       <xsl:for-each $scheduleSet[(_at_)prog = $prog]/@prog>
> >         <xsl:sort select="@time" />
> >         <xsl:value-of select="@showInfo"
> >       </xsl:for-each>
> >    </xsl:for-each>
> >
> >
> > > Given a variable $progSet which has a bunch of <programs> in it, how
> > > do I define a $schedSet which has only <schedule> items containing
> > > @program ids from $progSet?
> > >
> > > I've gotten as far as
> > > <xsl:variable name="schedSet" select="//schedule[(_at_)program . . {sound
> > > of screeching brakes}? />
> >
> > Pretty sure I touched on this above. Let me know.
> >
> > > Please excuse where I've strayed from proper XSLT vocabulary; I hope
> > > my intent is clear enough despite such lapses of inexperience.
> >
> > No problemo. Was very well conveyed. =).
> >
> > -S
> >
> > --~------------------------------------------------------------------
> > XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> > or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
> > --~--
> >
> >
>
> --~------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
> --~--
>
>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--