I want to use xquery to list the website path which have the word "conference" in the path and return only the distinct path if the same path have more than one file.
For example:
The above list have three path that contain the word "conference", but two of them have the same path
Subject:how to list distinct value? Author:Minollo I. Date:13 Mar 2009 04:51 PM
Something like this:
declare function local:get-path($url as xs:string) as xs:string {
let $urlComponents := tokenize($url, "/")
return string-join(subsequence($urlComponents, 1, count($urlComponents)-1), "/")
};
let $input :=
<urlset>
...
</urlset>
for $url in distinct-values($input//url/loc[contains(., "/conference/")]/local:get-path(.))
return $url