Re: Generating RDF-style URIs from a namespace

Paul Cotton wrote:

> This means that the NamespaceDecl cannot contain function calls or
> string concatentation.

But the question wasn't generating namespaces, but generating URIs.

It seems to me you should be able to use a cast to a QName:

declare namespace foo="http://foo/";
for $name in ("bar", "baz")
let $qname := QName(concat("foo:",$name) return
xs:anyURI( concat(namespace-uri-from-QName($name),
                   local-name-from-QName($name)))

or

declare namespace foo="http://foo/";
let $foo := namespace-uri-from-QName(QName("foo:unused"))
for $name in ("bar", "baz")
xs:anyURI( concat($foo, $name))
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

Received on Wednesday, 8 September 2004 01:03:18 UTC