I'm an absolute beginner with Java and XML. I know XML fairly well. I would really appreciate it if someone could point me to a tutorial or a book that explains how to read and generate XML files using Java.
Long Live The dEvIL
William Brogden
Author and all-around good cowpoke
Rancher
Now, for more helpful APIs, the tutorial mentioned above is going to be the best source. I can help you focus by pointing out the parts you really want to see. This document tells you how to build a DOM (document object model) using API calls, and then this page tells you how to turn a DOM into an XML file on disk.
Finally, here's the documentation page for the JDOM project; JDOM is similar to the standard DOM API, but simpler (and non-standard.) You pays your nickle and you makes your choice.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12269
1
posted
0
For ultra-simple, the O'Reilly XML Pocket Reference at 175 pages, is about the simplest you can get. Harold's book is the best all-around reference I know of here is an online version. It is HUGE because the subject is huge. Bill
Edward Morris
Greenhorn
Joined: Jun 29, 2006
Posts: 18
posted
0
Thanks a lot guys, thats some good help I needed. I'm surprised JR doesn't have its own tut for this topic. Well to give you guys the big picture, I am working on this project
I'm a newbie with both of the above and I could really use some good and fast teaching help, and of course, I would really really appreciate it.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12269
1
posted
0
If this was my problem I probably would start by thinking about how to represent the data points both as Java objects and as XML Elements.
In some projects where a Java object represents some sort of unit of data, I have given the class a toXML( Writer out ) method and a constructor that takes the corresponding XML Element.
There are lots and lots of toolkits for transforming XML to objects and back if you don't want to tackle the problem that way. Browse some of the recent discussions here for examples or do a search for "java xml serialization".
Bill
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.