*
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
Consider Paul's rocket mass heater.
 
subject: problem understanding xml file
 
Similar Threads
starting web service
Java in XSLT
Address Book Java Issues
Hash code consistency across multiple implementations.
Interfaces and abstract classes