XmlValueDisconnectedException happens when you are trying to perform operations
on a node after you deleted it. It's difficult to make recommendations without
looking at the code in detail, but that's what you should be looking for: what
happens to nodes after you delete them, and who has references to them still.
Radu
________________________________
From: Matthew Fadoul [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2008 3:36 AM
To: [email protected]
Subject: RE: Looking for an example of JTree with Xmlbeans (adding and
deleting nodes)
Quick update:
I've still got the XmlValueDisconnectedException problem on some node
delete operations. It seems that check_orphaned() may be failing. Still
looking for a solution/example that doesn't throw this exception.
Regarding points 2 and 3 below, I did figure out that the extra
children in the DOM structure was just the text between nodes.
Matt
________________________________
From: Matthew Fadoul
Sent: Tuesday, September 09, 2008 6:53 AM
To: '[email protected]'
Subject: Looking for an example of JTree with Xmlbeans (adding and
deleting nodes)
Hi all,
I'm having a bit of trouble with deleting nodes in a tree. I used
XmlBeans to create Java code from my schema, and am trying to connect it to a
JTree in Swing. I've looked at the example on the XmlBeans website
(http://xmlbeans.apache.org/samples/XmlTree.html), but I don't think it does
deletes. Here are some details:
1) I'm running into the xmlvaluedisconnectedexception. I've done a few
google searches, but haven't found a clear solution yet.
2) I've got a pretty simple schema, with a node type that can be a
parent of zero or more of the same type. For example:
MyNode (Parent)
- My Node (Child 1)
- My Node (Child 2)
- My Node (Child 3)
- My Node (Child 4)
When I get the array of children from the XmlBeans parent object, I see
four children. When I grab the parent's "Node" object (i.e. from the DOM), the
DOM shows 9 children. It seems that each child consists of a DOM Node object
and XmlObject object (for the MyNode data), plus an extra XmlObject for good
measure. The formula seems to be (2 * num children) +1. Unfortunately, when I
do a delete, I am only able to remove the XmlObject.
3) On the other side, when I do an "add" to the list of children, I
only add one child object (according to the DOM structure).
If anyone could help with an example and/or point me toward a good
explanation of the things going on "under the hood", I would really appreciate
it.
Thanks!
Matt