Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy	(revision 2380)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy	(revision 2381)
@@ -354,7 +354,7 @@
 							output.write("<div");
 							for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
 								String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
-								output.write(" "+name+"=\""+parser.getAttributeValue(i)+"\"");
+								output.write(" "+name+"=\""+parser.getAttributeValue(i).replace("\"", "&quot;")+"\"");
 								sectionAttrs << name
 							}
 							output.write ">\n"
@@ -368,7 +368,7 @@
 							output.write("<u");
 							for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
 								String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
-								output.write(" "+name+"=\""+parser.getAttributeValue(i)+"\"");
+								output.write(" "+name+"=\""+parser.getAttributeValue(i).replace("\"", "&quot;")+"\"");
 								if (name == "time") formatedTime = parser.getAttributeValue(i)
 								else if (name == "spk") u_name = parser.getAttributeValue(i)
 							}
@@ -539,7 +539,7 @@
 	 */
 	private void writeAttributes() {
 		for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
-			output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"");
+			output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+parser.getAttributeValue(i).replace("\"", "&quot;")+"\"");
 		}
 	}
 
@@ -564,9 +564,11 @@
 		if (parser != null) parser.close();
 		if (inputData != null) inputData.close();
 		
-		for (String type : types)
-			if (!anatypes.contains(type))
+		for (String type : types) {
+			if (!anatypes.contains(type)) {
 				anatypes << type
+			}
+		}
 	}
 
 	/**
@@ -677,5 +679,4 @@
 	public void setDebug() {
 		debug = true;
 	}
-
-}
\ No newline at end of file
+}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZCompilerStep.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZCompilerStep.groovy	(revision 2380)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZCompilerStep.groovy	(revision 2381)
@@ -16,57 +16,57 @@
  */
 public class XTZCompilerStep extends Step {
 
-	static String FORM = "form";
-	static String ANA = "ana";
-	static String ID = "id";
-	static String TYPE = "type";
-	static String TAB = "\t";
-	static String QUOTE = "\"";
+	static String FORM = "form"
+	static String ANA = "ana"
+	static String ID = "id"
+	static String TYPE = "type"
+	static String TAB = "\t"
+	static String QUOTE = "\""
 
 	File xmlFile
 	File cqpFile
-	String textname, corpusname, projectname;
-	boolean normalizeAttributeValues = false;
-	boolean normalizeAnaValues = true;
-	boolean normalizeFormValues = true;
+	String textname, corpusname, projectname
+	boolean normalizeAttributeValues = false
+	boolean normalizeAnaValues = true
+	boolean normalizeFormValues = true
 
-	def inputData;
-	XMLInputFactory factory;
-	XMLStreamReader parser;
-	OutputStreamWriter output;
+	def inputData
+	XMLInputFactory factory
+	XMLStreamReader parser
+	OutputStreamWriter output
 
-	def anavalues = [:];
-	def anatypes;
+	def anavalues = [:]
+	def anatypes
 
 	String WTAG = "w"
 
 	public void setNormalizeAttributeValues(boolean n) {
-		this.normalizeAttributeValues = n;
+		this.normalizeAttributeValues = n
 	}
 
 	public void setNormalizeAnaValues(boolean n) {
-		this.normalizeAnaValues = n;
+		this.normalizeAnaValues = n
 	}
 
 	public void setNormalizeFormValues(boolean n) {
-		this.normalizeFormValues = n;
+		this.normalizeFormValues = n
 	}
 
 	public XTZCompilerStep(File xmlFile, File cqpFile, String textname, String corpusname, String projectname, def anatypes, def wtag) {
-		this.xmlFile = xmlFile;
-		this.cqpFile = cqpFile;
+		this.xmlFile = xmlFile
+		this.cqpFile = cqpFile
 		this.textname = textname
-		this.corpusname = corpusname;
-		this.projectname = projectname;
-		this.anatypes = anatypes;
+		this.corpusname = corpusname
+		this.projectname = projectname
+		this.anatypes = anatypes
 		this.WTAG = wtag
 
 		try {
-			inputData = xmlFile.toURI().toURL().openStream();
-			factory = XMLInputFactory.newInstance();
-			parser = factory.createXMLStreamReader(inputData);
+			inputData = xmlFile.toURI().toURL().openStream()
+			factory = XMLInputFactory.newInstance()
+			parser = factory.createXMLStreamReader(inputData)
 		} catch (Exception ex) {
-			System.err.println("Exception while parsing $xmlFile : "+ex);
+			System.err.println("Exception while parsing $xmlFile : "+ex)
 		}
 	}
 
@@ -79,11 +79,11 @@
 	 */
 	private boolean createOutput(File f) {
 		try {
-			output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f)) , "UTF-8");
-			return true;
+			output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f)) , "UTF-8")
+			return true
 		} catch (Exception e) {
-			System.err.println(e);
-			return false;
+			System.err.println(e)
+			return false
 		}
 	}
 
