The moose likes XML and Related Technologies and the fly likes JTree to XML? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JTree to XML?" Watch "JTree to XML?" New topic

JTree to XML?

C Kutler
Ranch Hand

Joined: Apr 15, 2004
Posts: 62

I have a JTree with a simple hierarchy, like an index. I want to convert the data in the JTree into an XML document. I can find how to get XML into a JTree but not the other way around.

Any suggestions?

We learn by doing, there is no other way.
clio katz
Ranch Hand

Joined: Apr 30, 2004
Posts: 101
you can serialize the doc. check out e. r. harold's Output from DOM Chapter in his "Processing XML with Java
" book

note: far-and-away one of the best technical books i've ever read - and he made the entire text available online! he's a real hero ...
C Kutler
Ranch Hand

Joined: Apr 15, 2004
Posts: 62

Thanks for the answer and the pointer to what appears to be a very useful book.
I agree. Here's the link:
subject: JTree to XML?
jQuery in Action, 3rd edition