There are quite a few different ways of displaying XML in a tree - e.g. should only element appear, then should text & attributes appear in another control. However if you want to improve the TreeModel by all means go ahead and hack it to improve it. Its more of a proof of concept right now, I'm sure you can do much better ;-)
 
If you like you could submit your changes back and we can include them in the dom4j distro.

James
----- Original Message -----
Sent: Wednesday, March 06, 2002 10:40 PM
Subject: [dom4j-user] current DocumentTreeModel... useful?

I've been trying to display a XML file in a JTree component for a (supposedly) easy way to view and edit a DOM4j document.  I've discovered that the DocumentTreeModel class really doesn't do what I would call an impressive job of displaying the document!  Namespace information, comments, unknown elements, and text nodes are all shown the same way (as leaves, no differentiation between them).  All elements with elements or other information are shown logically as branch nodes.  Attribute data is stored in the tree, but isn't shown in ANY way!  I don't see any way to make good use of it as it is written and I'm quite tempted to create my own TreeModel and CellRenderer then subclass JTree and make it all appear what seems to be logical to me (not completely determined yet).  Anyone else tried to use a JTree to display their documents with success?  I really want to use this as a way to test a bunch of element editing functions that I'm working on, but I don't want to have to re-invent the wheel....
 
 
Chris Golden
_______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to