How to Accessing XML with dynamic rootTagName through IntelliJ IDEA DOM
I am developing a plugin to work with a kind of xml config file.
the rootTag name of these xml file is dynamic ,
example:
A.xml
<?xml version="1.0"?>
<A.xml>
<foo> </foo>
<bar> </bar>
</A.xml>
B.xml
<?xml version="1.0"?>
<B.xml>
<foo> </foo>
<bar> </bar>
</B.xml>
I wonder if I can use DomManager.registerFileDescription() to regist this
kind of DomFileDescription ?
they don't have same root tag, what rootTagName should input in the
constructor : new DomFileDescription(Root.class, "root") ?
thx.
Please sign in to leave a comment.
com.intellij.util.xml.DomFileDescription#acceptsOtherRootTagNames() should do the trick together with com.intellij.util.xml.DomFileDescription#isMyFile()
Thank u very much !