Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Reading XML content and storing in variable

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Reading XML content and storing in variable

    Hi,
    I am using SAX parser to parse the xml file.

    I am trying to store the tag value in some variable so that I can use that variable across the project and in future if any changes need to be done then I will just have to change the xml file.

    I try to search on net but that dont store value in some variable.

    Any Help will be appreciated.

    Thanks!!!!!!!!!!


  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default Re: Reading XML content and storing in variable

    Hi - You need to use the Java to XML binding API - JAXB - Or you can use open source API like Castor.
    JAXB maps the XML elements to java objects so that they can be accessed in your java code.
    This is the standard way for mapping XML data into Java.
    I hope this answers your question.

  3. The Following User Says Thank You to girishmanwani For This Useful Post:

    learn_java (November 19th, 2012)

Similar Threads

  1. Reading into a File and storing it into an Array
    By loui345 in forum What's Wrong With My Code?
    Replies: 16
    Last Post: October 21st, 2012, 11:48 PM
  2. Reading XML File using DOMParser and have problem with accessing xml
    By optiMystic23 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 21st, 2012, 02:22 PM
  3. HELP with reading a clients ip address and storing in a text file.
    By dannyyy in forum Java Theory & Questions
    Replies: 1
    Last Post: April 4th, 2011, 08:20 AM
  4. [SOLVED] Reading from a text file and storing in arrayList
    By nynamyna in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 26th, 2010, 10:55 PM
  5. Reading .txt and storing into an array
    By vluong in forum Collections and Generics
    Replies: 1
    Last Post: January 4th, 2010, 02:07 PM