java - How to edit only opening tag or closing tag -


how edit opening tag or closing tag of xml file using java?

or how create valid one. since java creating automatic closing tags same name , have

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

what is

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

and browser expect > after <img close

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

don't worry parsing special characters xml, fixed problem.

the resume of problem try create or edit nametag image , write line xml or xhtml file, , since there lot of tags , files modify don't want manualy.

you can't create element that. argument createelement() called tagname, , ("img" in case).

you need call setattribute(string name, string value) on returned element.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -