Paul Clapham wrote:I don't know what the "asXML" method does in dom4j, and I don't feel like hunting down its documentation on the web. So I'm just going to guess that you should be using some other method there. Like the getRootElement method for example. You didn't say why you wanted to do this or what the output should have been, so guessing is the only way forward.
Hi Paul,
thanks for reply.
actually I was getting follwoing extra line in output.xml file. asXML is simple parsing text to xml in dom4j. I am now able to modify the element in xml..
by following code (instead of asXML, because asXML method is adding "<?xml version="1.0" encoding="UTF-8"?>" line )
but still getting problem.
I am searching the element (by loop) when find, first remove that element and again adding the modified element on there. after that writing that xml again.
I looking forward to do same with XPath instead of loop. Because in my condition we know the element path.
please help..