How to use xml dom api to auto resolve tag content ?

Answered

I am developing a plugin to resolve xml file, and I find a useful article https://plugins.jetbrains.com/docs/intellij/xml-dom-api.html#resolving  , but  I need to resolve xml content like below

<?xml version="1.0" encoding="us-ascii"?>
<AssetDeclaration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="uri:ea.com:eala:asset">

<LogicCommandSet
id="AlliedConstructionYardCommandSetBase">
<Cmd>Command_PurchaseAlliedInfantryUpgrade</Cmd>
</LogicCommandSet>

<LogicCommand
Type="OBJECT_UPGRADE"
id="Command_PurchaseAlliedInfantryUpgrade">
</LogicCommand>

</AssetDeclaration>

The  LogicCommand  tag define a command named Command_PurchaseAlliedInfantryUpgrade  ,  and the Cmd subtag use this command id in its content.  Now I want to resolve the text in Cmd to its definition (i.e.  the  LogicCommand with id attribute Command_PurchaseAlliedInfantryUpgrade) . In other word, when I ctrl click the text in Cmd , the editor will jump to id="Command_PurchaseAlliedInfantryUpgrade". Anyone know how to do it?

1 comment
Comment actions Permalink

Use ResolvingConverter and perform the resolve/completion in its implementation.

0

Please sign in to leave a comment.