From 05080bbfa65d535bdfe6fb245d58d973669225b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Euzenat?= <Jerome.Euzenat@inria.fr>
Date: Mon, 19 Sep 2016 08:38:32 +0000
Subject: [PATCH] - Parameterised encoding in IndentedRenderer - init( p ) goes
 to IndentedRenderer

---
 html/impl.html                                | 15 +++++++++++++
 .../exmo/align/impl/BasicAlignment.java       |  2 +-
 .../renderer/COWLMappingRendererVisitor.java  |  6 +++--
 .../renderer/GraphPatternRendererVisitor.java |  6 +++--
 .../renderer/HTMLMetadataRendererVisitor.java |  5 +++--
 .../renderer/IndentedRendererVisitor.java     | 22 ++++++++++++++++++-
 .../impl/renderer/JSONRendererVisitor.java    | 11 +++-------
 .../renderer/OWLAxiomsRendererVisitor.java    |  3 ++-
 .../impl/renderer/RDFRendererVisitor.java     |  9 ++------
 .../renderer/SEKTMappingRendererVisitor.java  |  6 +++--
 .../impl/renderer/SKOSRendererVisitor.java    |  5 +++--
 .../SPARQLConstructRendererVisitor.java       | 13 +++--------
 .../SPARQLLinkkerRendererVisitor.java         |  6 ++---
 .../renderer/SPARQLSelectRendererVisitor.java | 10 ++-------
 .../impl/renderer/SWRLRendererVisitor.java    |  5 +++--
 .../renderer/XMLMetadataRendererVisitor.java  |  5 +++--
 .../impl/renderer/XSLTRendererVisitor.java    |  5 +++--
 17 files changed, 79 insertions(+), 55 deletions(-)

diff --git a/html/impl.html b/html/impl.html
index 0fd46a0c..749ae0fa 100644
--- a/html/impl.html
+++ b/html/impl.html
@@ -496,6 +496,21 @@ Reykjavik (IS), pp4178-4183, 2014
 </small>
 </dd>
 
+<dt>[<a href="">DESIM</a>]</dt>
+<dd>
+The DESIM system (Descriptive to Executable Simularion modeling), developed at MITRE, is a decision support system
+which can crowdsource elementary opinions in order to reach a
+decision. In order to accomodate multiple models, it has been extended
+to use the Alignment API and server to keep track of correspondences
+between models.
+<!--br /><small>
+Mark Pfaff, personal communication, 2016
+https://www.researchgate.net/profile/Mark_Pfaff2
+No publication mentioning this unfortunately.
+, <a href=""></a>, 
+</small-->
+</dd>
+
 
 </dl></p>
 
diff --git a/src/fr/inrialpes/exmo/align/impl/BasicAlignment.java b/src/fr/inrialpes/exmo/align/impl/BasicAlignment.java
index 067aa9df..3c6b767e 100644
--- a/src/fr/inrialpes/exmo/align/impl/BasicAlignment.java
+++ b/src/fr/inrialpes/exmo/align/impl/BasicAlignment.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2003-2011, 2013-2015
+ * Copyright (C) INRIA, 2003-2011, 2013-2016
  * Copyright (C) CNR Pisa, 2005
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java
index 8b0ead23..eeaea12f 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2003-2004, 2007-2010, 2012-2015
+ * Copyright (C) INRIA, 2003-2004, 2007-2010, 2012-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -58,7 +58,9 @@ public class COWLMappingRendererVisitor extends IndentedRendererVisitor implemen
 	super( writer );
     }
 
