Results 1 to 5 of 5
Thread: XML file and HashMap
- 02-14-2011, 10:23 AM #1
XML file and HashMap
I am working on an school assignment where I have a file. And I need to make a Java program to make it to an XML file. I almost have got the whole program working. But there is a little fault in it.
Let's say this is the file I read in:
First day of the week.
Second day of the week.
Almost until it is weekend again.
Now busy with school.
<note>First day of the week.
At the moment I get back:
<note>First day of the week.</note>
How do I solve this?
I was thinking of HashMap.
But can I also print this HashMap to the file I would like?
Last edited by Lund01; 02-14-2011 at 10:30 AM.
- 02-14-2011, 10:31 AM #2
I think for note element you can use special separation character for example comma.
<day>Monday</day> <note>First day of the week.;Sunny day.</note> <dayTueseday</day>Skype: petrarsentev
- 02-14-2011, 10:37 AM #3
- 02-14-2011, 10:42 AM #4
It is easy.
String value = "First day of the week.;Sunny day". String notes = value.split(";");Skype: petrarsentev
- 02-14-2011, 10:45 AM #5
- By pandeyalok in forum Advanced JavaReplies: 7Last Post: 12-08-2009, 07:17 PM
- By ScaryJello in forum New To JavaReplies: 2Last Post: 04-15-2009, 09:18 AM
- By JordashTalon in forum New To JavaReplies: 0Last Post: 03-04-2009, 11:08 PM
- By gtriant in forum New To JavaReplies: 1Last Post: 12-15-2008, 02:29 PM