xquery version "3.0"; declare variable $exist:path external; declare variable $exist:resource external; declare variable $exist:controller external; declare variable $exist:prefix external; declare variable $exist:root external; if ($exist:path eq '') then else if ($exist:path eq "/") then (: forward root path to index.xql :) else if (ends-with($exist:resource, ".html")) then (: the html page is run through view.xql to expand templates :) (: Resource paths starting with $shared are loaded from the shared-resources app :) else if (contains($exist:path, "/$shared/")) then else (: everything else is passed through :)