RE: [bdbxml] order by date

"Howard Katz" <[email protected]> Thu, 11 Aug 2005 10:52:31 -0700
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
Charris,
 
I believe if you change this:

declare function local:lalas( $x as element()* ) as element()*
{ 
 for $y in $x 
 order by $y/date ascending 
 return 

 <assessments>{$y}</assessments> 
};

to this:

declare function local:lalas( $x as element()* ) as element()*
{ 
 <assessments>
 {
  for $y in $x 
  order by $y/date ascending 
  return 

  $y
 }
 </assessments> 
};

it'll work.

Howard


  _____  

From: sarigiannis xaralampos [mailto:hsarigiannis-taE2apzES20Cep0kKqy/[email protected]] 
Sent: Tuesday, August 09, 2005 8:39 AM
To: [email protected]
Subject: [bdbxml] order by date



Hi,

 

 

declare function local:lalas($x as element()*) as element()*{ for $y  in  $x
order by $y/date   ascending return 

<assessments>{$y}</assessments> };

 

<blockquote>{ let $i :=local:lalas(//assessment)/assessment

   for $l in (2 to 5 ) return  <p><a
href='LdRendering.jsp?assessment={data($i[$l ]/id)}'> {data($i[$l  ]/title)}
</a><br>author:  {data($i[$l ]/author)}</br><br>date: { data($i[$l ]/date)
}</br></p>}</blockquote>    

 

 

I have this code in order first to order my assessments in asceding mode
related to date and after via the loop to have  requested transformations

The strange is that the ordering is not made correctly .I tried the same
syntax to XmlSpy and it worked correctly . 

 I attach the file over which the query is executed . Any suggestions about
what to change or what I do wrong ????

 

Thanks 

charris