[jdom-interest] getChildren

Antonello Dell'Armi A.Dellarmi at ELIS.ORG
Fri Dec 13 01:33:37 PST 2002


i have an element accesslist with inside a sequence of instance element.Each instance consist on 2 different element named watcher and tupleid.
<instance>
	<watcher>a</watcher>
	<watcher>b</watcher>
	<tupleID>1</tupleID>
	<tupleID>3</tupleID>
</instance>

My desire is to add a new element watcher. So i do:
 
List watchers = instance.getChildren("watcher");

Element newatcher = new Element("watcher");
newatcher.setText("c");
watchers.add(newatcher);

but i get:

<instance>
	<watcher>a</watcher>
	<watcher>b</watcher>
	<tupleID>1</tupleID>
	<tupleID>3</tupleID>
	<watcher>c</watcher>
</instance>

that it's wrong!!!Where i do the mistake?
BRGS
Antonello
			       



More information about the jdom-interest mailing list