开发者

How to rename the element of xml file using Jdom

Thans for previous replies,

I am 开发者_StackOverflow社区trying to rename the xml element using Jdom concept, I have given elementNode.setName(newTagName) for changing the element of the node but this command is not working. if anyone know how to change the element of the xml file, pls guide me.


I assume the problem you have is the name does not change in the XML file you loaded using JDOM.

When modifying the nodes created by JDOM you don't modify the original file. You only change the in-memory JDOM data (that was loaded from your XML file). After doing the renaming you should thus write the JDOM tree to an XML file (the same you loaded data from or an other) to actually change it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