Content assist not working if Errors in XML instance

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
kingargyle
Posts: 58

Content assist not working if Errors in XML instance

Thu Jun 28, 2007 2:42 am

If an XML Instance is being edited, and a schema is attached either through a XML Catalog or schemaLocation, the content assist on the xml instance stops working. I.e. hitting CTRL-SPACE doesn't bring up a list of suggested XML elements or attributes to use. This does work using the Eclipse Web Tools 2.0 xml editor.

The problem is that if the suggest elements aren't listed it makes it more difficult to correct the instance to make it valid against a schema. Particularly if a required element is missing, and you aren't sure what the other available elements are for an instance in that particular location.
sorin_ristache
Posts: 4144

Thu Jun 28, 2007 3:27 pm

Hello,

The content completion stops working if the XML instance contains an error before the cursor position. If validate as you type is enabled you should see the errors in the Problems view. You can highlight the errors with the Validate Document action. First correct the errors for using the content completion again.


Regards,
Sorin
george
Site Admin
Posts: 2100

Thu Jun 28, 2007 5:54 pm

We can implement something like: if we get zero proposals for valid elements then we can show all the elements that can go inside the current element and eventually mark these proposals somehow (displayed with gray, add a message in the documentation window before the annotation message for that element, etc.).
Any other ideas?

Regards,
George
George Cristian Bina
kingargyle
Posts: 58

Thu Jun 28, 2007 7:13 pm

I would assume that you would have access to the PSVI which would still allow you to suggest the available elements availabel at the cursor position. Ideally, the content assist would also indicate the occurrence constraint, and possibly highlight which are required fields and which are optional.

The instance I'm dealing with was created by another user, and already had the validation errors, so I wasn't creating it as I typed, just trying to debug why the instance wasn't valid.

Return to “Common Problems”

Who is online

Users browsing this forum: adrian and 3 guests