File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes problem understanding xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "problem understanding xml file" Watch "problem understanding xml file" New topic
Author

problem understanding xml file

Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
I have this:


I managed to create the class like this:


I'm having trouble with


how do I integrate these two lines into Address class?
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

Probably you can create a collection of street lines.


or since you have line numbers mentioned as keys in xml, even a Map sounds relevant.

Another simple solution would be to have 2 Strings called and .
But your xml attribute
line="x"
inclines me towards a Collection or a Map


Anrd
"One of the best things you could do is to simplify a larger application into a smaller one by reducing its process and complexity - Fowler"
Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
So the Address class will look like this:


there are some alternatives for Street class:







which one is best describing the xml?
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

I like the most. Due to your attribute line="x".
Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
yes, I feel the same way. thanks. problem solved nicely.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem understanding xml file