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.

0
2 comments

com.intellij.util.xml.DomFileDescription#acceptsOtherRootTagNames() should do the trick together with com.intellij.util.xml.DomFileDescription#isMyFile()

0

Thank u very much !

0

Please sign in to leave a comment.