Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » New XML file wizard and schemaLocation
New XML file wizard and schemaLocation [message #895327] Thu, 12 July 2012 13:05 Go to next message
Maxime Jeanmart is currently offline Maxime JeanmartFriend
Messages: 35
Registered: November 2010
Member
Hi all,

Our developers are using the WTP new XML file wizard to create their XML files. In the wizard, they select XSDs from the XML catalog to get validation and content assistance. These XSDs are declared in eclipse plugins we provide (extension point).

The file generated by the wizard is like that:
<abc:configuration
   xmlns:abc="http://www.mycompany.com/configuration"
   xmlns:xsi="..."
   xsi:schemaLocation="http://www.mycompany.com/configuration jar:file:/c:/eclipse/plugins/com.mycompany.configuration_1.0.0.201207121023.jar!/model/configuration.xsd"
>...


The problem is that the schema location expressed this way is no portable at all
- it includes the complete jar file name with version and qualifier.
- it includes the eclipse installation path

Because of that, validation and content assist doesn't work anymore if we update the plugins or change the eclipse installation path. The workaround is to remove the schemaLocation entry or replace the jar URI by a platform URI manually, but we don't find this very user friendly since developers create dozens of xml files per day.

Is there any way to impact the way the XML file is generated?

Thanks for any help you could provide,
Maxime
Re: New XML file wizard and schemaLocation [message #895448 is a reply to message #895327] Fri, 13 July 2012 01:17 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2337
Registered: July 2009
Senior Member
Can you append the content of your plugin.xml?

---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: New XML file wizard and schemaLocation [message #895494 is a reply to message #895448] Fri, 13 July 2012 09:24 Go to previous messageGo to next message
Maxime Jeanmart is currently offline Maxime JeanmartFriend
Messages: 35
Registered: November 2010
Member
Here is an example:

   <extension
         point="org.eclipse.wst.xml.core.catalogContributions">
      <catalogContribution>
         <public
               publicId="http://www.mycompany.com/configuration"
               uri="platform:/plugin/com.mycompany.configuration/model/configuration.xsd">
         </public>
      </catalogContribution>
   </extension>

Re: New XML file wizard and schemaLocation [message #895790 is a reply to message #895494] Mon, 16 July 2012 04:42 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2337
Registered: July 2009
Senior Member
I admit I'm not very familiar with this part of our code base. It seems to work as you want when I select a catalog entry we ship in the org.eclipse.jst.standard.schemas plug-in; perhaps studying its plugin.xml will be of help.

---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: New XML file wizard and schemaLocation [message #895847 is a reply to message #895790] Mon, 16 July 2012 09:53 Go to previous message
Maxime Jeanmart is currently offline Maxime JeanmartFriend
Messages: 35
Registered: November 2010
Member
using "uri" extension element instead of "public" extension element solves my problem. Thanks for the tip.
Previous Topic:JSDT "Open Declaration" NOT WORKING for JsDoc "hints". OK if type is inferred. A
Next Topic:Unabel test Web Service with Web Service Explorer
Goto Forum:
  


Current Time: Fri Nov 28 15:08:03 GMT 2014

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

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