Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsXML and Content Types
https://www.eclipse.org/forums/index.php/mv/msg/109625/334955/#msg_334955
I'm trying to define a content type for XML files that have a specific
root element and namespace. I did some searching and found that using the
XMLRootElementContentDescriber2 describer class should get me what I want.
I then hooked up an editor to the content type, and double clicking on
the file opens the correct editor in some cases, but not all.
2. As expected, the editor does not open for XML files that look like:
<example>
...
</example>
3. Not as expected, the editor does NOT open for XML files that look like:
<ex:example ex:xmlns="http://www.example.com/ex">
...
</ex:example>
I tried removing the namespace from the content type definition
(value="example") and that changed case #2 to open in the editor, but case
#3 still does not.
Any ideas what I'm doing wrong? Or is this not supported by
XMLRootElementContentDescriber2?
Thanks,
Nadeem]]>Nadeem Aboobaker2009-03-11T17:54:13-00:00Re: XML and Content Types
https://www.eclipse.org/forums/index.php/mv/msg/109625/334959/#msg_334959
up the namespace-prefix binding (switched "ex" and "xmlns"). Now
everything works as it should.
- Nadeem
Nadeem wrote:
> Hi All,
> I'm trying to define a content type for XML files that have a specific
> root element and namespace. I did some searching and found that using the
> XMLRootElementContentDescriber2 describer class should get me what I want.
> I then hooked up an editor to the content type, and double clicking on
> the file opens the correct editor in some cases, but not all.
> 2. As expected, the editor does not open for XML files that look like:
> <example>
> ...
> </example>
> 3. Not as expected, the editor does NOT open for XML files that look like:
> <ex:example ex:xmlns="http://www.example.com/ex">
> ...
> </ex:example>
> I tried removing the namespace from the content type definition
> (value="example") and that changed case #2 to open in the editor, but case
> #3 still does not.
> Any ideas what I'm doing wrong? Or is this not supported by
> XMLRootElementContentDescriber2?