Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6905879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:14:17+00:00 2026-05-27T08:14:17+00:00

How do I find/use op:except with the multiple xml files? I’ve gotten the nodes

  • 0

How do I find/use op:except with the multiple xml files?

I’ve gotten the nodes from file 1 and file 2, and in the xquery expression I’m tring to find the op:except of those two. When I use op:except, I end up getting an empty set.

XML File 1:

<a>txt</a>
<a>txt2</a>
<a>txt3</a>

XML File 2:

<a>txt2</a>
<a>txt4</a>
<a>txt3</a>

I want output from op:($nodesfromfile1, $nodesfromfile2) to be:

<a>txt</a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:14:17+00:00Added an answer on May 27, 2026 at 8:14 am

    It effectively comes down to the single line behind the return in the following code. You could put that in a function if you like, but it is already very dense, so maybe not worth it..

    let $file1 := (
        <a>txt</a>,
        <a>txt2</a>,
        <a>txt3</a>
    )
    let $file2 := (
        <a>txt2</a>,
        <a>txt4</a>,
        <a>txt3</a>
    )
    return
        $file1[not(. = $file2)]
    

    Note, you also have the ‘except’ keyword ($file1 except $file2), but that works on node identity which won’t work if the nodes comes from different files.

    By the way, above code uses string-equality for comparison. If you would prefer to do a comparison on full node-structure, you could also use the deep-equal() function.

    HTH!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that to find all the .h files I need to use: find
The examples I can find use a two layer architecture, where the controllers directly
I needed to find and use the coordinates of the intersection of a cubic
Thanks for reading this I thought I could use find(), but couldn't make it
In C++, I can use find_if with a predicate to find an element in
What tools do you use to find unused/dead code in large java projects? Our
Is it possible to use BindingSource.find on multple columns? I have a treeview and
I want to use List.Find() on a simple collection that does not implement Find().
What tools and techniques do you use to find dead code in .NET? In
I know that I can use Query language to find the record I want.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.