Autocomplete for keyref

Are you missing a feature? Request it's implementation here.
cwingrav
Posts: 2

Autocomplete for keyref

Tue Nov 03, 2009 1:08 am

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: 4144

Re: Autocomplete for keyref

Tue Nov 03, 2009 5:50 pm

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: 2100

Re: Autocomplete for keyref

Tue Nov 03, 2009 9:57 pm

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

Re: Autocomplete for keyref

Tue Nov 03, 2009 10:10 pm

Ok george, I can understand your post. Can you add this to the feature request area?
george
Site Admin
Posts: 2100

Re: Autocomplete for keyref

Wed Nov 04, 2009 12:17 pm

Done!
George Cristian Bina
6'6
Posts: 1

Re: Autocomplete for keyref

Sun Nov 27, 2011 5:12 am

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: 5207

Re: Autocomplete for keyref

Mon Nov 28, 2011 12:03 pm

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.html#XML_Editor_Authoring_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: 2

Re: Autocomplete for keyref

Mon Oct 17, 2016 8:13 pm

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: 5207

Re: Autocomplete for keyref

Mon Oct 31, 2016 11:04 am

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

Return to “Feature Request”

Who is online

Users browsing this forum: No registered users and 1 guest