i have used the XMLEncoder to put my list of clients details into but am wondering how i go about retrieving information from the xml files say for instance if i wanted to show all clients who were entered on a specific date?

so far i have.

 public void dxml(){
                       try {
           XMLDecoder d = new XMLDecoder(new BufferedInputStream(new FileInputStream("client.xml")));

        List<Client> list = (List<Client>) d.readObject();
        d.close();
System.out.println(list.toString());
}catch (FileNotFoundException e){
        }

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Why not continue with your original thread instead of creating a new one? Plus no code tags even after 12 posts? If you are not serious about asking for help, no one would be serious about giving you one.

Edited 6 Years Ago by ~s.o.s~: n/a

Why not continue with your original thread instead of creating a new one? Plus no code tags even after 12 posts? If you are not serious about asking for help, no one would be serious about giving you one.

It was on a slightly different topic even though fairly similar......

yea i know bout the code tags seems like i always remember after i post.

It was on a slightly different topic even though fairly similar......

In that case if the thread has served its purpose consider marking it as "solved" so that it helps those having a similar query.

yea i know bout the code tags seems like i always remember after i post.

You have 30 minutes to edit your post.

how i go about retrieving information from the xml files say for instance if i wanted to show all clients who were entered on a specific date?

AFAIK, you'll have to read the entire list and filter it in-memory.

This article has been dead for over six months. Start a new discussion instead.