Reading Time: 4 minutes

Mule configuration files are Spring XML files by nature. So the XML editor is an important development tool and provides a lot of benefit. When working in Eclipse, it provides:

  • Schema documentation assistance for the element you are configuring
  • Validation of your schema and context of any errors that are detected
  • Autocomplete of elements and attributes based on what is valid in the current element of configuration you are editing

However, Eclipse’s XML editor (provided as part of the WTP project) does not properly handle autocomplete with schema substitution groups. Unfortunately, we use those substitution groups a lot in Mule so we filed a bug with the Eclipse project. Half a year later someone attached patch to address the issue. Since then there was not much activity on the issue with respect to getting the fix into an Eclipse release.

As part my work on Mule IDE I sat down and created an update site that you can use to install the patch from. Our list of favorite Eclipse XML editor bugs has the update site links.

To test that the patch actually works just create a new Mule configuration file and start typing:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
    xsi:schemaLocation="
       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
       http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.1/mule-vm.xsd">

    <flow name="MyFlow">
        <vm: .... press space here ...

Note the difference: before you installed the patch autocomplete would just not work and you’d be left guessing what elements the VM transport would support here. Now, with the patch installed, you actually get autocomplete!

This patch is useful when working with XML based on any schema that makes use of substitution groups. Feel free to use it even if you do not use Mule’s IDE. While rolling out the patch via a custom update site works I’d rather like to see the issue properly fixed and rolled out in the next Eclipse release. You can help to make it happen by going to Eclipse bug 247312 and casting your vote.