RE: [xsl] RE: Using a reference in a sort

Subject: RE: [xsl] RE: Using a reference in a sort
From: Américo Albuquerque <melinor@xxxxxxx>
Date: Wed, 30 Jul 2003 14:19:23 +0100
Hi


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Jesse M. Heines
> Sent: Wednesday, July 30, 2003 12:38 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] RE: Using a reference in a sort
> 
> 
> > Try <xsl:sort
> >
> select="document($filePeople)/people/person[@id=current()/pers
> on/@id]/@l
> ast"
> >   order="descending"/> instead
> 
> Thanks for your reply, but I'm sorry to report that that
> doesn't work either.  The context of current() is still the 

It should. I've tried on this input:
<tasks>
  <task>
    <person id="p001">1 ... </person>
  </task>
  <task>
    <person id="p002">2 ... </person>
  </task>
  <task>
    <person id="p003">3 ... </person>
  </task>
</tasks>

With this 'people.xml':
<people>
  <person first="Jesse" id="p001" last="Heines"> ... </person>
  <person first="Americo" id="p002" last="Albuquerque"> ... </person>
  <person first="Me" id="p003" last="Myself"> ... </person>
</people>

And got this result:

  Myself, Me: 3 ... 
    
  Heines, Jesse: 1 ... 
    
  Albuquerque, Americo: 2 ... 

> node in the other XML file.  The documentation I have says 
> that current() is the same as ".", which I tried and does not 
> help, either.

No, the current() is the same as "." outside of the select, in this case
will be the same used in the <xsl:apply-templates> So current() will be the
"task" node

Show us the template where you call this

Regards,
Américo Albuquerque



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


Current Thread