W3C home > Mailing lists > Public > www-ql@w3.org > July to September 2004

Re: Generating RDF-style URIs from a namespace

From: Per Bothner <per@bothner.com>
Date: Tue, 07 Sep 2004 18:03:11 -0700
Message-ID: <413E5A4F.2080801@bothner.com>
To: Howard Katz <howardk@fatdog.com>
CC: www-ql@w3.org

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:16 UTC