Subject:Returning Values Author:TL W Date:05 Apr 2006 10:14 AM
Hi,
Ok i have a .xq file that im using to return a list of photos in alphabetical order from my index.xml file, this is the code im using for the .xql file:
<html>
<body>
List abstract photos in order:
<br/>
<ul>
{
for $x in doc("index2.xml")/site/nav/thumbs/thumb/title
order by $x
return <li>{data($x)}</li>
}
</ul>
</body>
</html>
It does not output the thumbs nav title in alphabetical order as i expected it too, is there a reason why?
Subject:Returning Values Author:TL W Date:05 Apr 2006 12:37 PM
Sorry that was just a typo error. Ah well im glad it is working but it doesnt seem to work if i drag these files in eXist and view them.
Ok if I wanted to advance this further by having the XQL search through my other 3 xml docs would I do this to the code:
<html>
<body>
List photos in order:
<br/>
<ul>
{
for $x in doc("index2.xml")/site/nav/thumbs/thumb/title
for $x in doc("index3.xml")/site/nav/thumbs/thumb/title
for $x in doc("index4.xml")/site/nav/thumbs/thumb/title
for $x in doc("index5.xml")/site/nav/thumbs/thumb/title
order by $x
return <li>{data($x)}</li>
}
</ul>
</body>
</html>
What about if I wanted also display the thumbssrc too (so the image)?
Thanks for your time
Subject:Returning Values Author:Minollo I. Date:05 Apr 2006 12:44 PM
Once again, I suggest that you talk about issues specific to eXist through the proper support channel.
About your second question, we are not going to walk you step by step through the process of learning XQuery; I'll just say that the cascading for loops are probably not going to work the way you expect (each nested for is going to loop through all items for each item of the outer loop); about showing additional data, either loop on "thumb" rather than on title, and then display $x/title and $x/whateverelse, or do $x/../whateverelse.
Subject:Returning Values Author:Tony Lavinio Date:06 Apr 2006 09:37 AM
Why don't you download a copy of Stylus Studio and use our XQuery
debugger, instead of using a tool which provides little development-time
support, from a group that in your own words provides no product support?
It seems you are making it unnecessarily hard on yourself.
"If you don't buy the tools you need, you will eventually pay for it, but
not have your tool." --Henry Ford.