XML : How to edit only opening tag or closing tag

How to edit only opening tag or closing tag of an XML file using Java?

Or how to create a valid one. since java is creating automatic closing tags with the same name and I have

  <img id="2" src="item1.jpg">    

What I get is

  <img id="2" src="item1.jpg">  bla bla </img id="2" src="item1.jpg">    

and the browser expect for a > after <img to close it

   doc.createElement("img id=\"2\" src=\"item1.jpg\"" );    

Don't worry about parsing special characters to XML, I fixed that problem.

The resume of my problem is that i try to create or edit a nametag to get an image and write this line into a XML or XHTML file, and since there will be a lot of tags and files to modify I don't want to do it manualy.

No comments:

Post a Comment