I must be missing something real obvious here. I have two xml files (books1.xml and books2.xml) that represent book collections. The files have a format like this:TCP/IP Illustrated StevensW. Addison-Wesley 65.95 Advanced Programming in the UNIX Environment StevensW. Addison-Wesley 65.95
There are some books listed in books1.xml that are not in books2.xml. I attempted to write a query that returned just the books missing from books2.xml, assuming that the attribute year was unique. The query looked like this:
for $a in doc(“container1\books1.xml”)\book
let $b := doc(“container1\books2.xml”)\book
where $a@year != $b@year
This query returns all of the books in $a. If I change the where clause to ‘where $a@year = $b@year’, then the query returns all the files in $a that are also in $b. What am I missing?