how to read a txt file in xml format in java

  • 17 years ago

    hey everyone
    could some please help with this program
    i have to read a file that's like this


    <?xml version="1.0"?>
    <portfolio>
    <investment>..........</investment>
    <investment>..........</investment>
    <investment>..........</investment>
    </portfolio>


    i have to skip the header and footer and process only the records that start with <investment>, then parse the information in order to extract the data items and create an investment object and then add them to the object to the portfolio.
    i have searched all over the web but couldn't find anything that would help me accomplish this.
    could someone please help me
    i need this all figured out before saturday night
    much obliged
    goku_04

  • 17 years ago

    try to search it on PSC  


  • 17 years ago

    You will need to use a library. The ones I used is Xerces and Xalan:
    http://xml.apache.org/xerces2-j/index.html

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“If Java had true garbage collection, most programs would delete themselves upon execution.” - Robert Sewell