Which is correct. If I try to validate in the XQuery:
let $input := ddtek:validate(/EDIFACT,'../dictionaries/applications/ecs/xsd/ECS_COPRAR_IN.xsd')
return
<a:xlCoprar>
<a:xlAgentsVoyageNumber>
{
let $RFF_VON := for $RFF in $input/EDIFACT/COPRAR/GROUP_1/RFF where $RFF/RFF0101/text() = 'VON' return $RFF/RFF0102/text()
return
if( string-length($RFF_VON) > 0 ) then
$RFF_VON
else
$input/EDIFACT/COPRAR/GROUP_1/TDT/TDT02/text()
}
</a:xlAgentsVoyageNumber>
</a:xlCoprar>
I get the validation error:
[DataDirect][XQuery]Error in call to ddtek:validate(): Error in complex type GROUP_1: Ambiguous content model, element <RFF> appears more than once
It works, but then I get the error:
[DataDirect][XQuery]Error in call to ddtek:validate(): In content of element <GROUP_3>: The content model does not allow element <EQD> to appear here. Expected: NAD