Object reference question

Hi,
I’m using Tamino 3.1.2.1 and I have to make a join operation between 2 doctypes in 2 different collection. I saw some examples but all use an attribute to make a reference between foreign schema and home schema. Let’s suppose this scenario:

home doctype sample:

1
dummy


foreign doctype sample:

100
1


Is possible to make a reference between uid in result and id un user?
I tried to use as nodeRef user/id but doesn’t work.
I’d want to obtain something like this:


100


1
dummy




Any idea? Am I doing something wrong? Is mandatory to use an attribute as reference?

Thanks a lot,

Gx

Hello Gx,

I think that what you are trying to do should work.
Could you please post the two schemas that you are working with?

Thanks,
Trevor.

Hi, Trevor
In attach you can find the schemas of USER and RESULT collection and 2 xml data sample files to put some data into collection.

Thanks a lot for the help,

regards,
Gx
objectRefSample.zip (1.55 KB)

Hello Gx,

the good news is: your schemas are fine.
In order to automatically follow the reference when querying the “result” documents, it is necessary to modify the “result” documents.

To make Tamino embed the referenced document into the referencing document in queries, you must add an empty element - with the same name as the referencing element - into the content of the referencing element.

So the result document would look like this:
   <?xml version="1.0" encoding="iso-8859-1"?>
   
      100
      1
   

I hope this helps!
Trevor.

Great!
Now works fine!

Thanks again Trevor

Gx