I have a couple of projects which contain a lot of XML in a non-standard format (one is an in-house web framework that a friend is working on, and one is a project at work). The XML contains references to other elements in the project, but IDEA doesn't enable navigation for them since it has no idea what the elements represent. How would I go about adding extra navigation for XML files (i.e. allowing the user to Cmd-click on elements/attributes if they refer to other project elements)?
Also, if I wanted to embed a custom language in an existing file format (in this case XML, but I'm also interested in Java for another project) how would I do that? Obviously I can't touch the Java or XML lexers or parsers, would I parse the files as my custom type and provide chameleon tokens for the existing language (i.e. chameleon tokens would cover the whole file except the bits with my custom language, instead of the other way around)?