-    public void init( Properties p ) {}
+    public void init( Properties p ) {
+	super.init( p );
+    }
 
     public void visit( Alignment align ) throws AlignmentException {
 	if ( subsumedInvocableMethod( this, align, Alignment.class ) ) return;
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/GraphPatternRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/GraphPatternRendererVisitor.java
index 6bb70767..10357b0e 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/GraphPatternRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/GraphPatternRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2012-2015
+ * Copyright (C) INRIA, 2012-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -24,6 +24,7 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.net.URI;
+import java.util.Properties;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Hashtable;
@@ -122,7 +123,8 @@ public abstract class GraphPatternRendererVisitor extends IndentedRendererVisito
         super( writer );
     }
 
-    protected void init() {
+    protected void init( Properties p ) {
+	super.init( p );
         listBGP = new ArrayList<String>();
         subjectsRestriction = new HashSet<String>();
         objectsRestriction = new HashSet<String>();
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/HTMLMetadataRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/HTMLMetadataRendererVisitor.java
index f77504fc..c4a0940c 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/HTMLMetadataRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/HTMLMetadataRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2006-2010, 2012-2015
+ * Copyright (C) INRIA, 2006-2010, 2012-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -63,6 +63,7 @@ public class HTMLMetadataRendererVisitor extends IndentedRendererVisitor impleme
     }
 
     public void init( Properties p ) {
+	super.init( p );
 	if ( p.getProperty( "embedded" ) != null 
 	     && !p.getProperty( "embedded" ).equals("") ) embedded = true;
     };
@@ -105,7 +106,7 @@ public class HTMLMetadataRendererVisitor extends IndentedRendererVisitor impleme
 	    //extensionString += "  <"+tag+">"+((String[])ext)[2]+"</"+tag+">\n";
 	}
 	if ( embedded == false ) {
-	    indentedOutputln("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>");
+	    indentedOutputln("<?xml version=\"1.0\" encoding=\""+ENC+"\" standalone=\"no\"?>");
 	    indentedOutputln("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML+RDFa 1.0//EN\" \"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd\">");
 	}
 	indentedOutput("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"");
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/IndentedRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/IndentedRendererVisitor.java
index 35976cd5..fc4a1d1c 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/IndentedRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/IndentedRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2010, 2012, 2015
+ * Copyright (C) INRIA, 2010, 2012, 2015-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -22,6 +22,8 @@ package fr.inrialpes.exmo.align.impl.renderer;
 
 import java.io.PrintWriter;
 
+import java.util.Properties;
+
 /**
  * Structure for indented rendering
  *
@@ -37,6 +39,8 @@ public class IndentedRendererVisitor extends GenericReflectiveVisitor {
 
     protected String NL = "";
 
+    protected String ENC = "utf-8";
+
     /** String for the pretty linebreak. **/
     protected String linePrefix = "";
 
@@ -55,6 +59,22 @@ public class IndentedRendererVisitor extends GenericReflectiveVisitor {
 	NL = nl;
     }
 
+    public void setEncoding( String encoding) { 
+	ENC = encoding;
+    }
+
+    protected void init( Properties p ) {
+        if (p.getProperty("indent") != null) {
+            setIndentString( p.getProperty("indent") );
+        }
+        if (p.getProperty("newline") != null) {
+            setNewLineString( p.getProperty("newline") );
+        }
+        if (p.getProperty("encoding") != null) {
+            setEncoding( p.getProperty("encoding") );
+        }
+    }
+
     // ===================================================================
     // pretty printing management
     // JE: I THINK THAT THIS IS CONVENIENT BUT INDUCES A SERIOUS LAG IN
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/JSONRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/JSONRendererVisitor.java
index 5988932b..a12e101d 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/JSONRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/JSONRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2012, 2014-2015
+ * Copyright (C) INRIA, 2012, 2014-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -105,13 +105,8 @@ public class JSONRendererVisitor extends IndentedRendererVisitor implements Alig
         super(writer);
     }
 
