XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Posttop
Giuseppe FratturaSubject: counting in query
Author: Giuseppe Frattura
Date: 15 Sep 2010 05:03 AM
Originally Posted: 15 Sep 2010 05:02 AM
hi everybody,
i've got another problem with my project.
i've got a Database on XML that contains data about museum ecc...
how can i count how many artwork did any artist do?

i've try to do like that:

(: $x is the root :)

for $c in $x//artwork
let $artist:= $c/Autor
let $count:=0
let $finalCount := for $k in $x//opera
let $count:= $count + (if ($k/Autor/text()=$artist/text())
then ($count+1)
else ($count))
return $count
return <a>{$finalCount}</a>

------------------------------------------------------------------------------------

the counter never increase over 1, where is the mistake?

Thank you

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.