Creating and validating plugin.xml files with Eclipse using XML Schema

Version 3

    This guide will help you create valid Openfire plugin.xml files with use of XML Schema language and Eclipse. It assumes that you have WTP (Web Tools Platform) plugin installed on Eclipse. Guide is based on Eclipse Europa (version 3.3).

     

    Add plugin.xsd file to the Eclipse XML Catalog

    • Download plugin.xsd file attached to this document and place it somewhere inside your Openfire project.

    • Open Eclipse and open preferences ("Window" -> "Preferences" menu item).

    • Go to "Web and XML" -> "XML Catalog" menu.

    • Highlight "User specified Entries" in "XML Catalog Entries" and click "Add" button.

    • In the "Add XML Catalog Entry" window choose location of downloaded plugin.xsd file. Both "Key Type" and "Key" fields should be updated by Eclipse automatically, but if not choose "Namespace Name" as a "Key Type" and paste http://www.igniterealtime.org/projects/openfire/plugin into "Key" field.

    • Click "Ok" and check if new entry was created under "User specified Entries".

     

    Validate plugin.xml file against plugin.xsd

    • Open your plugin.xml file using "XML Editor". Choose "Open With" -> "XML Editor" in right-click menu in "Package Explorer" or "Navigator" views.

    • Add default namespace attribute by pasting xmlns="http://www.igniterealtime.org/projects/openfire/plugin" into the plugin tag.

    • Right-click on editor and choose "Validate".

     

    Notes

    • After editing plugin.xml file you must remove namespace declaration. Currently Openfire (version 3.4) doesn't support namespaces in plugin.xml.

    • By using XML schema you will get Content Assist in plugin.xml file. Just hit CTRL+Space between opening and closing plugin tags and you will get list of available elements.

    • Detailed help on using XML files and creating associations with DTDs and XML schemas under Eclipse is available inside Eclipse Help.