[jdom-interest] updating an attribute
Peter Barraud
peterb at interrait.com
Wed Jul 4 04:09:31 PDT 2001
is it possible to update an element attribute
I tried to use setAttribute on an already existing attribute and it created
a duplicate attribute
I then removed and then added an attribute, it placed the new attribute
right at the end
am I doing anything wrong or it this what it should be
here is the basic code:
Element ele = doc.getRootElement();
ele.removeAttribute("path");
ele.setAttribute("path",rq.getParameter("txtPath"));
if I remove line two then I get a bad xml file where this element has two
attributes named path
thanx in advance
peter
More information about the jdom-interest
mailing list