-    public void init(Properties p) {
-        if (p.getProperty("indent") != null) {
-            INDENT = p.getProperty("indent");
-        }
-        if (p.getProperty("newline") != null) {
-            NL = p.getProperty("newline");
-        }
+    public void init( Properties p ) {
+	super.init( p );
     }
 
     public void visit(Alignment align) throws AlignmentException {
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/OWLAxiomsRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/OWLAxiomsRendererVisitor.java
index 72919a14..982bb457 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/OWLAxiomsRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/OWLAxiomsRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2003-2004, 2007-2015
+ * Copyright (C) INRIA, 2003-2004, 2007-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -108,6 +108,7 @@ public class OWLAxiomsRendererVisitor extends IndentedRendererVisitor implements
     }
 
     public void init( Properties p ) {
+	super.init( p );
 	if ( p.getProperty("heterogeneous") != null ) heterogeneous = true;
     };
 
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/RDFRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/RDFRendererVisitor.java
index d7be0802..ab444c08 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/RDFRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/RDFRendererVisitor.java
@@ -106,16 +106,11 @@ public class RDFRendererVisitor extends IndentedRendererVisitor implements Align
     }
 
     public void init(Properties p) {
+	super.init( p );
         if (p.getProperty("embedded") != null
                 && !p.getProperty("embedded").equals("")) {
             embedded = true;
         }
-        if (p.getProperty("indent") != null) {
-            INDENT = p.getProperty("indent");
-        }
-        if (p.getProperty("newline") != null) {
-            NL = p.getProperty("newline");
-        }
     }
 
     public void visit(Alignment align) throws AlignmentException {
@@ -149,7 +144,7 @@ public class RDFRendererVisitor extends IndentedRendererVisitor implements Align
             extensionString += INDENT + "<" + tag + ">" + ext[2] + "</" + tag + ">" + NL;
         }
         if (embedded == false) {
-            outputln("<?xml version='1.0' encoding='utf-8' standalone='no'?>");
+            outputln("<?xml version='1.0' encoding='"+ENC+"' standalone='no'?>");
         }
         output("<" + SyntaxElement.RDF.print(DEF) + " xmlns='" + Namespace.ALIGNMENT.prefix + "'");
         // JE2009: (1) I must use xml:base
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/SEKTMappingRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/SEKTMappingRendererVisitor.java
index 1034c7a5..1b880136 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/SEKTMappingRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/SEKTMappingRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2003-2005, 2007-2010, 2012-2015
+ * Copyright (C) INRIA, 2003-2005, 2007-2010, 2012-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -62,7 +62,9 @@ public class SEKTMappingRendererVisitor extends IndentedRendererVisitor implemen
 	generator = new Random();
     }
 
-    public void init( Properties p ) {};
+    public void init( Properties p ) {
+	super.init( p );
+    };
 
     public void visit( Alignment align ) throws AlignmentException {
 	if ( subsumedInvocableMethod( this, align, Alignment.class ) ) return;
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/SKOSRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/SKOSRendererVisitor.java
index 7539390a..078cad01 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/SKOSRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/SKOSRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2003-2004, 2006-2010, 2012, 2014-2015
+ * Copyright (C) INRIA, 2003-2004, 2006-2010, 2012, 2014-2016
  * Copyright (C) Quentin Reul, 2008
  *
  * This program is free software; you can redistribute it and/or modify
@@ -61,6 +61,7 @@ public class SKOSRendererVisitor extends IndentedRendererVisitor implements Alig
     }
 
     public void init( Properties p ) {
+	super.init( p );
 	if ( p.getProperty( "embedded" ) != null 
 	     && !p.getProperty( "embedded" ).equals("") ) embedded = true;
 	if ( p.getProperty( "pre2008" ) != null 
@@ -76,7 +77,7 @@ public class SKOSRendererVisitor extends IndentedRendererVisitor implements Alig
 	    onto2 = ((ObjectAlignment)align).getOntologyObject2();
 	}
 	if ( embedded == false ) {
-	    indentedOutputln("<?xml version='1.0' encoding='utf-8' standalone='no'?>");
+	    indentedOutputln("<?xml version='1.0' encoding='"+ENC+"' standalone='no'?>");
 	}
 	indentedOutputln("<rdf:RDF");
 	increaseIndent();
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLConstructRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLConstructRendererVisitor.java
index 8af87380..9b77bcea 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLConstructRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLConstructRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2012-2015
+ * Copyright (C) INRIA, 2012-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -74,7 +74,7 @@ public class SPARQLConstructRendererVisitor extends GraphPatternRendererVisitor
      * Initialises the parameters of the renderer
      */
     public void init(Properties p) {
-	init();
+	super.init( p );
         if ( p.getProperty("graphName") != null ) {
             setGraphName( p.getProperty("graphName") );
         }
@@ -100,13 +100,6 @@ public class SPARQLConstructRendererVisitor extends GraphPatternRendererVisitor
         }
 
         split((p.getProperty("split") != null && !p.getProperty("split").equals("")), p.getProperty("dir") + "/");
-
-        if (p.getProperty("indent") != null) {
-            INDENT = p.getProperty("indent");
-        }
-        if (p.getProperty("newline") != null) {
-            NL = p.getProperty("newline");
-        }
     }
 
     public void visit(Alignment align) throws AlignmentException {
@@ -123,7 +116,7 @@ public class SPARQLConstructRendererVisitor extends GraphPatternRendererVisitor
             }
         }
         edoal = alignment.getLevel().startsWith("2EDOAL");
