Results 1 to 5 of 5
  1. #1
    JonnySnip3r is offline Member
    Join Date
    Jan 2010
    Posts
    8
    Rep Power
    0

    Default Reading and Writing to XML - Help Please!

    Hey guys, I am new to Java and new to this forum! so Hey :)

    I have a problem I have been learning Java for about 4 Weeks or so, and I have decided to test what I have learned by making a bot type application. All it does is ask for your name and asks you to name it (retarded I know, but just testing what I have learned lol) that's basically it. What I would like to do is how could I get it to save what you input to an XML file?

    I know how to Read, Write and Create files just all the basic things really. I just don't know how to go about getting it to save to XML so in future when I type maybe Name? it will say the name you gave it previously.

    Thanks in advance, Hope I explained it well enough.

  2. #2
    bdtagar is offline Member
    Join Date
    Jun 2009
    Posts
    11
    Rep Power
    0

    Default

    Hi,
    I think this will help you:
    Java and XML - Tutorial

    bye...

  3. #3
    JonnySnip3r is offline Member
    Join Date
    Jan 2010
    Posts
    8
    Rep Power
    0

    Default

    Thank you for your help :) Looks interesting.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    That and Google will help you. I've dabbled with XML before, but I don't find it straightforward since there are many many possible ways to read and write XML.

  5. #5
    adz
    adz is offline Member
    Join Date
    Jul 2009
    Posts
    35
    Rep Power
    0

    Default

    JDOM, ECS, etc are fine. To read I'd always use XPath.

    There are many ways to read/write like has been said, but you shouldn't simply use StringBuilders to create the XML (well I guess it could be "ok" for something small, I'd still never do it).

Similar Threads

  1. Reading and writing to a file
    By jigglywiggly in forum New To Java
    Replies: 13
    Last Post: 03-09-2009, 11:44 AM
  2. Serialization - writing/reading to memory
    By ajeeb in forum Advanced Java
    Replies: 3
    Last Post: 01-27-2009, 04:07 PM
  3. Reading/Writing to file
    By Doctor Cactus in forum New To Java
    Replies: 2
    Last Post: 10-28-2008, 03:05 PM
  4. Help with File reading and writing
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 07:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •