Compare string to node path?

Hi everyone

I'm currently working on a master thesis which evolves around using XQuery  
as a multidatabase/multisource language. In this context I’m try solve the  
use of synonym element/attribute names in different documents. This is  
thought done by storing the paths to the synonymous elements/attributes in  
a xml-documents ("MDBDeclaration.xml"), and accessing these by a function  
(ub:mdb).There a two other xml documents that contains the data I’m  
actually trying to return to the user. These are specified together with  
MDBDeclaration.xml in museumCollection.xml and accessed with ease by Saxon)

So far so good, the paths are returned as they should.

I run in to trouble when I try to access the elements/attributes in the  
paths just extracted by the look-up function.

declare namespace ub = "http://www.uib.no";
declare function ub:mdb($globalVariPath)
 {
 for $i in  
doc("MDBDeclaration.xml")//member[refsGlobal=$globalVariPath]/path
 return $i
 };

let $globalVariPath := "zip"
for $res in collection("museumCollection.xml")

where ub:mdb($globalVariPath) = local-name($res)

return $res

The Where clause is written in pseudo-code and does not perform as I  
intended. I’ve tried using ub:mdb($globalVariPath)  as a predicate in the  
path expression(for-clause) but I don’t get it to work there either

Any help would be greatly appreciated.

Regards
Andreas Jacobsen
University of Bergen, Norway


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

Received on Wednesday, 25 August 2004 07:56:17 UTC