scheme location problem regarding Content assist in xml editor [message #529616] |
Mon, 26 April 2010 10:41  |
Eclipse User |
|
|
|
Hi,
I'm developing xml editor which is based on WTP project. I did that by extending the internal org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditor Part. I've removed the design page which is originally TreeViewer extension from the XMLMultiPageEditorPart. Instead I added my own design page, which conforms the structured of the xml. Using this internal class I have outline page which is synchronized with the source page. I've made the validation of the xml using JAXP (Java API for XML processing) because the validation of the XMLMultiPageEditorPart works only on IFiles.
For the management of the model I use ModelManager and its methods getModelForRead/ Edit.
Each time I need the document I get the model and then reference to the corresponding IDocument.
However I have a problem with Content assist.
At first I was using DTD as xml restriction for the mark up and I had put its declaration in the xml by inserting
<!DOCTYPE Root_Node SYSTEM "DTD_relative_location">
The proposals which were supposed to be read from the DTD didn't appear in the Content Assist pop-up. When DTD declaration was in the xml itself the proposals were loaded. That wasn't an answer because it's better when the schema and xml are seperated.
Later I've decided to use xsd scheme.
The following I put in the root node of the xml
<Root_node xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///d:/temp/scheme/sampleScheme.xsd">
The tricky part here is that I want the location pointed out in noNamespaceSchemaLocation attribute to be independent on location of the plugin.
In other words: My plugin is in "d:/testPlugin", the xsd scheme is situated in it in a "resources" folder.
If I open the xml from any location, I want the Content assist to be working properly.
So I need some way to set this attribute before content assist is triggered in order to put the relative location calculated on the base of the location of the xml file and schema.
Also if there is way to point the scheme without writing it in the xml, so that Content assist would read it is also an option.
If there are any suggestions please write to me soon.
|
|
|
|
Re: scheme location problem regarding Content assist in xml editor [message #530686 is a reply to message #529616] |
Fri, 30 April 2010 10:12  |
Eclipse User |
|
|
|
Emil wrote on Mon, 26 April 2010 10:41 | The following I put in the root node of the xml
<Root_node xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///d:/temp/scheme/sampleScheme.xsd">
The tricky part here is that I want the location pointed out in noNamespaceSchemaLocation attribute to be independent on location of the plugin.
In other words: My plugin is in "d:/testPlugin", the xsd scheme is situated in it in a "resources" folder.
If I open the xml from any location, I want the Content assist to be working properly.
So I need some way to set this attribute before content assist is triggered in order to put the relative location calculated on the base of the location of the xml file and schema.
Also if there is way to point the scheme without writing it in the xml, so that Content assist would read it is also an option.
|
As Nitin suggested you want to leverage the XML Catalog support.
http://wiki.eclipse.org/Using_the_XML_Catalog
|
|
|
Powered by
FUDForum. Page generated in 0.06596 seconds