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){
        }

Recommended Answers

All 3 Replies

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.