How to filterRNG Schema Annotation Hover Help

<oXygen/> general issues.
steve.cuzner
Posts: 69

How to filterRNG Schema Annotation Hover Help

Sat Jan 23, 2016 1:43 am

I'm working with a docbook and when I hover over an element I get the annotations from the RNG schema for that element, which is great. However, I get all the annotations for that element regardless of context. Take the info element which is used in multiple patterns for multiple contexts (info in book, info in chapter, info in sections, etc.) So the hover help looks like:

A wrapper for information about a component or other block
A wrapper for information about a component or other block with a required title
A wrapper for information about a component or other block with only a title
A wrapper for information about a component or other block with only a required title
A wrapper for information about a component or other block without a title

This is complicated when I add my customization layer on top of docbook and extend info to meet my requirements. Now the hover help gives my custom annotations plus the annotations from core docbook that may or may not be accurate. Is there a way to filter out the hover help to display annotations for the pattern that is the current validation context? Also, is there a way to specify that the hover help source come from a custom namespace, that way I could disgard items from the a: namespace and instead use my own annotation namespace?

Steve
Radu
Posts: 5583

Re: How to filterRNG Schema Annotation Hover Help

Mon Jan 25, 2016 12:09 pm

Hi Steve,

Thanks for the report. We know about the situation but it's quite difficult to obtain the context of the element when extracting the annotation. We'll look into this more on our side though.
One possibility would be to avoid using the annotations from the schema completely for some elements:

https://www.oxygenxml.com/doc/versions/17.0/ug-editor/#tasks/author-styleguide-annotations.html

As an example, if you look inside the XML file: OXYGEN_INSTALL_DIR\frameworks\docbook\styleguide\contentCompletionElementsMap.xml

it maps various Docbook elements to links to the specification. These are the links that you see when hovering over various elements.
But you can also map Docbook elements to a fixed annotation content, thus bypassing the schemas completely, something like:

Code: Select all

.........
    <mappingGroup xml:base="descriptions/">
    ................
        <mapping elementName="info" path="info.html" type="content"/>
        ..............
    </mappingGroup>
.............


so that Oxygen will look in a folder called "descriptions" located in the same parent folder for a file called "info.html" and will use its content as an annotation for the "info" element, no matter in what context it is placed.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
steve.cuzner
Posts: 69

Re: How to filterRNG Schema Annotation Hover Help

Mon Jan 25, 2016 4:45 pm

Thanks, Radu, this will help.

Can the xml:base attribute be used on the mapping element rather than the mappingGroup for more fine tuned control?

Might I suggest that a possible enhancement (I'll cross post to the other list) would be to modify the Preference Editor->Content Completion->Annotations->Use all Relax NG annotations as documentation from a check box to a list of namespaces and/or tags to use for annotations. This would allow a developer to ignore the http://relaxng.org/ns/compatibility/annotations/1.0 annotations and then use annotations from a custom namespace.

Steve
Radu
Posts: 5583

Re: How to filterRNG Schema Annotation Hover Help

Mon Jan 25, 2016 5:00 pm

Hi Steve,

The xml:base can be added also on the mapping element.
I see you already posted about the improvement that you want, we'll probably discuss on that thread.

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

Re: How to filterRNG Schema Annotation Hover Help

Mon Jan 25, 2016 5:03 pm

Hi Steve,

One more thing, based on your feedback I already started generating (for Oxygen 18.0 which will be released in Spring) small HTML descriptions for all Docbook elements, so if you drop us an email at support@oxygenxml.com I could give you the exact changes to perform on your side.

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

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 1 guest