[jdom-interest] what happens when a duplicate element is added

William Krick wkrick at eio-online.com
Tue Dec 30 11:09:06 PST 2003

Using JDom b9, and given the following xml...

<?xml version="1.0" encoding="UTF-8"?>

...assume I have the above XML in a valid Document object "doc"
and I do this in my code...

Element root = doc.getRootElement();
root.addContent(new Element("tag2").addContent("456"));

What happens?
Do I end up with duplicate "tag2" tags?
Does "tag2" get replaced?

Is an exception thrown?


More information about the jdom-interest mailing list