A document format plug-in is used by XXE to map a file extension ("json
", "md
") to a non-XML document format (JSON, Markdown, etc). This lets authors use XXE to open, edit and save non-XML documents as if they were XML documents.
Like all plug-ins, a document format plug-in is not declared anywhere. It is dynamically discovered and loaded during the startup of XXE (more info in Section 1, “Dynamic discovery of add-ons” in XMLmind XML Editor - Configuration and Deployment) provided that it complies with the following conventions:
The code of the document format plug-in must be contained in a JAR file having a name ending with "_docformat.jar
".
This JAR file must contain a META-INF/services/com.xmlmind.xmleditapp.docformat.DocumentFormat
file containing the name of the class implementing interface com.xmlmind.xmleditapp.docformat.DocumentFormat
.
For example, json_docformat.jar
contains META-INF/services/com.xmlmind.xmleditapp.docformat.DocumentFormat
which contains com.xmlmind.xmleditext.json_docformat.JSONFormat
.
Implement com.xmlmind.xmleditapp.docformat.DocumentFormat
.
If you plan to implement a document format plug-in and need an example showing how this can be done, please send an email to <xmleditor-info@xmlmind.com>
and we'll provide you with the full source code of the "JSON document format".