# Foreign Keys and cross referencing

Available in...

* Data Fabric
* MDM Platform

Talend MDM sends the XML record, without resolving the FKs. It is up to the Smart View to lookup/resolve them.

As the Process is a multi-step pipeline, you can have one or several steps before the final XSLT step. So you will need to insert a step to resolve your FKs and/or cross referencing. You can use a Talend Job deployed as a ZIP or you can use a &lt;parameters&gt;

&lt;CrossRef&gt;

&lt;xrefName&gt;Country&lt;/xrefName&gt;

&lt;xrefCluster&gt;crossreferencing&lt;/xrefCluster&gt;

&lt;xrefRootElement&gt;/Product&lt;/xrefRootElement&gt;

&lt;xrefIn&gt;

&lt;mapping&gt;

&lt;xrefElement&gt;CountryCode&lt;/xrefElement&gt;

&lt;xrefPath&gt;Countries/ISO2&lt;/xrefPath&gt;

&lt;/mapping&gt;

&lt;/xrefIn&gt;

&lt;xrefOut&gt;

&lt;mapping&gt;

&lt;xrefElement&gt;CountryName&lt;/xrefElement&gt;

&lt;xrefPath&gt;Countries/Name&lt;/xrefPath&gt;

&lt;/mapping&gt;

&lt;/xrefOut&gt;

&lt;/CrossRef&gt;

&lt;/parameters&gt; step.

First example: if the data model is Product with a FK to ProductFamily, use the following parameters to resolve the product family, which is the raw family code (e.g. "[1234]"), to the actual family name:

```
<parameters> 
   <CrossRef> 
       <xrefName>FamilyFK</xrefName>  
       <xrefCluster>Product</xrefCluster>  
       <xrefRootElement>/Product</xrefRootElement>  
       <xrefIn> 
            <mapping> 
                <xrefElement>Family</xrefElement>  
                <xrefPath>ProductFamily/Id</xrefPath> 
            </mapping> 
       </xrefIn>  
       <xrefOut> 
            <mapping> 
                <xrefElement>Family</xrefElement>
             <xrefPath>ProductFamily/Name</xrefPath> 
        </mapping> 
      </xrefOut> 
   </CrossRef> 
</parameters>
```

Second example: if there is a Countries cross reference table with key = ISO2 and value = Name and you want to resolve Product/CountryCode into Product/CountryName, use the following parameters:

```
<parameters> 
   <CrossRef> 
       <xrefName>Country</xrefName>  
       <xrefCluster>crossreferencing</xrefCluster>  
       <xrefRootElement>/Product</xrefRootElement>  
       <xrefIn> 
          <mapping> 
              <xrefElement>CountryCode</xrefElement>  
              <xrefPath>Countries/ISO2</xrefPath> 
          </mapping> 
       </xrefIn>  
       <xrefOut> 
          <mapping> 
              <xrefElement>CountryName</xrefElement>  
              <xrefPath>Countries/Name</xrefPath> 
          </mapping> 
       </xrefOut> 
    </CrossRef> 
</parameters>
```