Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Completion XML schema
Completion XML schema [message #200020] Wed, 19 September 2007 12:25 Go to next message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
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 #200482 is a reply to message #200020] Tue, 25 September 2007 08:56 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2341
Registered: July 2009
Senior Member
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 WTP, IBM
Re: Completion XML schema [message #200490 is a reply to message #200482] Tue, 25 September 2007 09:44 Go to previous messageGo to next message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
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>

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?

David.
Re: Completion XML schema [message #200567 is a reply to message #200490] Tue, 25 September 2007 21:25 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2341
Registered: July 2009
Senior Member
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 WTP, IBM
Re: Completion XML schema [message #200610 is a reply to message #200490] Wed, 26 September 2007 13:21 Go to previous message
David Carver is currently offline David CarverFriend
Messages: 174
Registered: July 2009
Senior Member
>
> 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.
Previous Topic:JavaXPCOM question - swt MozillaBrowser
Next Topic:Drag and drop into the SSE
Goto Forum:
  


Current Time: Sat Dec 20 06:48:51 GMT 2014

Powered by FUDForum. Page generated in 0.02489 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software