|
Re: Completion XML schema [message #200482 is a reply to message #200020] |
Tue, 25 September 2007 08:56 |
|
David wrote:
> I use a StructuredTextEditor to display source in my editor. And I would
> like to get the completion in my source according to the XSD file. I
> think I have to use ModelQueryExtension, but I don't how.
> Someone could help me?
If your file refers to the XSD within its contents, this should
already work. Is it not?
--
Nitin Dahyabhai
Structured Source Editing
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Re: Completion XML schema [message #200567 is a reply to message #200490] |
Tue, 25 September 2007 21:25 |
|
David wrote:
> Hi Nitin,
> first of all, I had this in my plugin.xml :
>
> <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
> <!-- associating a source viewer configuration to an input's content
> type--> <sourceViewerConfiguration class=
> "org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML "
> target="org.eclipse.wst.xml.core.xmlsource"/>
> <!-- associating an outline configuration to an input's content type -->
> <contentOutlineConfiguration
> class=" org.eclipse.wst.sse.xml.ui.views.contentoutline.XMLContentOu tlineConfiguration "
>
> target="org.eclipse.core.runtime.xml"/>
> <!-- associating a property sheet configuration to multiple content
> types -->
> <propertySheetConfiguration
> class=" org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConf iguration "
>
> target="org.eclipse.wst.sse.contenttype.xml"/>
> </extension>
None of this should be needed (and since it redefines extensions for
targets that already have classes assigned, it could break
something). IF the input file is recognized as XML or a
sub-content-type of XML, the model should already contain the needed
adapters to have the content model and the editor should
automatically pick up the various XML configuration classes (in both
cases it walks up the content type hierarchy). If you're using the
editor as a page within a multipage editor, be sure to set the
page's site ID to 'ContentTypeIdForXML.ContentTypeID_XML +
".source"' so it knows to pick up some of the UI contributions as well.
> Moreover, as you said, my file refers to the XSD with this :
> <Specification xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://..." xsi:schemaLocation="http://... XXX.xsd"
> Description="...">
>
> Nevertheless, I don't have completion in my source page.
> Where is the error?
I'm not an authority on schema references, but the first question is
whether it works in the existing XML Editor.
--
Nitin Dahyabhai
Structured Source Editing
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Powered by
FUDForum. Page generated in 0.02727 seconds