Subject:Xquery to cross reference two files Author:(Deleted User) Date:25 Mar 2009 12:31 PM
Hi Stylussees,
I am searching for a way to cross reference two xml files. My first file contains a list of payment/receipt request which all have a link to a project. My second file contains all projects.
The first file is imported after the second and if a payment/receipt is imported for a project which does not exist the import application returns an error.
What I want to do is cross reference the two xml files to check for projects which do not exist in file 2. So I made below xquery. Which either is not completey correct, cause it runs for hours without any result or my files are just too big - file 1 has 8525 records and file 2 2 has 20.000+ records.
Hope you can help me out,
Cynthia
for $ProjectNumber in doc('file:///e:/Klanten/Conversie/BetalingenOntvangsten/CrossReference/OnlyProjects.xml')/Projects/ProjectNumber return
let $arg1:=$ProjectNumber/text()
for $Project in doc('file:///e:/Klanten/Conversie/Projecten/5maart/AllProjectsOnly.xml')/Projects/Project return
let $arg2:=$Project/text()
return
if ($arg1=$arg2)
then ()
else
<Project>
{$arg1}
</Project>
Subject:Xquery to cross reference two files Author:(Deleted User) Date:27 Mar 2009 05:33 AM
Thanks, I am gonna test it right away....
Posted another problem relating to these files in the XSLT board, cause besides valiation I also want to a separate ProjectMembers xml file into my Projects file. Posted under 'Performance xsl:for each and need for xsl:key instruction?'