Page 1 of 1

Autocomplete for keyref

Posted: Tue Nov 03, 2009 1:08 am
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.

Re: Autocomplete for keyref

Posted: Tue Nov 03, 2009 5:50 pm
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

Re: Autocomplete for keyref

Posted: Tue Nov 03, 2009 9:57 pm
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

Re: Autocomplete for keyref

Posted: Tue Nov 03, 2009 10:10 pm
by cwingrav
Ok george, I can understand your post. Can you add this to the feature request area?

Re: Autocomplete for keyref

Posted: Wed Nov 04, 2009 12:17 pm
by george
Done!

Re: Autocomplete for keyref

Posted: Sun Nov 27, 2011 5:12 am
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

Re: Autocomplete for keyref

Posted: Mon Nov 28, 2011 12:03 pm
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

Re: Autocomplete for keyref

Posted: Mon Oct 17, 2016 8:13 pm
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.

Re: Autocomplete for keyref

Posted: Mon Oct 31, 2016 11:04 am
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