Hi Everyone I have to questions: 1) Is it possible to return sth formatted string like this: return <Document>{$Document/HasDomain/@id /data()+"%%"+$Document/Time/text()}</Document> So far it shows errors.....I dont know if there are alternatives. 2) I have data like this <Documents> <Document id="doc1"> <Date>yyyy-mm-dd</Date> <HasIP ip="ip1"> <HasDomain domain="domain1"> <HasDomain domain="domain2"> </Document> <Document id="doc1"> <Date>yyyy-mm-dd</Date> <HasIP ip="ip2"> <HasDomain domain="domain1"> <HasDomain domain="domain3"> </Document> </Documents> <IPs> <IP id="ip1"> <data>111.111.111.111</data> </IP> <IP id="ip2"> <data>111.111.111.112</data> </IP> </IPs> <Domains> <Domain id="domain1"> <data>abc.com</data> </Domain> <Domain id="domain2"> <data>edf.com</data> </Domain> <Domain id="domain3"> <data>abc.com</data> </Domain> <Domains> I m trying to get all domains from documents that are within the following time period. for $Document in doc('test')//Document let $datestr := $Document/Date/text() let $date := xs:date($datestr) where $date<=xs:date("2010-05-02") and $date>xs:date("2010-05-01") and $Document/HasDomain return <Document>{$Document/HasDomain, $Document/Time/text()}</Document>
However, only the domain ids are returned, I cant make the database return domain data rather than id. Can anyone offer me some suggestions? Thanks a lot.
Sincerely Lusha