-        content_Corese = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL;
+        content_Corese = "<?xml version=\"1.0\" encoding=\""+ENC+"\"?>" + NL;
         content_Corese += "<!DOCTYPE rdf:RDF [" + NL;
         content_Corese += "<!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">" + NL;
         content_Corese += "<!ENTITY rdfs \"http://www.w3.org/2000/01/rdf-schema#\">" + NL;
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLLinkkerRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLLinkkerRendererVisitor.java
index e4384466..2bb60011 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLLinkkerRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLLinkkerRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2015
+ * Copyright (C) INRIA, 2015-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -94,7 +94,7 @@ public class SPARQLLinkkerRendererVisitor extends GraphPatternRendererVisitor im
      * Initialises the parameters of the renderer
      */
     public void init( Properties p ) {
-	init();
+	super.init( p );
         if ( p.getProperty("graphName1") != null ) {
             setGraph1Name( p.getProperty("graphName1") );
         }
@@ -149,7 +149,7 @@ public class SPARQLLinkkerRendererVisitor extends GraphPatternRendererVisitor im
         }
         edoal = alignment.getLevel().startsWith("2EDOAL");
 	if ( !edoal ) throw new AlignmentException("SPARQLLinkerRenderer: cannot render simple alignment. Need an EDOALAlignment" );
-        content_Corese = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL;
+        content_Corese = "<?xml version=\"1.0\" encoding=\""+ENC+"\"?>" + NL;
         content_Corese += "<!DOCTYPE rdf:RDF [" + NL;
         content_Corese += "<!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">" + NL;
         content_Corese += "<!ENTITY rdfs \"http://www.w3.org/2000/01/rdf-schema#\">" + NL;
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLSelectRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLSelectRendererVisitor.java
index 5402de75..388d0f1d 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLSelectRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/SPARQLSelectRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2012-2015
+ * Copyright (C) INRIA, 2012-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -70,7 +70,7 @@ public class SPARQLSelectRendererVisitor extends GraphPatternRendererVisitor imp
     }
 
     public void init( Properties p ) {
-	init();
+	super.init( p );
         if ( p.getProperty( "graphName1" ) != null ) {
             setGraph1Name( p.getProperty("graphName1") );
         }
@@ -97,12 +97,6 @@ public class SPARQLSelectRendererVisitor extends GraphPatternRendererVisitor imp
         if (p.getProperty("dir") != null && !p.getProperty("dir").equals("")) {
             splitdir = p.getProperty("dir") + "/";
         }
-        if (p.getProperty("indent") != null) {
-            INDENT = p.getProperty("indent");
-        }
-        if (p.getProperty("newline") != null) {
-            NL = p.getProperty("newline");
-        }
     }
 
     public void visit(Alignment align) throws AlignmentException {
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java
index 6c4b62a3..8e283582 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2003-2004, 2007-2010, 2012-2015
+ * Copyright (C) INRIA, 2003-2004, 2007-2010, 2012-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -61,6 +61,7 @@ public class SWRLRendererVisitor extends IndentedRendererVisitor implements Alig
     }
 
     public void init( Properties p ) {
+	super.init( p );
 	if ( p.getProperty( "embedded" ) != null 
 	     && !p.getProperty( "embedded" ).equals("") ) embedded = true;
    };