@@ -94,17 +94,16 @@
 	 * @param fileName the file name
 	 * @return true, if successful
 	 */
-	public boolean process()
-	{
+	public boolean process() {
 		if (!createOutput(cqpFile)) {
-			return false;
+			return false
 		}
 		
-		String headvalue=""
-		String vAna = "";
-		String vForm = "";
-		String wordid= "";
-		String vHead = "";
+		String headvalue = ""
+		String vAna = ""
+		String vForm = ""
+		String wordid= ""
+		String vHead = ""
 
 		int p_id = 0;
 		int s_id = 0;
@@ -125,8 +124,7 @@
 		int nWords = 0;
 		try {
 			String localname;
-			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
-			{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 				switch (event) {
 					case XMLStreamConstants.START_ELEMENT:
 						localname = parser.getLocalName().toLowerCase();
@@ -139,11 +137,12 @@
 									String attrname = parser.getAttributeLocalName(i);
 									String attrvalue = parser.getAttributeValue(i)
 
-									if (normalizeAttributeValues)
+									if (normalizeAttributeValues) {
 										attrvalue = attrvalue.trim();
-
-									if (attrname != ID)
-										output.write(" "+attrname.toLowerCase()+"=\""+attrvalue+QUOTE)
+									}
+									if (attrname != ID) {
+										output.write(" "+attrname.toLowerCase()+"=\""+attrvalue.replace("\"", "&quot;")+QUOTE)
+									}
 								}
 								output.write(">\n");
 
@@ -180,24 +179,24 @@
 							default:
 								if (!foundtei || !foundtext) break;
 
-								output.write("<"+localname);
+								output.write("<"+localname)
 
 								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
-									String attrname = parser.getAttributeLocalName(i);
+									String attrname = parser.getAttributeLocalName(i)
 
 									String attrvalue = parser.getAttributeValue(i)
-									if (normalizeAttributeValues)
-										attrvalue = attrvalue.trim();
-
-									output.write(" "+attrname.toLowerCase()+"=\""+attrvalue+QUOTE)
+									if (normalizeAttributeValues) {
+										attrvalue = attrvalue.trim()
+									}
+									output.write(" "+attrname.toLowerCase()+"=\""+attrvalue.replace("\"", "&quot;")+QUOTE)
 								}
 								if (parser.getAttributeCount() == 0) { // add the n attribute
-									if (!ncounts.containsKey(localname)) ncounts.put(localname, 0);
-									int ncount = ncounts.get(localname);
-									ncounts.put(localname, ncount+1);
+									if (!ncounts.containsKey(localname)) ncounts.put(localname, 0)
+									int ncount = ncounts.get(localname)
+									ncounts.put(localname, ncount+1)
 									output.write(" n=\""+ncount+QUOTE)
 								}
-								output.write(">\n");
+								output.write(">\n")
 						}
 						break;
 
@@ -251,10 +250,11 @@
 								}
 							}
 							if (flagAna) {
-								if (normalizeAnaValues)
+								if (normalizeAnaValues) {
 									anavalue += parser.getText().trim();
-								else
+								} else {
 									anavalue += parser.getText();
+								}
 							}
 						}
 						break;
