New Freeplane File Format (Proposal)
⇒ This page is work in progress and not endorsed in any way (yet) by the Freeplane team as a whole Discussion happens on the developers' mailing list ⇐
Contents
Introduction
Freeplane version 1.0.x (and 1.1.x) was developed using FreeMind's format and file extension (.mm) in an effort to allow a smooth transition to users willing to switch to Freeplane. As Freeplane grows mature and wants to make true its Visions, a new file format is required.
File types and extensions.
A Freeplane file can come in 4 flavors, as single XML document file or as package:
- Single XML document:
- a plain XML format with extension .freeplane.
This format allows further for easy automated generation and XSLT transformation. - the above format in a standard ZIP or JAR file, i.e. if a file named myfile.freeplane.zip or myfile.freeplane.jar contains a file named myfile.freeplane, it will be opened by Freeplane in the same way as the above plain XML format (other files in the same archive will be ignored).
The file format is still easy to generate but takes less space than plain XML, is cleaner to email (some mailers choke on text formats) and can be used to transport other files (even though they will be ignored by Freeplane).
- a plain XML format with extension .freeplane.
- Package Document:
- a more complex zipped format with extension .freeplanez.
This format allows for embedded styles, images and other 3rd party objects. - the same structure but in an uncompressed directory with extension .freeplane.d.
- a more complex zipped format with extension .freeplanez.
Overall, the XML format is the same in all flavors, and aligned (as much as possible) with the Open Document Format from the OASIS organization.
File format requirements
- clean XML
- multiple maps per file possible
- easy generation
- embedding of 3rd party objects
- support real styles
- allow for comparison between different files
- allow for tracked changes
Generic rules
- Each XML file must start with an XML declaration <?xml version="1.0" encoding="UTF-8" ?>
.
- this means that the Freeplane format is based on XML 1.0 and has UTF-8 as encoding.
- (X)HTML entities are not used anymore for accentuated characters but just plain UTF-8 encoding.
- A single XML document may continue with an XSLT reference like <?xml-stylesheet type="application/xslt+xml" href="url-to-some-XHTML-transformation-sheet"?> as to allow web browsers to render directly Freeplane files.
- Freeplane must ignore (but keep) such entries and should add a default one when creating a new map.
- The Freeplane team should offer standard XSLT transformation sheets e.g. under http://freeplane.org/formats/map-2010/transform-to-xhtml10.xsl.
- All XML markups are in small caps and must have an explicit namespace
- The namespace must be declared either as xmlns:attribute of the root element of the XML file, or, if rendered by a plug-in, as xmlns:attribute of the XML element rendered by this plug-in
- Example
- if a node has the xmlns attribute <map:node xmlns:myplug="myplug-namespace" ...>[...], Freeplane could find an OSGi service NodeRenderer with a filter based on the given namespace to render this specific node.
- The namespace for Freeplane specific elements is xmlns:map="http://freeplane.org/formats/map-2010".
- Until further notice, all formatting elements are based on XHTML 1.0/1.1 and have the namespace xmlns:xhtml="http://www.w3.org/1999/xhtml".
- SimplyHTML must be adapted accordingly, and perhaps released as OSGi bundle!?
Format Specifics
(structure aligned with version 1.2 of the Open Document Format)
Part 1 - XML File Format
1 - Introduction
1.1 to 1.4 - no changes
1.5 - Namespaces
We stick to the same namespaces wherever applicable, and add the following one:
Prefix | Description | Namespace |
---|---|---|
map | For all Freeplane specific elements | http://freeplane.org/formats/map-2010 |
2 - Scope (not relevant)
3 - Document Structure
TBD
Part 2 - OpenFormula
not applicable (yet?)
Part 3 - Packages
TBD