Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java	(revision 3043)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java	(revision 3044)
@@ -168,7 +168,7 @@
 			if (b == null) continue;
 			String name = b.getSymbolicName();
 			if (!name.startsWith("org.txm")) continue; // only keep txm plugins (they contains the necessary plugins deps)
-			if (!name.endsWith(".rcp")) continue; // usually TXM *.rcp plugins depends on the *.core plugins
+			if (name.endsWith(".core")) continue; // usually TXM *.rcp plugins depends on the *.core plugins
 			if (defaultPlugins.contains(name)) continue;
 			
 			BundleWiring bundleWiring = b.adapt(BundleWiring.class);
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/importer/XTZImporterMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/importer/XTZImporterMacro.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/importer/XTZImporterMacro.groovy	(revision 3044)
@@ -143,7 +143,7 @@
 String ignoredElements = null;
 boolean stopIfMalformed = false;
 
-println "Trying to read import properties file: "+propertyFile
+println "Reading metadata values from:"+propertyFile
 if (propertyFile.exists() && propertyFile.canRead()) {
 	InputStreamReader input = new InputStreamReader(new FileInputStream(propertyFile) , "UTF-8");
 	props.load(input);
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy	(revision 3044)
@@ -143,11 +143,11 @@
 							
 							if (m1.matches()) {
 								if (other) {
-									println "Warning at "+getLocation()+" with $word: Found a starting * when one 'other' have been started at "+previousOtherStarting
+									println "Warning at "+getLocation(true, false, false)+" with $word: Found a starting * when one 'other' have been started at "+previousOtherStarting
 								} else {
-									if (debug) println "- ligne "+parser.getLocation().getLine()+" : ouverture de other avec '$word' -> tours '$turnInfos'"
+									if (debug) println "- ligne "+parser.getLocation().getLineNumber()+" : ouverture de other avec '$word' -> tours '$turnInfos'"
 									//close current Turn and start a 'other' Turn
-									previousOtherStarting = ["word="+word+ " location="+getLocation()]
+									previousOtherStarting = ["word="+word+ " location="+getLocation(true, false, false)]
 									String group1 = m1.group(1)
 									if (group1.length() > 0) {
 										writeWord(group1)
@@ -173,6 +173,11 @@
 									}
 									writer.writeCharacters("\n")
 									
+									writer.writeStartElement("Sync")
+									writer.writeAttribute("time", tmpInfos["startTime"])
+									writer.writeCharacters("\n")
+									writer.writeEndElement()
+									
 									other = true
 									word = m1.group(2)
 								}
@@ -181,15 +186,15 @@
 							boolean shouldCloseOtherTurn = false;
 							def m2 = word =~ endOtherReg
 							if (m2.matches()) {
-								if (debug) println "- ligne "+parser.getLocation().getLine()+" : fermeture de other avec '$word' -> tours '$turnInfos'"
-								previousOtherStarting = ["word="+word+ " location="+getLocation()]
+								if (debug) println "- ligne "+parser.getLocation().getLineNumber()+" : fermeture de other avec '$word' -> tours '$turnInfos'"
+								previousOtherStarting = ["word="+word+ " location="+getLocation(true, false, false)]
 								if (other) {
 									shouldCloseOtherTurn = true;
 									
 									word = m2.group(1)
 									other = false
 								} else {
-									println "Warning at "+getLocation()+" with $word: Found a closing * when one 'other' have been closed at "+previousOtherStarting
+									println "Warning at "+getLocation(true, false, false)+" with $word: Found a closing * when one 'other' have been closed at "+previousOtherStarting
 								}
 							}
 							
@@ -212,6 +217,11 @@
 								}
 								writer.writeCharacters("\n")
 								
+								writer.writeStartElement("Sync")
+								writer.writeAttribute("time", turnInfos["startTime"])
+								writer.writeCharacters("\n")
+								writer.writeEndElement()
+								
 								if (m2.group(2).length() > 0) {
 									writeWord(m2.group(2))
 								}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/PrepareTranscriptionsMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/PrepareTranscriptionsMacro.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/PrepareTranscriptionsMacro.groovy	(revision 3044)
@@ -72,7 +72,7 @@
 for (File file : trsFiles) {
 	
 	if (debug) println "== $file =="
-	else cpb.tick()
+	//else cpb.tick()
 	
 	CreateTheOtherTurns fixer = new CreateTheOtherTurns(file, primarySpeakerIdRegex, otherNonPrimarySpeakerId, debug)
 	String name = FileUtils.stripExtension(file)
@@ -85,7 +85,7 @@
 }
 cpb.done()
 
-println "CONVERTIGN WORD MARKERS TO EVENTS..."
+println "CONVERTING WORD MARKERS TO EVENTS..."
 
 trsFiles = otherDirectory.listFiles().findAll(){it.getName().toLowerCase().endsWith(".trs")}
 if (trsFiles.size() == 0) {
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/SegmentTRSInSectionFromMarkerMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/SegmentTRSInSectionFromMarkerMacro.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/SegmentTRSInSectionFromMarkerMacro.groovy	(revision 3044)
@@ -86,6 +86,8 @@
 		def previousSection = trsSection
 		def currentSection = trsSection
 		
+		def nFound = 0
+		
 		for (int iTurn = 0 ; iTurn < turns.size() ; iTurn++) {
 			def turn = turns[iTurn]
 			def previousTurn = turn
@@ -125,6 +127,8 @@
 						newTurn.attributes()["startTime"] = start
 						turn.attributes()["endTime"] = start
 						
+						nFound++
+						
 					}
 					
 					children.remove(i) // remove the mark
@@ -142,6 +146,10 @@
 			currentSection.append(turn)
 		}
 		
+		if (nFound == 0) {
+			println "** $trsFile : aucun marqueur '$newSectionMarker' trouvé."
+		}
+		
 		resultDirectory.mkdir()
 		File outfile = new File(resultDirectory, trsFile.getName())
 		outfile.withWriter("UTF-8") { writer ->
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/TXT2TRS.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/TXT2TRS.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/TXT2TRS.groovy	(revision 3044)
@@ -179,7 +179,7 @@
 		for (String line : lines) {
 			if (line.indexOf("\t") > 0) { // start of Turn
 				def split = line.split("\t", 2)
-				def loc = split[0]
+				def loc = split[0].replace(" ", "_")
 				def content = split[1]
 
 				if (currentGroup.size() > 0) {groups << currentGroup} // store previous group
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakers.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakers.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakers.groovy	(revision 3044)
@@ -113,7 +113,8 @@
 				}
 			}
 			
-			if (debug) println "$nReplace replacements"
+			if (debug) println "id=$idRegex or name=$nameRegex -> $nReplace replacements"
+			if (nReplace == 0) println "Warning found no replacement for id=$idRegex or name=$nameRegex"
 			
 			// Création de la source DOM
 			Source source = new DOMSource(doc);
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy	(revision 3044)
@@ -91,7 +91,7 @@
 String ignoredElements = null
 boolean stopIfMalformed = false
 
-println "Trying to read import properties file: "+propertyFile
+println "Reading metadata values from:"+propertyFile
 if (propertyFile.exists() && propertyFile.canRead()) {
 	InputStreamReader input = new InputStreamReader(new FileInputStream(propertyFile) , "UTF-8")
 	props.load(input)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivaLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivaLoader.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivaLoader.groovy	(revision 3044)
@@ -91,7 +91,7 @@
 String ignoredElements = null;
 boolean stopIfMalformed = false;
 
-println "Trying to read import properties file: "+propertyFile
+println "Reading metadata values from:"+propertyFile
 if (propertyFile.exists() && propertyFile.canRead()) {
 	InputStreamReader input = new InputStreamReader(new FileInputStream(propertyFile) , "UTF-8");
 	props.load(input);
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/pager.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/pager.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/pager.groovy	(revision 3044)
@@ -351,7 +351,7 @@
 									writer.writeEndElement(); // td
 								}
 								//get enqueteur to style their names
-								if (name.equals("out-of-text-to-edit-locutor")) {
+								if (name.equals("interviewer-id-regex")) {
 									interviewers = /$value/
 								}
 								writer.writeEndElement(); // tr
@@ -419,12 +419,14 @@
 							break;
 						case "div":
 						
-							nbBreak++
-							writer.writeEmptyElement("pb");
-							writer.writeAttribute("id", ""+nbBreak);
-							writer.writeCharacters("\n");
 						
+						
 							if (paginate && paginateSections) {
+								nbBreak++
+								writer.writeEmptyElement("pb");
+								writer.writeAttribute("id", ""+nbBreak);
+								writer.writeCharacters("\n");
+								
 								pages << new File(defaultDir, "${txtname}_${nbBreak}.html")
 								indexes << wordid
 							}
@@ -808,7 +810,7 @@
 						
 							if (interpvalue.contains("rapp1")) {
 								writer.writeCharacters(" «");
-							} 
+							}
 						
 							writer.writeStartElement("span");
 							writer.writeAttribute("class", "word");
@@ -855,9 +857,11 @@
 		}
 		writer.writeEndElement(); // body
 		
-		writer.writeEmptyElement("pb");
-		nbBreak++
-		writer.writeAttribute("id", ""+nbBreak);
+		if (paginate) {
+			writer.writeEmptyElement("pb");
+			nbBreak++
+			writer.writeAttribute("id", ""+nbBreak);
+		}
 		
 		writer.writeEndElement(); // html
 		writer.close();
@@ -876,8 +880,8 @@
 		//		println "pages: "+pages
 		//		println "words: "+indexes
 		
-		
 		if (pages.size() > 1) {
+
 			for (int i = 1 ; i < nbBreak ; i++) {
 				ApplyXsl2 a = new ApplyXsl2(xslfile.getAbsolutePath());
 				String[] params = ["pbval1", i, "pbval2", i+1];
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/transcriberLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/transcriberLoader.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/transcriberLoader.groovy	(revision 3044)
@@ -102,7 +102,7 @@
 //get metadata values from CSV
 Metadatas metadatas; // text metadata
 File allMetadataFile = Metadatas.findMetadataFile(srcDir);
-println "Trying to read metadata values from: "+allMetadataFile
+println "Reading metadata values from: "+allMetadataFile
 if (allMetadataFile.exists()) {
 	File copy = new File(binDir, allMetadataFile.getName())
 	if (!FileCopy.copy(allMetadataFile, copy)) {
@@ -155,7 +155,7 @@
 		}
 		for (int i = 0 ; i < trsfiles.size() ; i++) {
 			File f = trsfiles.get(i);
-			if (!f.getName().endsWith(ext) || !f.canRead() || f.isHidden()) {
+			if (!f.getName().endsWith(ext) || !f.canRead() || f.isHidden() || f.isDirectory()) {
 				trsfiles.remove(i)
 				i--;
 			}
@@ -185,29 +185,7 @@
 			}
 		}
 
-		if (MONITOR != null) MONITOR.worked(5)
 		if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
-		println "-- Remove interviewer: "+(!indexInterviewer)
-		if (!indexInterviewer) 	{
-			if (metadatas == null || !metadatas.headersList.contains("interviewer-id-regex")) {
-				println "Can't remove interviewer without a metadata.csv file defining who are the interviewers. Add the 'interviewer-id-regex' column"
-			} else {
-				println "Removing some speakers in "+txmDir.listFiles().length+" file(s)"
-				for (File infile : txmDir.listFiles()) {
-					String filename = FileUtils.stripExtension(infile);
-					
-					ArrayList<Pair<String, String>> metas = metadatas.get(filename)
-					//println "filename=$filename metas= $metas"
-					for (Pair p : metas) {
-						if (p.getFirst().startsWith("interviewer-id-regex")) {
-							new RemoveSpeaker(infile, infile, p.getSecond())
-						}
-					}
-				}
-			}
-		}
-
-		if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 		if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
 
 		boolean annotationSuccess = false;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/TranscriberTokenizer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/TranscriberTokenizer.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/TranscriberTokenizer.groovy	(revision 3044)
@@ -184,11 +184,11 @@
 	/* (non-Javadoc)
 	 * @see filters.Tokeniser.SimpleTokenizerXml#writeWordAttributes()
 	 */
-	protected writeWordAttributes()
-	{
-		writer.writeAttribute("id","w_"+txtname+"_"+wordcount);
-		writer.writeAttribute("audio", audio);
-		writer.writeAttribute("event", event);
-		writer.writeAttribute("notation", notation);
+	protected writeWordAttributes() {
+		super.writeWordAttributes()
+		
+		if (!retokenizedWordProperties.containsKey("audio")) writer.writeAttribute("audio", audio);
+		if (!retokenizedWordProperties.containsKey("event")) writer.writeAttribute("event", event);
+		if (!retokenizedWordProperties.containsKey("notation")) writer.writeAttribute("notation", notation);
 	}
 }
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 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy	(revision 3044)
@@ -91,7 +91,9 @@
 
 	/** The interviewers regex */
 	def interviewers = null
-	static HashSet<String> sectionAttrs;
+	static LinkedHashSet<String> sectionAttrs;
+	static LinkedHashSet<String> spAttrs;
+	static LinkedHashSet<String> uAttrs;
 
 	/** The anatypes. */
 	private static anatypes = []
@@ -127,7 +129,9 @@
 		anatypes = ["event"] // reset
 		anavalues = [:] // reset
 
-		sectionAttrs = new HashSet<String>() // reset section attributs set
+		sectionAttrs = new LinkedHashSet<String>() // reset section attributs set
+		spAttrs = new LinkedHashSet<String>() // reset section attributs set
+		uAttrs = new LinkedHashSet<String>() // reset section attributs set
 
 		CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
 		if (corpus != null) {
@@ -192,15 +196,29 @@
 		cwbEn.setDebug(debug);
 		cwbMa.setDebug(debug);
 
-		String uAttr = "u:0+n+spkid+who+scope+accent+start+time+check+dialect+type";
+		String uAttr = "u:0";
+		for (String attr : uAttrs) {
+			uAttr += "+"+attr
+		}
+		
+		String spAttr = "sp:0";
+		for (String attr : spAttrs) {
+			spAttr += "+"+attr
+		}
+		
+		String sectionAttr = "div:0" // "div:0+id+topic+endtime+starttime+type"
+		for (String attr : sectionAttrs) {
+			sectionAttr += "+"+attr
+		}
+		
 		String textAttr ="text:0+base+project"
 		if (trans != null) {
 			for (String key : trans.keySet()) {
 				for (Pair p : trans.get(key)) {
 					if (ignoreTranscriberMetadata) {
 						String meta =p.getFirst();
-						if (	meta != "scribe" && meta != "audio_filename" &&
-						meta != "version" && meta != "version_date")
+						if (meta != "scribe" && meta != "audio_filename" &&
+							meta != "version" && meta != "version_date")
 							textAttr+="+"+meta
 					} else {
 						textAttr+="+"+p.getFirst()
@@ -210,17 +228,12 @@
 			}
 		}
 
-		String sectionAttr = "div:0" // "div:0+id+topic+endtime+starttime+type"
-		for (String attr : sectionAttrs) {
-			sectionAttr += "+"+attr
-		}
-
 		List<String> pargs = ["spk", "ref", "id", "entitytype", "entityid"]
-		for (String ana : anatypes) pargs.add(ana)
+		for (String ana : anatypes) if (!pargs.contains(ana)) pargs.add(ana)
 
 		String[] pAttributes = pargs
 
-		String[] sAttributes = ["txmcorpus:0+lang", uAttr , textAttr, "event:0+id+desc+type+extent", sectionAttr, "sp:0+n+who+end+start+overlap+time"];
+		String[] sAttributes = ["txmcorpus:0+lang", uAttr , textAttr, "event:0+id+desc+type+extent", sectionAttr, spAttr];
 
 		println "pAttributes: $pAttributes"
 		println "sAttributes: $sAttributes"
@@ -365,7 +378,11 @@
 							break;
 						case "sp":
 							output.write("<sp");
-							writeAttributes();
+							for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+								String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
+								output.write(" "+name+"=\""+parser.getAttributeValue(i).replace("\"", "&quot;")+"\"");
+								spAttrs << name
+							}
 							output.write ">\n"
 							break;
 						case "u":
@@ -373,8 +390,13 @@
 							for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
 								String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
 								output.write(" "+name+"=\""+parser.getAttributeValue(i).replace("\"", "&quot;")+"\"");
-								if (name == "time") formatedTime = parser.getAttributeValue(i)
-								else if (name == "who") u_name = parser.getAttributeValue(i)
+								if (name == "time") { 
+									formatedTime = parser.getAttributeValue(i) 
+								} else if (name == "who") { 
+									u_name = parser.getAttributeValue(i) 
+								}
+									
+								spAttrs << name
 							}
 							output.write ">\n"
 							break;
@@ -510,8 +532,8 @@
 
 							vForm = vForm.replaceAll("\n", "").replaceAll("&", "&amp;").replaceAll("<", "&lt;");
 
-							if (!indexInterviewer) {
-								if (!interviewers.matches(u_name)) {
+							if (interviewers != null && !indexInterviewer) { // we must remove some words
+								if (!interviewers.matches(u_name)) { // keep what is now an interviewer
 									output.write(vForm+"\t"+wordid+vAna+"\n");
 								}
 							} else {
@@ -660,7 +682,7 @@
 
 						for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
 							list.add(new Pair(parser.getAttributeLocalName(i).replace("_","").toLowerCase(), parser.getAttributeValue(i)));
-							if (parser.getAttributeLocalName(i).equals("out-of-text-to-edit-locutor"))
+							if (parser.getAttributeLocalName(i).equals("interviewer-id-regex"))
 								interviewers = /${parser.getAttributeValue(i)}/;
 						}
 						return
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImport.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImport.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImport.groovy	(revision 3044)
@@ -78,7 +78,7 @@
 			}
 		}
 		
-		println "Sorting texts using the 'textorder' metadata values: "+textorder
+		println "Sorting texts using the 'text-order' metadata values: "+textorder
 		def texts = project.getTextsID();
 		Collections.sort(texts, new Comparator<String>() {
 			public int compare(String f1, String f2) {
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZDefaultPagerStep.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZDefaultPagerStep.groovy	(revision 3043)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZDefaultPagerStep.groovy	(revision 3044)
@@ -233,6 +233,7 @@
 			pagedWriter.writeEndElement() // </head>
 			pagedWriter.writeCharacters("\n")
 			pagedWriter.writeStartElement("body") //<body>
+			pagedWriter.writeStartElement("div", ["class": pager.getImportModule().getProject().getName()]) //<div> of the corpus
 			pagedWriter.writeStartElement("div", ["class": "txmeditionpage"]) //<div>
 			//			println "OPENING: $tags"
 			pagedWriter.writeStartElements(tags)
@@ -302,12 +303,15 @@
 			def anaResp = ""
 			def anaValue = new StringBuilder()
 			
-			boolean flagNote = false;
-			String noteContent = "";
+			boolean flagNote = false
+			boolean flagW = false
+			boolean allTags = true
+			String noteContent = ""
+			String noteType = ""
 			String rend = ""
 			goToText();
 			
-			String localname = "";
+			String localname = ""
 			if (!createNextOutput()) {
 				return false;
 			}
@@ -334,7 +338,7 @@
 						}
 					
 						rend = getAttributeValue(parser, null, "rend")
-						if (rend == null) rend = "";
+						if (rend == null) rend = "none";
 					
 						switch (localname) {
 							case "text":
@@ -354,20 +358,27 @@
 									pagedWriter.writeStartElement("button", ["class":"collapsible", "onclick":"onCollapsibleClicked(this)"])
 									pagedWriter.writeCharacters("➕");
 									pagedWriter.writeEndElement()
+									
+									pagedWriter.writeStartElement("div", ["class":"collapsiblecontent"])
 								}
 								
-								pagedWriter.writeStartElement("table");
-								if (enableCollapsibles && attributes.keySet().size() > 2) pagedWriter.writeAttribute("class", "collapsiblecontent")
+								pagedWriter.writeStartElement("table", ["class":"metadata"]);
+								
 								for (String k : attributes.keySet()) {
 									if (k == "id") continue;
 									if (k == "rend") continue;
 									
+									println "open tr"
 									pagedWriter.writeStartElement("tr")
-									pagedWriter.writeElement("td", k)
-									pagedWriter.writeElement("td", attributes[k])
+									pagedWriter.writeAttribute("class", "metadata-line")
+									pagedWriter.writeElement("td", ["class": "metadata-cell"], k)
+									pagedWriter.writeElement("td", ["class": "metadata-cell"], attributes[k])
 									pagedWriter.writeEndElement() //tr
 								}
 								pagedWriter.writeEndElement() // table
+								if (enableCollapsibles && attributes.keySet().size() > 2) {
+									pagedWriter.writeEndElement() // div@class=collapsiblecontent
+								}
 								pagedWriter.writeEndElement() // p
 								pagedWriter.writeCharacters("\n")
 								break;
@@ -458,10 +469,12 @@
 							case "div4":
 							case "div5":
 								pagedWriter.writeStartElement("div", ["class":rend, "type":localname])
+								pagedWriter.write("\n");
 								break;
 							case "lb":
 							//case "l":
-								pagedWriter.writeEmptyElement("br", ["class":rend])
+								pagedWriter.writeStartElement("br", ["class":rend])
+								pagedWriter.writeEndElement()
 								break;
 							case wordTag:
 								wordid = getAttributeValue(parser, null,"id");
@@ -475,7 +488,7 @@
 									firstWord = false;
 									this.idxstart.add(wordid);
 								}
-							
+								flagW = true
 								break;
 							case "ana":
 								flaginterp=true;
@@ -491,10 +504,10 @@
 								if (noteElements.contains(localname)) {
 									flagNote = true;
 									noteContent = ""
+									noteType = getAttributeValue(parser, null, "type")
+								} else if (allTags && !flagW) {
+									pagedWriter.writeStartElement("span", ["class":localname])
 								}
-							//							 else {
-							//								pagedWriter.writeStartElement("span", ["class":localname])
-							//							}
 								break;
 						}
 						break;
@@ -515,6 +528,8 @@
 								pagedWriter.writeEndElement() // </p>
 								pagedWriter.write("\n")
 								break;
+							case "lb":
+								break;
 							case "div":
 							case "div1":
 							case "div2":
@@ -528,6 +543,8 @@
 								pagedWriter.writeEndElement() // </h2>
 								pagedWriter.write("\n")
 								break;
+							case "graphic":
+								break;
 							case "list":
 								pagedWriter.writeEndElement() // ul or ol
 								pagedWriter.write("\n")
@@ -587,18 +604,21 @@
 								pagedWriter.writeEndElement()
 							//pagedWriter.writeComment("\n")
 								lastword=wordvalue;
+								flagW = false
 								break;
 							default:
 								if (noteElements.contains(localname)) {
 									flagNote = false;
 									if (noteContent.length() > 0) {
 										notes << noteContent;
-										pagedWriter.writeStartElement("a", ["href":"#note_"+notes.size(), "name":"noteref_"+notes.size(), "title":noteContent]);
+										pagedWriter.writeStartElement("a", ["class": "note", "href":"#note_"+notes.size(), "name":"noteref_"+notes.size(), "title":noteContent, "type":noteType]);
 										pagedWriter.writeStartElement("sup")
 										pagedWriter.writeCharacters(""+notes.size())
 										pagedWriter.writeEndElement() // </sub>
 										pagedWriter.writeEndElement() // </a>
 									}
+								} else if (allTags && !flagW) {
+									pagedWriter.writeEndElement() // </span@class=localname>
 								}
 							//							else {
 							//								pagedWriter.writeEndElement() // the element
