Fix parser error on export.

This commit is contained in:
Paulo Gustavo Veiga 2012-11-01 00:14:21 -03:00
parent dafe8eeb03
commit e5e2e86fce
4 changed files with 11 additions and 3 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ wisemapping.log*
*/.DS_Store
.DS_Store
target
.idea

View File

@ -207,7 +207,8 @@ public class FreemindExporter
htmlContent.append("</body></html>");
DocumentBuilder db = getInstanceBuilder();
Document document = db.parse(new ByteArrayInputStream(htmlContent.toString().getBytes()));
byte[] bytes = htmlContent.toString().getBytes("UTF-8");
Document document = db.parse(new ByteArrayInputStream(bytes), "UTF-8");
richcontent.setHtml(document.getDocumentElement());
return richcontent;
}

View File

@ -119,6 +119,12 @@ public class FreemindImporter
final String version = freemindMap.getVersion();
if (version != null) {
// Is freemind mindmap ?
if (version.charAt(0) != '0') {
throw new ImporterException("Mindmap is not a FreeMind document. Document type info " + version);
}
final VersionNumber mapVersion = new VersionNumber(version);
if (SUPPORTED_FREEMIND_VERSION.isGreaterThan(mapVersion)) {
throw new ImporterException("FreeMind version " + mapVersion.getVersion() + " is not supported.");

View File

@ -1,4 +1,4 @@
<map version="1.9.0">
<map version="0.9.0">
<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
<node CREATED="1301246214383" ID="ID_886000454" MODIFIED="1301246809450" TEXT="Fonts">
<node CREATED="1301246745581" ID="ID_1660145973" MODIFIED="1301246791264" POSITION="right" TEXT="Styles">