Context Sensitive Annotations for Content Completion Assistant

Having trouble installing Oxygen? Got a bug to report? Post it all here.
cjade
Posts: 1
Joined: Wed Jan 23, 2019 1:47 am

Context Sensitive Annotations for Content Completion Assistant

Post by cjade »

Hi there,

I've been using the 'Customizing Annotations in the Content Completion Assistant' page to map each of my elements to new annotations and it's working well so far.

I'm just wondering if it's possible within the contentCompletionElementsMap.xml file to make this more context sensitive? I'd like to be able to specify multiple annotations for the same element name, depending on where it is being suggested for insertion.

This is currently working:

Code: Select all

<mappingGroup xml:base="descriptions/">
<mapping elementName="element1" path="element1.html" type="content"/>
</mappingGroup>
When element1 is suggested for insertion anywhere in my XML file I am seeing the contents of element1.html as expected.

I'm looking to have something like the following (which obviously doesn't work):

Code: Select all

<mappingGroup xml:base="descriptions/">
<mapping elementName="element2/element1" path="element2-element1.html" type="content"/>
<mapping elementName="element3/element1" path="element3-element1.html" type="content"/>
</mappingGroup>
I'd just like to know if this kind of thing possible or are we limited to one generic annotation per element using this method? Is there another way I would be able to do this?
Radu
Posts: 9451
Joined: Fri Jul 09, 2004 5:18 pm

Re: Context Sensitive Annotations for Content Completion Assistant

Post by Radu »

Hi,

Indeed the XML configuration file can only map the element name to documentation, so it cannot express this idea that if the element is placed in a certain parent element its documentation should be something else. I added an internal issue on our side to see if we can improve the configuration file.
As workarounds:

1) Have the element refer to an HTML documentation which explains the element can be used in two contexts and which has links to other documentation HTML documents, one for each context.
2) We do have some Java API which might allow you to take control over the documentation for certain elements:

https://www.oxygenxml.com/InstData/Edit ... rBase.html

an implementation for such API could be added to the framework configuration for your specific XML vocabulary in the "Extensions" tab.
So if you are comfortable with using Java extensions I could try to give you more details about this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply