Autocomplete for keyref

Are you missing a feature? Request its implementation here.
cwingrav
Posts: 2
Joined: Tue Nov 03, 2009 1:03 am

Autocomplete for keyref

Post by cwingrav »

I'm using my own xsd which validates an xml file properly but it does not autocomplete possible keys when I am entering a keyref. I.e., it does not provide a possible list like IDREF would from all the existing IDs. From what I have read, Oxygen does this but my Oxygen editor is not working. Am I misreading the functionality or is something wrong that I need to fix? My Oxygen version is 11.0.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Autocomplete for keyref

Post by sorin_ristache »

Hello,

When editing an XML file that is validated against an XML Schema the content completion window displays in an element or attribute that is specified in a xs:keyref the values that are matched by the xs:key referenced in the xs:keyref. For example if you have inside an xs:element the following:

Code: Select all

  <xs:key name="empid">
<xs:selector xpath="person"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:keyref name="keyref1" refer="empid">
<xs:selector xpath="person"/>
<xs:field xpath="link/@manager"/>
</xs:keyref>
content completion displays the values of id attributes of a person element when entering the value of a manager attribute of a person element. If it does not work in your XML document please post a sample XML document and XML Schema for reproducing the problem.


Regards,
Sorin
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Autocomplete for keyref

Post by george »

Hi,

oXygen provides content completion for IDREF and IDREFS values by offering the collected ID type values. There is no similar support for key/keyrefs, sorry.

Best Regards,
George
George Cristian Bina
cwingrav
Posts: 2
Joined: Tue Nov 03, 2009 1:03 am

Re: Autocomplete for keyref

Post by cwingrav »

Ok george, I can understand your post. Can you add this to the feature request area?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Autocomplete for keyref

Post by george »

Done!
George Cristian Bina
6'6
Posts: 1
Joined: Sun Nov 27, 2011 5:07 am

Re: Autocomplete for keyref

Post by 6'6 »

Hi,

A quick note that we also have found this to be a desirable feature, so now there's twice the interest as before. =)

If anyone can provide a suggestion on an alternate way to get oXygen to suggest values for completion when referencing a non-unique ID, I'm interested in learning about other options.

Cheers,
Joe
Radu
Posts: 9053
Joined: Fri Jul 09, 2004 5:18 pm

Re: Autocomplete for keyref

Post by Radu »

Hi Joe,

This has not yet been implemented because it is very hard to implement, the XPath expressions which define these constraints are very flexible and they can be applied virtually on any element.

But, if you have basic Java development skills:

Oxygen has an Author SDK:
http://www.oxygenxml.com/oxygen_sdk.htm ... horing_SDK

Using this SDK you can implement a ro.sync.contentcompletion.xml.SchemaManagerFilter interface which would allow your Java extension to provide additional attribute values for certain attributes.

If you are interested in this approach I can give you more details.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ProfessorK
Posts: 6
Joined: Mon Oct 17, 2016 8:10 pm

Re: Autocomplete for keyref

Post by ProfessorK »

Five years later, this is stil a MUCH desired feature.

Given that you can successfully validate/invalidate against a keyref I dont undrstand why you cant pop up a menu giving all valid choices.

It seems like a no-brainer.
Radu
Posts: 9053
Joined: Fri Jul 09, 2004 5:18 pm

Re: Autocomplete for keyref

Post by Radu »

Hi,

We will add your feedback on the opened issue. Thing is that we usually cache information needed in order to obtain attribute values so that when you are invoking the content completion, Oxygen does not freeze up trying to determine possible attribute values which can be used.
In this case, because XPath expressions are used, Oxygen needs to evaluate an XPath expression each time you evaluate the content completion window, this might lead to the application blocking if the XML is very large. But maybe we'll find a way to approach this in a future version.

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