
Originally Posted by
Loren Rosen
I don't see this happening until you save and close the file and re-open it (after adding the doctype and the <beans> tag of course). Is this the behavior other people see as well?
Yes, this is the expected behaviour. WTP's XML editors (and BeansXmlEditor as well) are using the Eclipse extension point org.eclipse.core.runtime.contentTypes.
The following code snippet is copied from BeansXmlEditor's plugin.xml:
Code:
<extension point="org.eclipse.core.runtime.contentTypes">
<content-type id="beansConfig"
name="%contentTypeName"
base-type="org.eclipse.core.runtime.xml"
priority="high"
default-charset="UTF-8">
<describer class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
<parameter name="element" value="beans"/>
</describer>
</content-type>
</extension>
By using this extension point an XML file with a specific root element is associated with a specialized XML editor instead using a list of file extensions only.