How to join 2 documents which have two different collections

Hi,

I have a database (DB) where there are 2 differents collections (dbcoll1 and dbcoll2). Every collection have differents data and in a xquery I must join the 2 collections because I need some data form 2 collections.

How can I join two differents collections in a xquery?

Thank you for your help.

C

If you have at least Tamino 4.2, you can use the collection() function:

for $d1 in collection('dbcoll1')/doc1, $d2 in collection('dbcoll2')
where $d1/key = $d2/key1
return <result>{$d1, $d2}</result>

Hi Curtis,

In fact, I have the Tamino version 4.4.1 and your response answers to my question. It’s that I need.

Thank you for your help!

C