Page 1 of 1

Any way to force filebrowser content completion for RNG hrefs?

Posted: Mon Sep 10, 2018 4:54 pm
by tcleghorn
I have an attribute @href, used to refer to the URIs of external documents and defined in my RelaxNG schema like this:

Code: Select all


<attribute name="href">
<data type="anyURI"/>
</attribute>
There are also ID attributes on other elements in my schema defined as "<data type="ID"/>". When I open an instance document and add an href attribute, the content completion dropdown initially offers the values of these IDs (e.g. "#foo,#bar,#baz") rather than the filebrowser dropdown.

If I use the 'Learn Structure' menu option on my instance document, then subsequent hrefs _do_ display the filebrowser dropdown (I guess because it has correctly observed that other hrefs in the document contain file paths).

Is there any way to force the filebrowser behaviour? Ideally, is there something I could add to the RNG schema that would have the desired effect? I do already have a document type association for these documents, but would rather avoid writing any plugin code if at all possible.

Re: Any way to force filebrowser content completion for RNG hrefs?

Posted: Mon Sep 10, 2018 6:09 pm
by Radu
Hi,

I can reproduce the problem on my side. Somehow we propose the file paths content completion helpers only when there are no other entries available and in this case our code suggests that the gathered "#id" entries might also be appropriate so the file paths helpers are not proposed anymore.
We have an issue registered for this, I'll try to bump its priority and look a little bit into it. You cannot "fix" this from the RNG code. We do have Java API which would allow you to propose your own content completion entries thus in a way to re-implement our file paths content completion support.

Regards,
Radu

Re: Any way to force filebrowser content completion for RNG hrefs?

Posted: Mon Sep 10, 2018 6:34 pm
by tcleghorn
Thanks Radu - for what it's worth, I would've thought that the existing behaviour would make more sense with IDREF types than anyURI. Perhaps there's some scope for adding some kind of annotation to RNGs that Oxygen could use? Even a magic trigger-phrase to put in a documentation element would be useful - something like <data name="foo"><a:documentation>oxygen-treat-as-filepath</a:documentation>...</data>.

I can absolutely manage by just using learn structure, though, so it's good to know I shouldn't spend time hunting for a cheap workaround!

Re: Any way to force filebrowser content completion for RNG hrefs?

Posted: Tue Sep 11, 2018 9:21 am
by Radu
Hi Tom,

Thanks, we'll take your proposal into consideration.

Regards,
Radu