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 8865819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:36:56+00:00 2026-06-14T16:36:56+00:00

I asked this question in a different format and XSLT was mentioned but don’t

  • 0

I asked this question in a different format and XSLT was mentioned but don’t think I explained the solution I need. I have two xml files and using Java and I am trying to write a program that will accept a source and target xml file and for the most part they will have the same structure except the source will have some new elements added and I need to figure out how I can navigate the source DOM and if an element is not found in the target then add it or at this point even just have the program output what elements are not found in the target file making it easier to manually modify the target file. Does anyone know of a utility where I can do something like this and just get a list of elements not found in the target xml file. Am I correct to use a DOM parser vs. SAX. I need help on this, have to write it today and have about 50 xml files to merge!

Am I thinking in line with the idea of navigating the entire source DOM for each node or element get the full path like people/person/john and then on my target DOM somehow test to see if that node exists? Does this sound more like DOM or a SAX parsing paradigm?

  • 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-06-14T16:36:57+00:00Added an answer on June 14, 2026 at 4:36 pm

    it seems like your problem is much simpler then that.

    1. parse source into DOM
    2. parse dest into DOM
    3. traverse source and dest in a depth first search in parallel
    4. whenever you hit something in source missing in dest, add it (as mentioned in the comments, one easy way to do this is Document.importNode())
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked a question earlier, but I think I need a different solution to
I know many have asked this question, but I think my situation is a
This question may have been asked in different formats, but for my current requirement
I've seen this question asked on here, but it seems to be different than
Alright, I know this question has been asked before, but mine has a different
I have asked this question in a different post here on SO: How can
I asked this question on the Google Group but I think I will get
This question was asked a lot, but I can't find the solution for my
This question has been asked before but I am facing a slightly different problem.
I asked this question already but my friend said to take a different approach.

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.