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

  • Home
  • SEARCH
  • 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 939975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:52:44+00:00 2026-05-15T21:52:44+00:00

Here is my scenario: I have an XML file where various attributes (TextBox, CheckBox

  • 0

Here is my scenario:

  1. I have an XML file where various attributes (TextBox, CheckBox etc) of an HTML form are specified. (this is because, if the form changes later, the user only edits the XML file)

  2. Now, I need to read the XML file and render the presentation accordingly.

So, should I:

  1. Read the XML file everytime I need to render the presentation, OR

  2. Read the file once during initialization of the app and save it some where in the memory? If yes, then how?

File is very small: 2.5KB, 60lines

  • 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-15T21:52:44+00:00Added an answer on May 15, 2026 at 9:52 pm

    It probably makes little difference to your code whether you read the XML file once or multiple times. (It affects performance, but that’s not the real issue. And you should be able to switch between the two approaches with little effort.)

    The real issue is how your rendering code accesses the information (in a sense, metadata) represented by the XML. You have a number of alternatives. For example:

    1. Your rendering code could use the W3C DOM APIs directly (or jdom, dom4j, etc) to access access the metadata … as it goes.
    2. You could write some extra code to turn the DOM into an in-memory data structure with nicer interfaces.
    3. You could to the same, but using a SAX parser to build the data structure.
    4. You could use some technology like EMF to generate custom Java classes from your XSD, and then load them.

    Which is best rather depends on the complexity of your XML (or more precisely, its schema), and how much of your rendering code needs to “touch” the metadata. Generally speaking, the greater the complexity and the more your code depends on it, the more you need to move away from using the DOM directly.

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

Sidebar

Related Questions

Here's the scenario: I have a textbox and a button on a web page.
So here's the scenario...I have an XSD file describing all the objects that I
Here's the scenario. We use a large XML configuration file for one of our
Consider this scenario: I've an XML file called person.xml with the following data in
Here is my (simplified for this case scenario) XML: <?xml version=1.0 encoding=UTF-8?> <?xml-stylesheet href=test_1.xsl
Here is my scenario: I have a windows form designed in Visual Studio 2010.
Here's my scenario - I have an SSIS job that depends on another prior
Here's the scenario: You have a Windows server that users remotely connect to via
Here's the scenario: You have an ASP.Net application supported by a Microsoft SQL Server
Here's the scenario I have a Grid with some TextBlock controls, each in a

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.