How to modify XmlFiles

Hi, I need to add new nodes to some XML files.
What is the proper way of doing this inside jIdea?
I can get the PsiFile (XmlFile), but I don't know how to create a new XmlTag and add it.

Can you show me an example?

Thanks !

2 comments
Comment actions Permalink

XmlFile.getRootTag()
XmlTag.createChildTag()
XmlTag.addSubTag()
etc.
You'll find dozens of examples in IntelliJ IDEA Community Edition source code.

0
Comment actions Permalink

Thanks Alexander, I think I had something wrong in my configuration because I couldn't see any .java file from the jIdea core (the IDE was finding only .class files).
It's fixed now (although I don't remember to change anything, maybe was an index problem).

0

Please sign in to leave a comment.