@@ -80,7 +81,7 @@ public class SWRLRendererVisitor extends IndentedRendererVisitor implements Alig
 	onto1 = ((ObjectAlignment)alignment).getOntologyObject1();
 	onto2 = ((ObjectAlignment)alignment).getOntologyObject2();
 	if ( embedded == false )
-	    indentedOutput("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+NL+NL);
+	    indentedOutput("<?xml version=\"1.0\" encoding=\""+ENC+"\"?>"+NL+NL);
 	indentedOutput("<swrlx:Ontology swrlx:name=\"generatedAl\""+NL);
 	String indentString = INDENT;
 	setIndentString( "                " );
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/XMLMetadataRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/XMLMetadataRendererVisitor.java
index 828d4766..26d9ded7 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/XMLMetadataRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/XMLMetadataRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2007, 2009-2010, 2012, 2014-2015
+ * Copyright (C) INRIA, 2007, 2009-2010, 2012, 2014-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -59,6 +59,7 @@ public class XMLMetadataRendererVisitor extends IndentedRendererVisitor implemen
     }
 
     public void init( Properties p ) {
+	super.init( p );
 	if ( p.getProperty( "embedded" ) != null 
 	     && !p.getProperty( "embedded" ).equals("") ) embedded = true;
 	if ( p.getProperty( "newstyle" ) != null 
@@ -90,7 +91,7 @@ public class XMLMetadataRendererVisitor extends IndentedRendererVisitor implemen
 	    extensionString += INDENT+INDENT+"<"+tag+">"+ext[2]+"</"+tag+">"+NL;
 	}
 	if ( embedded == false ) {
-	    indentedOutputln("<?xml version='1.0' encoding='utf-8' standalone='no'?>");
+	    indentedOutputln("<?xml version='1.0' encoding='"+ENC+"' standalone='no'?>");
 	}
 	writer.print("<rdf:RDF xmlns='"+Namespace.ALIGNMENT.uri+"'");
 	for ( Entry<String,String> e : nslist.entrySet() ) {
diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java
index f25ec415..b628a932 100644
--- a/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java
+++ b/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) INRIA, 2003-2004, 2006-2010, 2012-2015
+ * Copyright (C) INRIA, 2003-2004, 2006-2010, 2012-2016
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -69,6 +69,7 @@ public class XSLTRendererVisitor extends IndentedRendererVisitor implements Alig
     }
 
     public void init( Properties p ) {
+	super.init( p );
 	if ( p.getProperty( "embedded" ) != null 
 	     && !p.getProperty( "embedded" ).equals("") ) embedded = true;
     };
@@ -86,7 +87,7 @@ public class XSLTRendererVisitor extends IndentedRendererVisitor implements Alig
 	}
 	alignment = align;
 	if ( embedded == false )
-	    indentedOutputln("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+	    indentedOutputln("<?xml version=\"1.0\" encoding=\""+ENC+"\"?>");
 	indentedOutputln("<xsl:stylesheet version=\"1.0\"");
 	increaseIndent();
 	increaseIndent();
-- 
GitLab