Completion XML schema [message #200020] |
Wed, 19 September 2007 08:25  |
Eclipse User |
|
|
|
Hello,
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?
Thanks.
|
|
|
|
|
Re: Completion XML schema [message #200567 is a reply to message #200490] |
Tue, 25 September 2007 17:25   |
Eclipse User |
|
|
|
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
|
|
|
Re: Completion XML schema [message #200610 is a reply to message #200490] |
Wed, 26 September 2007 09:21  |
Eclipse User |
|
|
|
>
> 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="...">
Turn on Warn When No Grammar in the Preferences -> XML Files. This will
give a small yellow box on the right hand side of the editor if it can't
find the schema.
From there you can do two things:
1. Have an XML Catalog entry for your schema
2. Make sure that you have the correct URI path to the schema specified
in your schema location.
|
|
|
Powered by
FUDForum. Page generated in 0.02888 seconds