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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:36:30+00:00 2026-06-07T14:36:30+00:00

Here is what I am trying to do. Read entire XML file (I do

  • 0

Here is what I am trying to do.

  1. Read entire XML file (I do not care the name of element or attribute,etc..).
  2. Save the read XML file into memory.
  3. Update some values of read xml file.
  4. Write back to a XML file.

I am trying to use XMLStreamReader to read a XML file, however all the examples I see so far, it looks like i have to provide element name. But, I do not care about element names, just want to read entier XML file into memory. And, I am not sure how datatype I should be storing as I am reading. I am thinking to store them into Document datatype.

Any suggestions on how to read entire XML file and store read contents in memeory?

Thanks.

  • 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-07T14:36:33+00:00Added an answer on June 7, 2026 at 2:36 pm

    The easiest way to do this would be with JAXB. You can use xjc to generate Java classes from your XML schema. Then use JAXB to unmarhsal (load) your data, manipulate the Java object just as you normally would any other object (using getters/setters), and marshal (save) it back to an XML file.

    You could also use DOM directly, but manipulating the DOM is a lot more tedious than working with POJOs that directly mirror your XML structure.

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

Sidebar

Related Questions

I have an XML file that I'm trying to read from here , and
I'm trying to read a plist file into NSArray using initWithContentsOfFile as described here
I am trying to read this .csv file and here is an example of
I'm trying to parse and read a text file in Windows Phone 7. Here
I'm trying to read an entire stream (multiple lines) into a string. I'm using
I'm trying to read the contents of a file into my program but I
From PostgreSQL, am trying to read an image file into an Imagick object -
I'm trying to read a file into a buffer in blocks of size BLOCK_SIZE
I am trying to read the text content of a pdf file into a
I was trying to read a self-extracting zip (located here ftp://ftp.dnr.state.oh.us/OilGas/Download/Production/By_Year/2010Production.exe ) using java

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.