Content assist not working if Errors in XML instance

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Posts: 58
Joined: Fri Nov 11, 2005 6:35 am

Content assist not working if Errors in XML instance

Post by kingargyle » 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.

Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Thu Jun 28, 2007 3:27 pm


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.


Site Admin
Posts: 2102
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » 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?

George Cristian Bina

Posts: 58
Joined: Fri Nov 11, 2005 6:35 am

Post by kingargyle » 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.

Post Reply