Created
May 26, 2015 14:57
-
-
Save baskaufs/045687fa9c14df8d33b9 to your computer and use it in GitHub Desktop.
query with problematic default namespace declaration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
declare namespace sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"; | |
(: | |
*********** Get data from GitHub ********* | |
:) | |
let $textOrganisms := http:send-request(<http:request method='get' href='https://raw.githubusercontent.com/baskaufs/Bioimages/master/organisms.csv'/>)[2] | |
let $xmlOrganisms := csv:parse($textOrganisms, map { 'header' : true(),'separator' : "|" }) | |
(: | |
*********** Main query ********* | |
:) | |
return ( | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">{ | |
for $org in $xmlOrganisms//record | |
order by $org/dcterms_modified descending | |
return ( | |
<url> | |
<loc>{$org/dcterms_identifier/text()}</loc> | |
<lastmod>{$org/dcterms_modified/text()}</lastmod> | |
</url> | |
) | |
}</urlset> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try this