I am familiar typical with XQuery joins in Tamino like:
for $x in input()\employee,
$y in input()\doc
where $x/@employee_id = $y/@employee_id
</pre><BR><BR>But how would you do something like this SQL equivalent of an outer join:<BR><pre class="ip-ubbcode-code-pre">
select * from employee e
left outer join doc d on e.employeeid = d.employeeid
It depends rather on the output that you want to produce. Typically, I would expect to see something like this:
for $e in input()//employee return
{ $e/*, let $d = input()//dept[@dept-nr = $e/dept-nr] return if (empty($d)) then () else {$d} }
The SQL outer join produces a table in which unavailable data is replaced by null values. Typically with XML the equivalent will be to produce elements with a variable number of child elements.